remarkable-linux/fs/btrfs
Guangyu Sun 72de6b5393 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>
2014-03-20 17:15:27 -07:00
..
tests Btrfs: convert printk to btrfs_ and fix BTRFS prefix 2014-01-28 13:20:05 -08:00
acl.c btrfs: remove dead code 2014-01-28 13:19:50 -08:00
async-thread.c Btrfs: add missing kfree in btrfs_destroy_workqueue 2014-03-20 17:15:27 -07:00
async-thread.h btrfs: Cleanup the btrfs_workqueue related function type 2014-03-10 15:17:20 -04:00
backref.c Btrfs: skip locking when searching commit root 2014-03-10 15:16:55 -04:00
backref.h
btrfs_inode.h Btrfs: use signed integer instead of unsigned long integer for log transid 2014-03-10 15:16:42 -04:00
check-integrity.c Btrfs: use btrfs_crc32c everywhere instead of libcrc32c 2014-02-03 09:01:27 -08:00
check-integrity.h block: submit_bio_wait() conversions 2013-11-24 16:33:41 -07:00
compression.c Btrfs: fix data corruption when reading/updating compressed extents 2014-02-08 17:57:15 -08:00
compression.h
ctree.c Btrfs: correctly determine if blocks are shared in btrfs_compare_trees 2014-03-10 15:16:50 -04:00
ctree.h Btrfs: fix possible empty list access when flushing the delalloc inodes 2014-03-10 15:17:29 -04:00
delayed-inode.c btrfs: Cleanup the "_struct" suffix in btrfs_workequeue 2014-03-10 15:17:16 -04:00
delayed-inode.h Btrfs: introduce the delayed inode ref deletion for the single link inode 2014-01-28 13:20:09 -08:00
delayed-ref.c Btrfs: cleanup delayed-ref.c:find_ref_head() 2014-03-10 15:16:46 -04:00
delayed-ref.h Btrfs: attach delayed ref updates to delayed ref heads 2014-01-28 13:20:25 -08:00
dev-replace.c Btrfs: don't flush all delalloc inodes when we doesn't get s_umount lock 2014-03-10 15:17:27 -04:00
dev-replace.h
dir-item.c Btrfs: convert printk to btrfs_ and fix BTRFS prefix 2014-01-28 13:20:05 -08:00
disk-io.c Btrfs: fix possible empty list access when flushing the delalloc inodes 2014-03-10 15:17:29 -04:00
disk-io.h
export.c
export.h
extent-tree.c Btrfs: don't flush all delalloc inodes when we doesn't get s_umount lock 2014-03-10 15:17:27 -04:00
extent_io.c Btrfs: more efficient split extent state insertion 2014-03-10 15:16:57 -04:00
extent_io.h Btrfs: move the extent buffer radix tree into the fs_info 2014-01-28 13:19:55 -08:00
extent_map.c Btrfs: more efficient btrfs_drop_extent_cache 2014-03-10 15:16:57 -04:00
extent_map.h Btrfs: more efficient btrfs_drop_extent_cache 2014-03-10 15:16:57 -04:00
file-item.c Btrfs: convert printk to btrfs_ and fix BTRFS prefix 2014-01-28 13:20:05 -08:00
file.c Btrfs: remove the unnecessary flush when preparing the pages 2014-03-10 15:17:25 -04:00
free-space-cache.c Btrfs: convert printk to btrfs_ and fix BTRFS prefix 2014-01-28 13:20:05 -08:00
free-space-cache.h
hash.c Btrfs: fix btrfs boot when compiled as built-in 2014-01-28 13:20:31 -08:00
hash.h Btrfs: fix btrfs boot when compiled as built-in 2014-01-28 13:20:31 -08:00
inode-item.c btrfs: cleanup: removed unused 'btrfs_get_inode_ref_index' 2014-01-28 13:19:39 -08:00
inode-map.c
inode-map.h
inode.c Btrfs: fix possible empty list access when flushing the delalloc inodes 2014-03-10 15:17:29 -04:00
ioctl.c Btrfs: return EPERM when deleting a default subvolume 2014-03-20 17:15:27 -07:00
Kconfig Btrfs: fix btrfs boot when compiled as built-in 2014-01-28 13:20:31 -08:00
locking.c
locking.h
lzo.c Btrfs: convert printk to btrfs_ and fix BTRFS prefix 2014-01-28 13:20:05 -08:00
Makefile Btrfs: fix btrfs boot when compiled as built-in 2014-01-28 13:20:31 -08:00
math.h
ordered-data.c Btrfs: split the global ordered extents mutex 2014-03-10 15:17:28 -04:00
ordered-data.h btrfs: Cleanup the "_struct" suffix in btrfs_workequeue 2014-03-10 15:17:16 -04:00
orphan.c btrfs: expand btrfs_find_item() to include find_orphan_item functionality 2014-01-28 13:19:37 -08:00
print-tree.c Btrfs: don't use ram_bytes for uncompressed inline items 2014-01-29 07:06:29 -08:00
print-tree.h
props.c Btrfs: add support for inode properties 2014-01-28 13:20:24 -08:00
props.h Btrfs: add support for inode properties 2014-01-28 13:20:24 -08:00
qgroup.c btrfs: Cleanup the "_struct" suffix in btrfs_workequeue 2014-03-10 15:17:16 -04:00
raid56.c btrfs: Cleanup the "_struct" suffix in btrfs_workequeue 2014-03-10 15:17:16 -04:00
raid56.h
rcu-string.h
reada.c btrfs: Cleanup the "_struct" suffix in btrfs_workequeue 2014-03-10 15:17:16 -04:00
relocation.c Btrfs: don't flush all delalloc inodes when we doesn't get s_umount lock 2014-03-10 15:17:27 -04:00
root-tree.c btrfs: Use PTR_ERR_OR_ZERO 2014-03-10 15:16:51 -04:00
scrub.c btrfs: Cleanup the "_struct" suffix in btrfs_workequeue 2014-03-10 15:17:16 -04:00
send.c Btrfs: add readahead for send_write 2014-03-10 15:17:19 -04:00
send.h
struct-funcs.c
super.c btrfs: Cleanup the old btrfs_worker. 2014-03-10 15:17:15 -04:00
sysfs.c btrfs: add simple debugfs interface 2014-03-10 15:15:51 -04:00
sysfs.h btrfs: add simple debugfs interface 2014-03-10 15:15:51 -04:00
transaction.c Btrfs: fix deadlock with nested trans handles 2014-03-20 17:15:27 -07:00
transaction.h Btrfs: make fsync latency less sucky 2014-01-28 13:20:25 -08:00
tree-defrag.c
tree-log.c Btrfs: stop joining the log transaction if sync log fails 2014-03-10 15:16:44 -04:00
tree-log.h Btrfs: just wait or commit our own log sub-transaction 2014-03-10 15:16:43 -04:00
ulist.c Btrfs: do not export ulist functions 2014-01-29 07:06:27 -08:00
ulist.h Btrfs: do not export ulist functions 2014-01-29 07:06:27 -08:00
uuid-tree.c Btrfs: convert printk to btrfs_ and fix BTRFS prefix 2014-01-28 13:20:05 -08:00
volumes.c btrfs: Cleanup the "_struct" suffix in btrfs_workequeue 2014-03-10 15:17:16 -04:00
volumes.h btrfs: Cleanup the "_struct" suffix in btrfs_workequeue 2014-03-10 15:17:16 -04:00
xattr.c Btrfs: add support for inode properties 2014-01-28 13:20:24 -08:00
xattr.h
zlib.c Btrfs: convert printk to btrfs_ and fix BTRFS prefix 2014-01-28 13:20:05 -08:00