All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] virtiofs: Fail dax mount if device does not support it
@ 2021-02-09 22:47 ` Vivek Goyal
  0 siblings, 0 replies; 8+ messages in thread
From: Vivek Goyal @ 2021-02-09 22:47 UTC (permalink / raw)
  To: Linux fsdevel mailing list, Miklos Szeredi
  Cc: virtio-fs-list, Dr. David Alan Gilbert, Stefan Hajnoczi

Right now "mount -t virtiofs -o dax myfs /mnt/virtiofs" succeeds even
if filesystem deivce does not have a cache window and hence DAX can't
be supported.

This gives a false sense to user that they are using DAX with virtiofs
but fact of the matter is that they are not.

Fix this by returning error if dax can't be supported and user has asked
for it.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
---
 fs/fuse/virtio_fs.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Index: redhat-linux/fs/fuse/virtio_fs.c
===================================================================
--- redhat-linux.orig/fs/fuse/virtio_fs.c	2021-02-04 10:40:21.704370721 -0500
+++ redhat-linux/fs/fuse/virtio_fs.c	2021-02-09 15:56:45.693653979 -0500
@@ -1324,8 +1324,15 @@ static int virtio_fs_fill_super(struct s
 
 	/* virtiofs allocates and installs its own fuse devices */
 	ctx->fudptr = NULL;
-	if (ctx->dax)
+	if (ctx->dax) {
+		if (!fs->dax_dev) {
+			err = -EINVAL;
+			pr_err("virtio-fs: dax can't be enabled as filesystem"
+			       " device does not support it.\n");
+			goto err_free_fuse_devs;
+		}
 		ctx->dax_dev = fs->dax_dev;
+	}
 	err = fuse_fill_super_common(sb, ctx);
 	if (err < 0)
 		goto err_free_fuse_devs;


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Virtio-fs] [PATCH] virtiofs: Fail dax mount if device does not support it
@ 2021-02-09 22:47 ` Vivek Goyal
  0 siblings, 0 replies; 8+ messages in thread
From: Vivek Goyal @ 2021-02-09 22:47 UTC (permalink / raw)
  To: Linux fsdevel mailing list, Miklos Szeredi; +Cc: virtio-fs-list

Right now "mount -t virtiofs -o dax myfs /mnt/virtiofs" succeeds even
if filesystem deivce does not have a cache window and hence DAX can't
be supported.

This gives a false sense to user that they are using DAX with virtiofs
but fact of the matter is that they are not.

Fix this by returning error if dax can't be supported and user has asked
for it.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
---
 fs/fuse/virtio_fs.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Index: redhat-linux/fs/fuse/virtio_fs.c
===================================================================
--- redhat-linux.orig/fs/fuse/virtio_fs.c	2021-02-04 10:40:21.704370721 -0500
+++ redhat-linux/fs/fuse/virtio_fs.c	2021-02-09 15:56:45.693653979 -0500
@@ -1324,8 +1324,15 @@ static int virtio_fs_fill_super(struct s
 
 	/* virtiofs allocates and installs its own fuse devices */
 	ctx->fudptr = NULL;
-	if (ctx->dax)
+	if (ctx->dax) {
+		if (!fs->dax_dev) {
+			err = -EINVAL;
+			pr_err("virtio-fs: dax can't be enabled as filesystem"
+			       " device does not support it.\n");
+			goto err_free_fuse_devs;
+		}
 		ctx->dax_dev = fs->dax_dev;
+	}
 	err = fuse_fill_super_common(sb, ctx);
 	if (err < 0)
 		goto err_free_fuse_devs;


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] virtiofs: Fail dax mount if device does not support it
  2021-02-09 22:47 ` [Virtio-fs] " Vivek Goyal
@ 2021-02-10 14:58   ` Stefan Hajnoczi
  -1 siblings, 0 replies; 8+ messages in thread
From: Stefan Hajnoczi @ 2021-02-10 14:58 UTC (permalink / raw)
  To: Vivek Goyal
  Cc: Linux fsdevel mailing list, Miklos Szeredi, virtio-fs-list,
	Dr. David Alan Gilbert

