linux/fs/btrfs
Tomohiro Misono 23d0b79dfa btrfs: Add unprivileged version of ino_lookup ioctl
Add unprivileged version of ino_lookup ioctl BTRFS_IOC_INO_LOOKUP_USER
to allow normal users to call "btrfs subvolume list/show" etc. in
combination with BTRFS_IOC_GET_SUBVOL_INFO/BTRFS_IOC_GET_SUBVOL_ROOTREF.

This can be used like BTRFS_IOC_INO_LOOKUP but the argument is
different. This is  because it always searches the fs/file tree
correspoinding to the fd with which this ioctl is called and also
returns the name of bottom subvolume.

The main differences from original ino_lookup ioctl are:

  1. Read + Exec permission will be checked using inode_permission()
     during path construction. -EACCES will be returned in case
     of failure.
  2. Path construction will be stopped at the inode number which
     corresponds to the fd with which this ioctl is called. If
     constructed path does not exist under fd's inode, -EACCES
     will be returned.
  3. The name of bottom subvolume is also searched and filled.

Note that the maximum length of path is shorter 256 (BTRFS_VOL_NAME_MAX+1)
bytes than ino_lookup ioctl because of space of subvolume's name.

Reviewed-by: Gu Jinxiang <gujx@cn.fujitsu.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Tested-by: Gu Jinxiang <gujx@cn.fujitsu.com>
Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
[ style fixes ]
Signed-off-by: David Sterba <dsterba@suse.com>
2018-05-31 11:35:24 +02:00
..
tests btrfs: tests: drop newline from test_msg strings 2018-05-29 18:12:52 +02:00
acl.c
async-thread.c
async-thread.h
backref.c
backref.h
btrfs_inode.h Btrfs: renumber BTRFS_INODE_ runtime flags and switch to enums 2018-05-28 18:23:59 +02:00
check-integrity.c
check-integrity.h
compression.c btrfs: replace waitqueue_actvie with cond_wake_up 2018-05-28 18:23:09 +02:00
compression.h btrfs: compression: Add linux/sizes.h for compression.h 2018-05-29 18:13:00 +02:00
ctree.c Btrfs: remove unused check of skip_locking 2018-05-30 16:46:52 +02:00
ctree.h btrfs: drop unused parameter qgroup_reserved 2018-05-30 16:46:53 +02:00
dedupe.h
delayed-inode.c btrfs: replace waitqueue_actvie with cond_wake_up 2018-05-28 18:23:09 +02:00
delayed-inode.h
delayed-ref.c
delayed-ref.h
dev-replace.c btrfs: drop uuid_mutex in btrfs_dev_replace_finishing 2018-05-28 18:23:16 +02:00
dev-replace.h
dir-item.c
disk-io.c Btrfs: add parent_transid parameter to veirfy_level_key 2018-05-30 16:46:43 +02:00
disk-io.h
export.c
export.h
extent_io.c
extent_io.h
extent_map.c
extent_map.h
extent-tree.c btrfs: return ENOMEM if path allocation fails in btrfs_cross_ref_exist 2018-05-30 17:33:58 +02:00
file-item.c
file.c
free-space-cache.c Btrfs: stop creating orphan items for truncate 2018-05-28 18:23:46 +02:00
free-space-cache.h
free-space-tree.c btrfs: Remove fs_info argument from populate_free_space_tree 2018-05-28 18:07:36 +02:00
free-space-tree.h btrfs: Remove fs_info argument from add_to_free_space_tree 2018-05-28 18:07:36 +02:00
inode-item.c
inode-map.c
inode-map.h
inode.c Btrfs: clean up error handling in btrfs_truncate() 2018-05-30 21:27:32 +02:00
ioctl.c btrfs: Add unprivileged version of ino_lookup ioctl 2018-05-31 11:35:24 +02:00
Kconfig
locking.c btrfs: replace waitqueue_actvie with cond_wake_up 2018-05-28 18:23:09 +02:00
locking.h
lzo.c btrfs: lzo: Harden inline lzo compressed extent decompression 2018-05-30 16:46:43 +02:00
Makefile
math.h
ordered-data.c btrfs: replace waitqueue_actvie with cond_wake_up 2018-05-28 18:23:09 +02:00
ordered-data.h
orphan.c
print-tree.c
print-tree.h
props.c
props.h
qgroup.c btrfs: qgroup: show more meaningful qgroup_rescan_init error message 2018-05-30 16:46:43 +02:00
qgroup.h
raid56.c btrfs: raid56: Remove VLA usage 2018-05-30 17:15:43 +02:00
raid56.h
rcu-string.h
reada.c
ref-verify.c
ref-verify.h
relocation.c btrfs: fix describe_relocation when printing unknown flags 2018-05-28 18:24:11 +02:00
root-tree.c
scrub.c
send.c
send.h
struct-funcs.c
super.c Btrfs: allow empty subvol= again 2018-05-28 18:24:13 +02:00
sysfs.c btrfs: sysfs: Add entry which shows if rmdir can work on subvolumes 2018-05-28 18:23:41 +02:00
sysfs.h btrfs: sysfs: Use enum/define value for feature array definitions 2018-05-28 18:23:39 +02:00
transaction.c btrfs: Remove fs_info argument from btrfs_uuid_tree_add 2018-05-30 16:46:52 +02:00
transaction.h btrfs: drop useless member qgroup_reserved of btrfs_pending_snapshot 2018-05-30 16:46:54 +02:00
tree-checker.c
tree-checker.h
tree-defrag.c
tree-log.c btrfs: replace waitqueue_actvie with cond_wake_up 2018-05-28 18:23:09 +02:00
tree-log.h
ulist.c
ulist.h
uuid-tree.c btrfs: Remove fs_info argument from btrfs_uuid_tree_rem 2018-05-30 16:46:53 +02:00
volumes.c btrfs: Remove fs_info argument from btrfs_uuid_tree_add 2018-05-30 16:46:52 +02:00
volumes.h
xattr.c
xattr.h
zlib.c
zstd.c