Re: [PATCH RESEND] btrfs: unlock i_mutex after attempting to delete subvolume during send

From: Omar Sandoval
Date: Mon Apr 13 2015 - 17:33:23 EST


On Fri, Apr 10, 2015 at 02:20:40PM -0700, Omar Sandoval wrote:
> Whenever the check for a send in progress introduced in commit
> 521e0546c970 (btrfs: protect snapshots from deleting during send) is
> hit, we return without unlocking inode->i_mutex. This is easy to see
> with lockdep enabled:
>
> [ +0.000059] ================================================
> [ +0.000028] [ BUG: lock held when returning to user space! ]
> [ +0.000029] 4.0.0-rc5-00096-g3c435c1 #93 Not tainted
> [ +0.000026] ------------------------------------------------
> [ +0.000029] btrfs/211 is leaving the kernel with locks still held!
> [ +0.000029] 1 lock held by btrfs/211:
> [ +0.000023] #0: (&type->i_mutex_dir_key){+.+.+.}, at: [<ffffffff8135b8df>] btrfs_ioctl_snap_destroy+0x2df/0x7a0
>
> Make sure we unlock it in the error path.
>
> Reviewed-by: Filipe Manana <fdmanana@xxxxxxxx>
> Reviewed-by: David Sterba <dsterba@xxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Omar Sandoval <osandov@xxxxxxxxxxx>
> ---
> Just resending this with Filipe's and David's Reviewed-bys and Cc-ing
> stable.
>
> fs/btrfs/ioctl.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)

Ping.

--
Omar
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/