search for: i_mutex

Displaying 20 results from an estimated 83 matches for "i_mutex".

2012 Jan 30
3
[PATCH] Btrfs: allow cloning ranges within the same file
...-EINVAL; - if (src == inode) - goto out_fput; /* the src must be open for reading */ if (!(src_file->f_mode & FMODE_READ)) @@ -2282,9 +2278,11 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, if (inode < src) { mutex_lock_nested(&inode->i_mutex, I_MUTEX_PARENT); mutex_lock_nested(&src->i_mutex, I_MUTEX_CHILD); - } else { + } else if (inode > src) { mutex_lock_nested(&src->i_mutex, I_MUTEX_PARENT); mutex_lock_nested(&inode->i_mutex, I_MUTEX_CHILD); + } else { + mutex_lock(&inode->i_mutex); } /...
2009 Jul 06
2
[Patch] btrfs: use file_remove_suid() after i_mutex is held
file_remove_suid() should be called with i_mutex held, file_update_time() too. So move them after mutex_lock(). Plus, check the return value of kmalloc(). Signed-off-by: WANG Cong <amwang@redhat.com> --- diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 7c3cd24..cd36301 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -944,14 +94...
2009 Feb 26
1
[PATCH 0/7] OCFS2 locking fixes and lockdep annotations
Hi, the first four patches in this series fix locking problems in OCFS2 quota code (three of them can lead to potential deadlocks). The fifth patch reorders ip_alloc_sem for directories to be acquired before localalloc locks. Mark would you please merge these? The last two patches implement lockdep annotations for OCFS2 cluster locks. We annotate all the cluster locks except for special ones
2009 Jul 06
1
[Patch v3] btrfs: use file_remove_suid() after i_mutex is held
V2 -> V3: set ''err'' to -ENOMEM when kmalloc() fails. Thanks to Tao. V1 -> V2: Move kmalloc() before mutex_lock(), suggested by Arjan. file_remove_suid() should be called with i_mutex held, file_update_time() too. So move them after mutex_lock(). Plus, check the return value of kmalloc(). Signed-off-by: WANG Cong <amwang@redhat.com> Cc: Arjan <arjan@infradead.org> Cc: Chris Mason <chris.mason@oracle.com> Cc: Yan Zheng <zheng.yan@oracle.com> Cc: Sven Weg...
2009 Jul 06
2
[Patch v2] btrfs: use file_remove_suid() after i_mutex is held
V1 -> V2: Move kmalloc() before mutex_lock(), suggested by Arjan. file_remove_suid() should be called with i_mutex held, file_update_time() too. So move them after mutex_lock(). Plus, check the return value of kmalloc(). Signed-off-by: WANG Cong <amwang@redhat.com> Cc: Arjan <arjan@infradead.org> Cc: Chris Mason <chris.mason@oracle.com> Cc: Yan Zheng <zheng.yan@oracle.com> Cc: Sven Weg...
2010 Mar 22
0
[PATCH] Btrfs: change direct I/O read to not use i_mutex.
...locksize = BTRFS_I(diocb->inode)->root->sectorsize; /* expand lock region to include what we read to validate checksum */ @@ -450,42 +517,25 @@ static void btrfs_dio_read(struct btrfs_diocb *diocb) lockend = ALIGN(end, blocksize) - 1; getlock: - mutex_lock(&diocb->inode->i_mutex); + /* writeout everything we read for checksum or compressed extents */ + filemap_write_and_wait_range(diocb->inode->i_mapping, + diocb->lockstart, lockend); + lock_extent(io_tree, diocb->lockstart, lockend, GFP_NOFS); - /* ensure writeout and btree update on everything - * we mi...
2009 Apr 08
0
[patch] unlock i_mutex in error path
There is an error path in ocfs2_quota_write() that doesn't unlock &gqinode->i_mutex(). That seems unintentional. Found by smatch (http://repo.or.cz/w/smatch.git). Compile tested. regards, dan carpenter Signed-off-by: Dan Carpenter <error27 at gmail.com> --- orig/fs/ocfs2/quota_global.c 2009-04-07 19:34:22.000000000 +0300 +++ devel/fs/ocfs2/quota_global.c 2009-04-07 19:...
2011 Jun 24
10
[PATCH 0/9] remove i_alloc_sem V2
i_alloc_sem has always been a bit of an odd "lock". It''s the only remaining rw_semaphore that can be released by a different thread than the one that locked it, and it''s use case in the core direct I/O code is more like a counter given that the writers already have external serialization. This series removes it in favour of a simpler counter scheme, thus getting rid
2013 Jun 20
2
[PATCH] ocfs2: llseek requires to ocfs2 inode lock for the file in SEEK_END
llseek requires ocfs2 inode lock for updating the file size in SEEK_END. because the file size maybe update on another node. if it not . after call llseek in SEEK_END. the position is old. this bug can be reproduce the following scenario: at first ,we dd a test fileA,the file size is 10k. on NodeA: --------- 1) open the test fileA, lseek the end of file. and print the position. 2) close the test
2008 May 15
3
[PATCH 1/4] ocfs2: Fixes pipe_buf_operations->pin switch to confirm in 2.6.23.
Signed-off-by: Tiger Yang <tiger.yang at oracle.com> --- Config.make.in | 1 + configure.in | 6 ++++++ fs/ocfs2/Makefile | 4 ++++ kapi-compat/include/pipe_buf_operations.h | 10 ++++++++++ 4 files changed, 21 insertions(+), 0 deletions(-) create mode 100644 kapi-compat/include/pipe_buf_operations.h
2009 Jun 04
2
[PATCH 0/2] OCFS2 lockdep support
Hi, here comes the next version of OCFS2 lockdep support. I've dropped patches with fixes from the series since they were already merged. As Joel suggested, I've simplified the main patch a bit so that we don't have ifdefs around lock declarations and there are also a few other minor improvements. Honza
2009 Nov 03
2
[PATCH]] Btrfs: fix destroy snapshot to get the right parent dentry
...struct dentry *parent = file->f_path.dentry->d_parent; struct dentry *dentry; struct inode *dir = parent->d_inode; struct inode *inode; @@ -793,9 +793,6 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file, dest = BTRFS_I(inode)->root; mutex_lock(&inode->i_mutex); - err = d_invalidate(dentry); - if (err) - goto out_unlock; down_write(&root->fs_info->subvol_sem); @@ -827,7 +824,7 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file, inode->i_flags |= S_DEAD; out_up_write: up_write(&root->fs_info->subvol_sem);...
2008 Aug 19
0
[PATCH] Reinstate '-osubvol=.' option to mount entire tree
...19 insertions(+), 15 deletions(-) diff --git a/super.c b/super.c index 55f4d00..f7b3eac 100644 --- a/super.c +++ b/super.c @@ -451,21 +451,25 @@ static int btrfs_get_sb(struct file_system_type *fs_type, int flags, s->s_flags |= MS_ACTIVE; } - mutex_lock(&s->s_root->d_inode->i_mutex); - root = lookup_one_len(subvol_name, s->s_root, strlen(subvol_name)); - mutex_unlock(&s->s_root->d_inode->i_mutex); - if (IS_ERR(root)) { - up_write(&s->s_umount); - deactivate_super(s); - error = PTR_ERR(root); - goto error; - } - if (!root->d_inode) { - dput(root)...
2013 Jun 10
1
[PATCH v2] ocfs2: fix mutex_unlock and possible memory leak in ocfs2_remove_btree_range
...&extra_blocks); if (ret < 0) { mlog_errno(ret); - goto out; + goto bail; } } @@ -5674,7 +5674,7 @@ int ocfs2_remove_btree_range(struct inode *inode, extra_blocks); if (ret) { mlog_errno(ret); - return ret; + goto bail; } mutex_lock(&tl_inode->i_mutex); @@ -5734,7 +5734,7 @@ out_commit: ocfs2_commit_trans(osb, handle); out: mutex_unlock(&tl_inode->i_mutex); - +bail: if (meta_ac) ocfs2_free_alloc_context(meta_ac); -- 1.7.9.7
2013 Jan 31
4
[RFC][PATCH 2/2] Btrfs: implement unlocked dio write
...ADDIO_NEED_LOCK, - &BTRFS_I(inode)->runtime_flags))) { - inode_dio_done(inode); - flags = DIO_LOCKING | DIO_SKIP_HOLES; - } else { - wakeup = true; - } + atomic_inc(&inode->i_dio_count); + smp_mb__after_atomic_inc(); + if (rw == WRITE) { + mutex_unlock(&inode->i_mutex); + } else if (unlikely(test_bit(BTRFS_INODE_READDIO_NEED_LOCK, + &BTRFS_I(inode)->runtime_flags))) { + inode_dio_done(inode); + flags = DIO_LOCKING | DIO_SKIP_HOLES; + wakeup = false; } ret = __blockdev_direct_IO(rw, iocb, inode, BTRFS_I(inode)->root->fs_info->...
2010 Jul 26
6
[PATCH] Btrfs: compressed file size ioctl
...btrfs_key key; + u32 nritems; + int slot; + u64 olen = inode->i_size; + u64 len = olen; + long ret; + u64 compressed_size = 0; + + if (S_ISDIR(inode->i_mode)) + return -EISDIR; + + path = btrfs_alloc_path(); + if (!path) + return -ENOMEM; + + path->reada = 2; + mutex_lock(&inode->i_mutex); + + /* do any pending delalloc/csum calc on inode, one way or + another, and lock file content */ + btrfs_wait_ordered_range(inode, 0, (u64)-1); + + /* search for the inode */ + key.objectid = inode->i_ino; + key.type = BTRFS_EXTENT_DATA_KEY; + key.offset = 0; + + while (1) { + /* note the...
2009 Jun 02
10
[PATCH 0/7] [RESEND] Fix some deadlocks in quota code and implement lockdep for cluster locks
Hi, I'm resending this patch series. It's rediffed against linux-next branch of Joel's git tree. The first four patches are obvious fixes of deadlocks in quota code and should go in as soon as possible. The other three patches implement lockdep support for OCFS2 cluster locks. So you can have a look whether the code make sence to you and possibly merge them. They should be NOP when
2008 Jul 14
18
[git patches] Ocfs2 and Configfs updates for 2.6.27
I'm running a bit late with the e-mail this time around, but I think that's ok since there really isn't any major new features here - the bulk of the Ocfs2 update is bug fixes, or cleanups. The same goes for configfs. The only two things that could be described as features would be: - Sunil has updated Ocfs2 to provide even more live cluster locking information via debugfs. - Joel
2013 Aug 06
6
[PATCH 0/4] btrfs: out-of-band (aka offline) dedupe v4
Hi, The following series of patches implements in btrfs an ioctl to do out-of-band deduplication of file extents. To be clear, this means that the file system is mounted and running, but the dedupe is not done during file writes, but after the fact when some userspace software initiates a dedupe. The primary patch is loosely based off of one sent by Josef Bacik back in January, 2011.
2009 Jul 10
2
[PATCH 1/1] a fix of logging return value.
...n.gang.wang at oracle.com> --- fs/ocfs2/file.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 62442e4..a49fa44 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -1918,8 +1918,10 @@ out_sems: mutex_unlock(&inode->i_mutex); + if (written) + ret = written; mlog_exit(ret); - return written ? written : ret; + return ret; } static int ocfs2_splice_to_file(struct pipe_inode_info *pipe, -- 1.6.2.5