Skip to content

Commit

Permalink
Btrfs: fix lockdep warning on clone ioctl
Browse files Browse the repository at this point in the history
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 <sage@newdream.net>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Sage Weil authored and Chris Mason committed Oct 29, 2010
1 parent 050006a commit fccdae4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fs/btrfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit fccdae4

Please sign in to comment.