[Devel] [PATCH 1/2] fs/fuse kio: backport immediate-write attribute handle

Alexey Kuznetsov kuznet at virtuozzo.com
Mon Dec 24 19:13:14 MSK 2018


Ack.

Please, look at fuse ioctls. We have to intercept and implement in
kernel those of them,
which deal with CSes. I.e. PCS_IOC_NOCSUMONREAD and PCS_IOC_NOWRITEDELAY.

And also we must prohibit PCS_IOC_INIT_KDIRECT .. PCS_IOC_GETMAP passed
by user. Now user can screw up kio_pcs using these ioctls.

On Mon, Dec 24, 2018 at 6:58 PM Pavel Butsykin <pbutsykin at virtuozzo.com> wrote:
>
> This patch provides support PCS_FATTR_IMMEDIATE_WRITE attribute for KIO module.
>
> #VSTOR-19324
>
> Signed-off-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
> ---
>  fs/fuse/kio/pcs/pcs_cs.c         | 3 ++-
>  fs/fuse/kio/pcs/pcs_prot_types.h | 3 +++
>  2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/fs/fuse/kio/pcs/pcs_cs.c b/fs/fuse/kio/pcs/pcs_cs.c
> index 00cd1ae99850..1a2e64270b9e 100644
> --- a/fs/fuse/kio/pcs/pcs_cs.c
> +++ b/fs/fuse/kio/pcs/pcs_cs.c
> @@ -515,7 +515,8 @@ void pcs_cs_submit(struct pcs_cs *cs, struct pcs_int_request *ireq)
>                 ioh->hdr.type = PCS_CS_READ_REQ;
>                 break;
>         case PCS_REQ_T_WRITE:
> -               ioh->hdr.type = PCS_CS_WRITE_REQ;
> +               ioh->hdr.type = (ireq->dentry->fileinfo.attr.attrib & PCS_FATTR_IMMEDIATE_WRITE) ?
> +                               PCS_CS_WRITE_SYNC_REQ : PCS_CS_WRITE_REQ;
>                 ioh->hdr.len += ireq->iochunk.size;
>                 break;
>         case PCS_REQ_T_WRITE_HOLE:
> diff --git a/fs/fuse/kio/pcs/pcs_prot_types.h b/fs/fuse/kio/pcs/pcs_prot_types.h
> index 9db4516824aa..bba1f1dc76e3 100644
> --- a/fs/fuse/kio/pcs/pcs_prot_types.h
> +++ b/fs/fuse/kio/pcs/pcs_prot_types.h
> @@ -417,6 +417,9 @@ enum
>         /* Don't cache content on the client */
>         PCS_FATTR_NO_CLNT_CACHE = 0x10000000,
>
> +       /* Disable delayed writes for files in the directory */
> +       PCS_FATTR_IMMEDIATE_WRITE = 0x40000000,
> +
>         /* The following attributes are being inherited from the parent directory */
>         PCS_FATTR_INHERITABLE_MASK = 0xff000000,
>  };
> --
> 2.15.1
>



More information about the Devel mailing list