From: Sage Weil Date: Fri, 29 Oct 2010 19:37:33 +0000 (-0400) Subject: Btrfs: fix lockdep warning on clone ioctl X-Git-Tag: upstream/snapshot3+hdmi~11282^2~104 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fccdae435c1b295cca546f23f6f43126a28ffac3;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git Btrfs: fix lockdep warning on clone ioctl I'm no lockdep expert, but this appears to make the lockdep warning go away for the i_mutex locking in the clone ioctl. Signed-off-by: Sage Weil Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 3fe15e4..93d69b3 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1492,11 +1492,11 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, path->reada = 2; if (inode < src) { - mutex_lock(&inode->i_mutex); - mutex_lock(&src->i_mutex); + mutex_lock_nested(&inode->i_mutex, I_MUTEX_PARENT); + mutex_lock_nested(&src->i_mutex, I_MUTEX_CHILD); } else { - mutex_lock(&src->i_mutex); - mutex_lock(&inode->i_mutex); + mutex_lock_nested(&src->i_mutex, I_MUTEX_PARENT); + mutex_lock_nested(&inode->i_mutex, I_MUTEX_CHILD); } /* determine range to clone */