]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: return EPERM when deleting a default subvolume
authorGuangyu Sun <guangyu.sun@oracle.com>
Tue, 11 Mar 2014 18:24:18 +0000 (11:24 -0700)
committerChris Mason <clm@fb.com>
Fri, 21 Mar 2014 00:15:27 +0000 (17:15 -0700)
commit5a29757c424ce8367d35f38191de11fcd5dc90a6
tree52c6f4e916b03033ff2cf2d0420ba616fb355eaa
parentc3ff54f296f2587c268b6d21f161c37b70211561
Btrfs: return EPERM when deleting a default subvolume

The error message is confusing:

 # btrfs sub delete /mnt/mysub/
 Delete subvolume '/mnt/mysub'
 ERROR: cannot delete '/mnt/mysub' - Directory not empty

The error message does not make sense to me: It's not about deleting a
directory but it's a subvolume, and it doesn't matter if the subvolume is
empty or not.

Maybe EPERM or is more appropriate in this case, combined with an explanatory
kernel log message. (e.g. "subvolume with ID 123 cannot be deleted because
it is configured as default subvolume.")

Reported-by: Koen De Wit <koen.de.wit@oracle.com>
Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/ioctl.c