summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
authorTomohiro Misono <misono.tomohiro@jp.fujitsu.com>2018-05-21 10:09:44 +0900
committerDavid Sterba <dsterba@suse.com>2018-05-31 11:35:24 +0200
commit23d0b79dfaed2305b500b0215b0421701ada6b1a (patch)
treeeeb57dfec279e2d7c737e354d6929145745ae5e5 /fs/btrfs/extent_io.c
parent42e4b520c812daaf5e6177c2e4beec012ce1e2ce (diff)
downloadlinux-stable-23d0b79dfaed2305b500b0215b0421701ada6b1a.tar.gz
linux-stable-23d0b79dfaed2305b500b0215b0421701ada6b1a.tar.bz2
linux-stable-23d0b79dfaed2305b500b0215b0421701ada6b1a.zip
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>
Diffstat (limited to 'fs/btrfs/extent_io.c')
0 files changed, 0 insertions, 0 deletions