Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fccdae43 authored by Sage Weil's avatar Sage Weil Committed by Chris Mason
Browse files

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: default avatarSage Weil <sage@newdream.net>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 050006a7
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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 */