[-- Attachment #1: Type: text/plain, Size: 1458 bytes --]

On Tue, Feb 09, 2021 at 05:47:54PM -0500, Vivek Goyal wrote:
> Right now "mount -t virtiofs -o dax myfs /mnt/virtiofs" succeeds even
> if filesystem deivce does not have a cache window and hence DAX can't
> be supported.
> 
> This gives a false sense to user that they are using DAX with virtiofs
> but fact of the matter is that they are not.
> 
> Fix this by returning error if dax can't be supported and user has asked
> for it.
> 
> Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
> ---
>  fs/fuse/virtio_fs.c |    9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> Index: redhat-linux/fs/fuse/virtio_fs.c
> ===================================================================
> --- redhat-linux.orig/fs/fuse/virtio_fs.c	2021-02-04 10:40:21.704370721 -0500
> +++ redhat-linux/fs/fuse/virtio_fs.c	2021-02-09 15:56:45.693653979 -0500
> @@ -1324,8 +1324,15 @@ static int virtio_fs_fill_super(struct s
>  
>  	/* virtiofs allocates and installs its own fuse devices */
>  	ctx->fudptr = NULL;
> -	if (ctx->dax)
> +	if (ctx->dax) {
> +		if (!fs->dax_dev) {
> +			err = -EINVAL;
> +			pr_err("virtio-fs: dax can't be enabled as filesystem"
> +			       " device does not support it.\n");
> +			goto err_free_fuse_devs;
> +		}
>  		ctx->dax_dev = fs->dax_dev;
> +	}
>  	err = fuse_fill_super_common(sb, ctx);
>  	if (err < 0)
>  		goto err_free_fuse_devs;

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Virtio-fs] [PATCH] virtiofs: Fail dax mount if device does not support it
@ 2021-02-10 14:58   ` Stefan Hajnoczi
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Hajnoczi @ 2021-02-10 14:58 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: Linux fsdevel mailing list, virtio-fs-list, Miklos Szeredi

[-- Attachment #1: Type: text/plain, Size: 1458 bytes --]

On Tue, Feb 09, 2021 at 05:47:54PM -0500, Vivek Goyal wrote:
> Right now "mount -t virtiofs -o dax myfs /mnt/virtiofs" succeeds even
> if filesystem deivce does not have a cache window and hence DAX can't
> be supported.
> 
> This gives a false sense to user that they are using DAX with virtiofs
> but fact of the matter is that they are not.
> 
> Fix this by returning error if dax can't be supported and user has asked
> for it.
> 
> Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
> ---
>  fs/fuse/virtio_fs.c |    9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> Index: redhat-linux/fs/fuse/virtio_fs.c
> ===================================================================
> --- redhat-linux.orig/fs/fuse/virtio_fs.c	2021-02-04 10:40:21.704370721 -0500
> +++ redhat-linux/fs/fuse/virtio_fs.c	2021-02-09 15:56:45.693653979 -0500
> @@ -1324,8 +1324,15 @@ static int virtio_fs_fill_super(struct s
>  
>  	/* virtiofs allocates and installs its own fuse devices */
>  	ctx->fudptr = NULL;
> -	if (ctx->dax)
> +	if (ctx->dax) {
> +		if (!fs->dax_dev) {
> +			err = -EINVAL;
> +			pr_err("virtio-fs: dax can't be enabled as filesystem"
> +			       " device does not support it.\n");
> +			goto err_free_fuse_devs;
> +		}
>  		ctx->dax_dev = fs->dax_dev;
> +	}
>  	err = fuse_fill_super_common(sb, ctx);
>  	if (err < 0)
>  		goto err_free_fuse_devs;

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] virtiofs: Fail dax mount if device does not support it
  2021-02-09 22:47 ` [Virtio-fs] " Vivek Goyal
@ 2021-03-05 13:34   ` Vivek Goyal
  -1 siblings, 0 replies; 8+ messages in thread
From: Vivek Goyal @ 2021-03-05 13:34 UTC (permalink / raw)
  To: Linux fsdevel mailing list, Miklos Szeredi
  Cc: virtio-fs-list, Dr. David Alan Gilbert, Stefan Hajnoczi

On Tue, Feb 09, 2021 at 05:47:54PM -0500, Vivek Goyal wrote:
> Right now "mount -t virtiofs -o dax myfs /mnt/virtiofs" succeeds even
> if filesystem deivce does not have a cache window and hence DAX can't
> be supported.
> 
> This gives a false sense to user that they are using DAX with virtiofs
> but fact of the matter is that they are not.
> 
> Fix this by returning error if dax can't be supported and user has asked
> for it.

Hi Miklos,

Did you get a chance to look at this patch.

Vivek

> 
> Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
> ---
>  fs/fuse/virtio_fs.c |    9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> Index: redhat-linux/fs/fuse/virtio_fs.c
> ===================================================================
> --- redhat-linux.orig/fs/fuse/virtio_fs.c	2021-02-04 10:40:21.704370721 -0500
> +++ redhat-linux/fs/fuse/virtio_fs.c	2021-02-09 15:56:45.693653979 -0500
> @@ -1324,8 +1324,15 @@ static int virtio_fs_fill_super(struct s
>  
>  	/* virtiofs allocates and installs its own fuse devices */
>  	ctx->fudptr = NULL;
> -	if (ctx->dax)
> +	if (ctx->dax) {
> +		if (!fs->dax_dev) {
> +			err = -EINVAL;
> +			pr_err("virtio-fs: dax can't be enabled as filesystem"
> +			       " device does not support it.\n");
> +			goto err_free_fuse_devs;
> +		}
>  		ctx->dax_dev = fs->dax_dev;
> +	}
>  	err = fuse_fill_super_common(sb, ctx);
>  	if (err < 0)
>  		goto err_free_fuse_devs;


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Virtio-fs] [PATCH] virtiofs: Fail dax mount if device does not support it
@ 2021-03-05 13:34   ` Vivek Goyal
  0 siblings, 0 replies; 8+ messages in thread
From: Vivek Goyal @ 2021-03-05 13:34 UTC (permalink / raw)
  To: Linux fsdevel mailing list, Miklos Szeredi; +Cc: virtio-fs-list

On Tue, Feb 09, 2021 at 05:47:54PM -0500, Vivek Goyal wrote:
> Right now "mount -t virtiofs -o dax myfs /mnt/virtiofs" succeeds even
> if filesystem deivce does not have a cache window and hence DAX can't
> be supported.
> 
> This gives a false sense to user that they are using DAX with virtiofs
> but fact of the matter is that they are not.
> 
> Fix this by returning error if dax can't be supported and user has asked
> for it.

Hi Miklos,

Did you get a chance to look at this patch.

Vivek

> 
> Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
> ---
>  fs/fuse/virtio_fs.c |    9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> Index: redhat-linux/fs/fuse/virtio_fs.c
> ===================================================================
> --- redhat-linux.orig/fs/fuse/virtio_fs.c	2021-02-04 10:40:21.704370721 -0500
> +++ redhat-linux/fs/fuse/virtio_fs.c	2021-02-09 15:56:45.693653979 -0500
> @@ -1324,8 +1324,15 @@ static int virtio_fs_fill_super(struct s
>  
>  	/* virtiofs allocates and installs its own fuse devices */
>  	ctx->fudptr = NULL;
> -	if (ctx->dax)
> +	if (ctx->dax) {
> +		if (!fs->dax_dev) {
> +			err = -EINVAL;
> +			pr_err("virtio-fs: dax can't be enabled as filesystem"
> +			       " device does not support it.\n");
> +			goto err_free_fuse_devs;
> +		}
>  		ctx->dax_dev = fs->dax_dev;
> +	}
>  	err = fuse_fill_super_common(sb, ctx);
>  	if (err < 0)
>  		goto err_free_fuse_devs;


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] virtiofs: Fail dax mount if device does not support it
  2021-03-05 13:34   ` [Virtio-fs] " Vivek Goyal
@ 2021-03-05 14:48     ` Miklos Szeredi
  -1 siblings, 0 replies; 8+ messages in thread
From: Miklos Szeredi @ 2021-03-05 14:48 UTC (permalink / raw)
  To: Vivek Goyal
  Cc: Linux fsdevel mailing list, virtio-fs-list,
	Dr. David Alan Gilbert, Stefan Hajnoczi

On Fri, Mar 5, 2021 at 2:34 PM Vivek Goyal <vgoyal@redhat.com> wrote:
>
> On Tue, Feb 09, 2021 at 05:47:54PM -0500, Vivek Goyal wrote:
> > Right now "mount -t virtiofs -o dax myfs /mnt/virtiofs" succeeds even
> > if filesystem deivce does not have a cache window and hence DAX can't
> > be supported.
> >
> > This gives a false sense to user that they are using DAX with virtiofs
> > but fact of the matter is that they are not.
> >
> > Fix this by returning error if dax can't be supported and user has asked
> > for it.
>
> Hi Miklos,
>
> Did you get a chance to look at this patch.

Thanks for the reminder.  Pushed out now.

Miklos

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Virtio-fs] [PATCH] virtiofs: Fail dax mount if device does not support it
@ 2021-03-05 14:48     ` Miklos Szeredi
  0 siblings, 0 replies; 8+ messages in thread
From: Miklos Szeredi @ 2021-03-05 14:48 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: Linux fsdevel mailing list, virtio-fs-list

On Fri, Mar 5, 2021 at 2:34 PM Vivek Goyal <vgoyal@redhat.com> wrote:
>
> On Tue, Feb 09, 2021 at 05:47:54PM -0500, Vivek Goyal wrote:
> > Right now "mount -t virtiofs -o dax myfs /mnt/virtiofs" succeeds even
> > if filesystem deivce does not have a cache window and hence DAX can't
> > be supported.
> >
> > This gives a false sense to user that they are using DAX with virtiofs
> > but fact of the matter is that they are not.
> >
> > Fix this by returning error if dax can't be supported and user has asked
> > for it.
>
> Hi Miklos,
>
> Did you get a chance to look at this patch.

Thanks for the reminder.  Pushed out now.

Miklos


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-03-05 14:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09 22:47 [PATCH] virtiofs: Fail dax mount if device does not support it Vivek Goyal
2021-02-09 22:47 ` [Virtio-fs] " Vivek Goyal
2021-02-10 14:58 ` Stefan Hajnoczi
2021-02-10 14:58   ` [Virtio-fs] " Stefan Hajnoczi
2021-03-05 13:34 ` Vivek Goyal
2021-03-05 13:34   ` [Virtio-fs] " Vivek Goyal
2021-03-05 14:48   ` Miklos Szeredi
2021-03-05 14:48     ` [Virtio-fs] " Miklos Szeredi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.