search for: ocfs2_inode_unlock

Displaying 20 results from an estimated 50 matches for "ocfs2_inode_unlock".

2009 Jan 12
1
Bug in inode deletion code leading to stale inodes
...s happening is as follows: node1 node2 rmdir("d"); ocfs2_remote_dentry_delete() ocfs2_dentry_convert_worker() finishes ocfs2_unlink() eventually enters ocfs2_delete_inode() ocfs2_inode_lock() ocfs2_query_inode_wipe() -> fail ocfs2_inode_unlock() ocfs2_dentry_post_unlock() ocfs2_drop_dentry_lock() iput() ocfs2_delete_inode() ocfs2_inode_lock() ocfs2_query_inode_wipe() -> fail ocfs2_inode_unlock() clear_inode() clear_inode() The question is how to avoid this. It seems to me that we ha...
2009 Jun 19
2
[PATCH] ocfs2: Update atime in splice read if necessary.
...+2036,12 @@ static ssize_t ocfs2_file_splice_read(struct file *in, /* * See the comment in ocfs2_file_aio_read() */ - ret = ocfs2_inode_lock(inode, NULL, 0); + ret = ocfs2_inode_lock_atime(inode, in->f_vfsmnt, &lock_level); if (ret < 0) { mlog_errno(ret); goto bail; } - ocfs2_inode_unlock(inode, 0); + ocfs2_inode_unlock(inode, lock_level); ret = generic_file_splice_read(in, ppos, pipe, len, flags); -- 1.6.2.rc2.16.gf474c
2013 May 06
2
[PATCH] ocfs2: unlock rw lock if inode lock failed
...on(+), 1 deletion(-) diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 6474cb4..e2cd7a8 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -2290,7 +2290,7 @@ relock: ret = ocfs2_inode_lock(inode, NULL, 1); if (ret < 0) { mlog_errno(ret); - goto out_sems; + goto out; } ocfs2_inode_unlock(inode, 1); -- 1.7.9.7
2013 Mar 11
1
[PATCH 1/2] ocfs2: Delay inode update transactions after verifying the input flags
...ERR(handle); + mlog_errno(status); + goto bail_unlock; } ocfs2_inode->ip_attr = flags; @@ -130,8 +130,8 @@ static int ocfs2_set_inode_attr(struct inode *inode, unsigned flags, if (status < 0) mlog_errno(status); -bail_commit: ocfs2_commit_trans(osb, handle); + bail_unlock: ocfs2_inode_unlock(inode, 1); bail: -- 1.7.9.5
2013 Jun 20
2
[PATCH] ocfs2: llseek requires to ocfs2 inode lock for the file in SEEK_END
...ce) case SEEK_SET: break; case SEEK_END: + /* SEEK_END requires the OCFS2 inode lock for the file + * because it references the file's size. + */ + ret = ocfs2_inode_lock(inode, NULL, 0); + if (ret < 0) { + mlog_errno(ret); + goto out; + } offset += inode->i_size; + ocfs2_inode_unlock(inode, 0); break; case SEEK_CUR: if (offset == 0) { -- 1.7.9.7
2023 May 20
3
[PATCH v21 22/30] ocfs2: Provide a splice-read stub
...e inode fields like i_size. + * This allows the checks down below generic_file_splice_read() a + * chance of actually working. + */ + ret = ocfs2_inode_lock_atime(inode, in->f_path.mnt, &lock_level, true); + if (ret < 0) { + if (ret != -EAGAIN) + mlog_errno(ret); + goto bail; + } + ocfs2_inode_unlock(inode, lock_level); + + ret = filemap_splice_read(in, ppos, pipe, len, flags); + trace_filemap_splice_read_ret(ret); +bail: + return ret; +} + /* Refer generic_file_llseek_unlocked() */ static loff_t ocfs2_file_llseek(struct file *file, loff_t offset, int whence) { @@ -2744,7 +2781,7 @@ const st...
2009 Jul 13
1
[PATCH 1/1] adds mlogs to aops.c
...r the dlm code to avoid page * lock inversion, but don't bother with retrying. */ ret = ocfs2_inode_lock_full(inode, NULL, 0, OCFS2_LOCK_NONBLOCK); - if (ret) - return err; + if (ret) { + mlog_errno(ret); + goto bail; + } if (down_read_trylock(&oi->ip_alloc_sem) == 0) { ocfs2_inode_unlock(inode, 0); - return err; + goto bail; } /* @@ -378,7 +395,8 @@ static int ocfs2_readpages(struct file *filp, struct address_space *mapping, out_unlock: up_read(&oi->ip_alloc_sem); ocfs2_inode_unlock(inode, 0); - +bail: + mlog_exit(err); return err; } @@ -397,7 +415,7 @@ sta...
2009 Jul 21
1
(no subject)
...r the dlm code to avoid page * lock inversion, but don't bother with retrying. */ ret = ocfs2_inode_lock_full(inode, NULL, 0, OCFS2_LOCK_NONBLOCK); - if (ret) - return err; + if (ret) { + mlog_errno(ret); + goto bail; + } if (down_read_trylock(&oi->ip_alloc_sem) == 0) { ocfs2_inode_unlock(inode, 0); - return err; + goto bail; } /* @@ -378,7 +397,8 @@ static int ocfs2_readpages(struct file *filp, struct address_space *mapping, out_unlock: up_read(&oi->ip_alloc_sem); ocfs2_inode_unlock(inode, 0); - +bail: + mlog_exit(err); return err; } @@ -397,7 +417,7 @@ sta...
2009 Feb 17
1
[PATCH 1/1] OCFS2: anti stale inode for nfs (V3)
..."test suballoc bit failed %d\n", status); + goto inode_unlock; + } + /* allocate bit is clear, inode is a stale inode */ + if (!set) { + status = -ESTALE; + goto inode_unlock; + } - if (IS_ERR(inode)) - return (void *)inode; + inode = ocfs2_iget(osb, blkno, 0, 0); +inode_unlock: + ocfs2_inode_unlock(inode_alloc_inode, 0); + +unlock_mutex: + mutex_unlock(&inode_alloc_inode->i_mutex); + iput(inode_alloc_inode); + brelse(alloc_bh); + +unlock_nfs_sync: + ocfs2_nfs_sync_unlock(osb, 1); + +check_err: + if (status < 0) { + if (status == -ESTALE) { + mlog(0, "stale inode ino: %llu ge...
2013 Oct 21
1
Kernel BUG in ocfs2_get_clusters_nocache
...fffffff81146e2b>] generic_file_aio_read+0x6bb/0x720 [Fri Oct 18 10:52:28 2013] [<ffffffff8172168e>] ? _raw_spin_lock+0xe/0x20 [Fri Oct 18 10:52:28 2013] [<ffffffffa02843db>] ? __ocfs2_cluster_unlock.isra.32+0x9b/0xe0 [ocfs2] [Fri Oct 18 10:52:28 2013] [<ffffffffa02847a9>] ? ocfs2_inode_unlock+0xb9/0x130 [ocfs2] [Fri Oct 18 10:52:28 2013] [<ffffffffa028dcf9>] ocfs2_file_aio_read+0xd9/0x3c0 [ocfs2] [Fri Oct 18 10:52:28 2013] [<ffffffff811ae425>] do_sync_readv_writev+0x65/0x90 [Fri Oct 18 10:52:28 2013] [<ffffffff811afba2>] do_readv_writev+0xd2/0x2b0 [Fri Oct 18 10:5...
2009 Jul 21
1
[PATCH 1/1] ocfs2: adds mlogs to aops.c -V2
...r the dlm code to avoid page * lock inversion, but don't bother with retrying. */ ret = ocfs2_inode_lock_full(inode, NULL, 0, OCFS2_LOCK_NONBLOCK); - if (ret) - return err; + if (ret) { + mlog_errno(ret); + goto bail; + } if (down_read_trylock(&oi->ip_alloc_sem) == 0) { ocfs2_inode_unlock(inode, 0); - return err; + goto bail; } /* @@ -378,7 +397,8 @@ static int ocfs2_readpages(struct file *filp, struct address_space *mapping, out_unlock: up_read(&oi->ip_alloc_sem); ocfs2_inode_unlock(inode, 0); - +bail: + mlog_exit(err); return err; } @@ -397,7 +417,7 @@ sta...
2010 Oct 09
2
[PATCH 1/2] Ocfs2: Add a mount option "coherency=*" for O_DIRECT writes.
Currently, default behavior of O_DIRECT writes was allowing concurrent writing among nodes, no cluster coherency guaranteed (no EX locks was taken), it hurts buffered reads on other nodes by reading stale data from cache. The new mount option introduce a chance to choose two different behaviors for O_DIRECT writes: * coherency=full, as the default value, will disallow concurrent
2012 Jun 21
1
echo 0 > /proc/sys/kernel/hung_task_timeout_secs and others error, Part II
...:42:01 H3CRDS11-RD kernel: [17509.034959] [<ffffffffa052bf26>] ocfs2_write_begin+0xf6/0x210 [ocfs2] Jun 20 20:42:01 H3CRDS11-RD kernel: [17509.034968] [<ffffffff8111752a>] generic_perform_write+0xca/0x210 Jun 20 20:42:01 H3CRDS11-RD kernel: [17509.034991] [<ffffffffa053d9b9>] ? ocfs2_inode_unlock+0xb9/0x130 [ocfs2] Jun 20 20:42:01 H3CRDS11-RD kernel: [17509.034998] [<ffffffff811176cd>] generic_file_buffered_write+0x5d/0x90 Jun 20 20:42:01 H3CRDS11-RD kernel: [17509.035023] [<ffffffffa054c601>] ocfs2_file_aio_write+0x821/0x870 [ocfs2] Jun 20 20:42:01 H3CRDS11-RD kernel: [17509....
2012 Jun 21
1
echo 0 > /proc/sys/kernel/hung_task_timeout_secs and others error, Part II
...:42:01 H3CRDS11-RD kernel: [17509.034959] [<ffffffffa052bf26>] ocfs2_write_begin+0xf6/0x210 [ocfs2] Jun 20 20:42:01 H3CRDS11-RD kernel: [17509.034968] [<ffffffff8111752a>] generic_perform_write+0xca/0x210 Jun 20 20:42:01 H3CRDS11-RD kernel: [17509.034991] [<ffffffffa053d9b9>] ? ocfs2_inode_unlock+0xb9/0x130 [ocfs2] Jun 20 20:42:01 H3CRDS11-RD kernel: [17509.034998] [<ffffffff811176cd>] generic_file_buffered_write+0x5d/0x90 Jun 20 20:42:01 H3CRDS11-RD kernel: [17509.035023] [<ffffffffa054c601>] ocfs2_file_aio_write+0x821/0x870 [ocfs2] Jun 20 20:42:01 H3CRDS11-RD kernel: [17509....
2023 May 28
1
[PATCH 1/2] ocfs2: correct return value of ocfs2_local_free_info()
...drop_lockres(OCFS2_SB(sb), &oinfo->dqi_gqlock); @@ -853,17 +853,14 @@ static int ocfs2_local_free_info(struct super_block *sb, int type) oinfo->dqi_libh, olq_update_info, info); - if (status < 0) { + if (status < 0) mlog_errno(status); - goto out; - } - out: ocfs2_inode_unlock(sb_dqopt(sb)->files[type], 1); brelse(oinfo->dqi_libh); brelse(oinfo->dqi_lqi_bh); kfree(oinfo); - return 0; + return status; } static void olq_set_dquot(struct buffer_head *bh, void *private) -- 2.24.4
2013 Jun 27
0
[PATCH V3] ocfs2: llseek requires to ocfs2 inode lock for the file in SEEK_END
...case SEEK_END: - offset += inode->i_size; + /* SEEK_END requires the OCFS2 inode lock for the file + * because it references the file's size. + */ + ret = ocfs2_inode_lock(inode, NULL, 0); + if (ret < 0) { + mlog_errno(ret); + goto out; + } + offset += i_size_read(inode); + ocfs2_inode_unlock(inode, 0); break; case SEEK_CUR: if (offset == 0) { -- 1.7.9.7
2009 Feb 20
3
[PATCH 1/1] OCFS2: anti stale inode for nfs (V4)
...*in if (status != -ENOENT) mlog_errno(status); ocfs2_cleanup_delete_inode(inode, 0); - goto bail_unblock; + goto bail_unlock_nfs_sync; } /* Query the cluster. This will be the final decision made @@ -1005,6 +1023,10 @@ void ocfs2_delete_inode(struct inode *in bail_unlock_inode: ocfs2_inode_unlock(inode, 1); brelse(di_bh); + +bail_unlock_nfs_sync: + ocfs2_nfs_sync_unlock(OCFS2_SB(inode->i_sb), 0); + bail_unblock: status = sigprocmask(SIG_SETMASK, &oldset, NULL); if (status < 0) Index: inode.h =================================================================== --- inode.h (re...
2023 May 19
0
[PATCH v20 19/32] ocfs2: Provide a splice-read stub
...e inode fields like i_size. + * This allows the checks down below generic_file_splice_read() a + * chance of actually working. + */ + ret = ocfs2_inode_lock_atime(inode, in->f_path.mnt, &lock_level, true); + if (ret < 0) { + if (ret != -EAGAIN) + mlog_errno(ret); + goto bail; + } + ocfs2_inode_unlock(inode, lock_level); + + ret = filemap_splice_read(in, ppos, pipe, len, flags); + trace_filemap_splice_read_ret(ret); +bail: + return ret; +} + /* Refer generic_file_llseek_unlocked() */ static loff_t ocfs2_file_llseek(struct file *file, loff_t offset, int whence) { @@ -2744,7 +2784,7 @@ const st...
2009 Mar 03
3
[PATCH 1/1] OCFS2: anti stale inode for nfs (V6)
...on alloc inode on slot %u failed %d\n", + (u32)suballoc_slot, status); + goto bail; + } + + status = ocfs2_test_suballoc_bit(osb, inode_alloc_inode, alloc_bh, + blkno, suballoc_bit, res); + if (status < 0) + mlog(ML_ERROR, "test suballoc bit failed %d\n", status); + + ocfs2_inode_unlock(inode_alloc_inode, 0); + mutex_unlock(&inode_alloc_inode->i_mutex); + + iput(inode_alloc_inode); + brelse(alloc_bh); +bail: + mlog_exit(status); + return status; +} Index: dlmglue.c =================================================================== --- dlmglue.c (revision 139) +++ dlmglue.c...
2009 Mar 05
0
[PATCH 1/1] OCFS2: anti stale inode for nfs (V6.2)
...if (status != -ENOENT) mlog_errno(status); ocfs2_cleanup_delete_inode(inode, 0); - goto bail_unblock; + goto bail_unlock_nfs_sync; } /* Query the cluster. This will be the final decision made @@ -1005,6 +1023,10 @@ void ocfs2_delete_inode(struct inode *inode) bail_unlock_inode: ocfs2_inode_unlock(inode, 1); brelse(di_bh); + +bail_unlock_nfs_sync: + ocfs2_nfs_sync_unlock(OCFS2_SB(inode->i_sb), 0); + bail_unblock: status = sigprocmask(SIG_SETMASK, &oldset, NULL); if (status < 0) diff --git a/fs/ocfs2/inode.h b/fs/ocfs2/inode.h index eb3c302..1c543f0 100644 --- a/fs/ocfs2/inod...