virtiofs: Fail dax mount if device does not support it
authorVivek Goyal <vgoyal@redhat.com>
Tue, 9 Feb 2021 22:47:54 +0000 (17:47 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Apr 2021 13:00:03 +0000 (15:00 +0200)
commit1bfb046d29e364efb56fdbbf4a9dcd7dec1d4019
tree03192970b93dcc930589637db8f648e3f67aa979
parente21d2b92354b3cd25dd774ebb0f0e52ff04a7861
virtiofs: Fail dax mount if device does not support it

[ Upstream commit 3f9b9efd82a84f27e95d0414f852caf1fa839e83 ]

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>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/fuse/virtio_fs.c