ACK/Cmnt: [PATCH][SRU][Disco] UBUNTU: SAUCE: shiftfs: use separate llseek method for directories
Stefan Bader
stefan.bader at canonical.com
Tue Apr 23 08:39:07 UTC 2019
On 16.04.19 18:29, Christian Brauner wrote:
> BugLink: https://bugs.launchpad.net/bugs/1824812
>
> Give shiftfs it's own proper llseek method for directories.
>
> Before this commit we used to rely on an llseek method that was targeted
> for regular files for both directories and regular files. Give
> directories their own llseek operation.
> This is required to have AppArmor function correctly with shiftfs.
>
> Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
Acked-by: Stefan Bader <stefan.bader at canonical.com>
> ---
With the improved commit message sent in another reply.
> fs/shiftfs.c | 14 +++++++++++---
> 1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/fs/shiftfs.c b/fs/shiftfs.c
> index 4c8a6ec2a617..9771165d1ce0 100644
> --- a/fs/shiftfs.c
> +++ b/fs/shiftfs.c
> @@ -1144,7 +1144,15 @@ static int shiftfs_release(struct inode *inode, struct file *file)
> return 0;
> }
>
> -static loff_t shiftfs_llseek(struct file *file, loff_t offset, int whence)
> +static loff_t shiftfs_dir_llseek(struct file *file, loff_t offset, int whence)
> +{
> + struct shiftfs_file_info *file_info = file->private_data;
> + struct file *realfile = file_info->realfile;
> +
> + return vfs_llseek(realfile, offset, whence);
> +}
> +
> +static loff_t shiftfs_file_llseek(struct file *file, loff_t offset, int whence)
> {
> struct inode *realinode = file_inode(file)->i_private;
>
> @@ -1653,7 +1661,7 @@ static int shiftfs_iterate_shared(struct file *file, struct dir_context *ctx)
> const struct file_operations shiftfs_file_operations = {
> .open = shiftfs_open,
> .release = shiftfs_release,
> - .llseek = shiftfs_llseek,
> + .llseek = shiftfs_file_llseek,
> .read_iter = shiftfs_read_iter,
> .write_iter = shiftfs_write_iter,
> .fsync = shiftfs_fsync,
> @@ -1670,7 +1678,7 @@ const struct file_operations shiftfs_dir_operations = {
> .compat_ioctl = shiftfs_compat_ioctl,
> .fsync = shiftfs_fsync,
> .iterate_shared = shiftfs_iterate_shared,
> - .llseek = shiftfs_llseek,
> + .llseek = shiftfs_dir_llseek,
> .open = shiftfs_open,
> .read = generic_read_dir,
> .release = shiftfs_release,
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20190423/a306aa84/attachment.sig>
More information about the kernel-team
mailing list