Re: [PATCH v2] virtiofs: use GFP_NOFS when enqueuing request through kworker

2024-01-05 Thread Vivek Goyal
On Fri, Jan 05, 2024 at 08:57:55PM +, Matthew Wilcox wrote: > On Fri, Jan 05, 2024 at 03:41:48PM -0500, Vivek Goyal wrote: > > On Fri, Jan 05, 2024 at 08:21:00PM +, Matthew Wilcox wrote: > > > On Fri, Jan 05, 2024 at 03:17:19PM -0500, Vivek Goyal wrote: > > > &

Re: [PATCH v2] virtiofs: use GFP_NOFS when enqueuing request through kworker

2024-01-05 Thread Vivek Goyal
On Fri, Jan 05, 2024 at 08:21:00PM +, Matthew Wilcox wrote: > On Fri, Jan 05, 2024 at 03:17:19PM -0500, Vivek Goyal wrote: > > On Fri, Jan 05, 2024 at 06:53:05PM +0800, Hou Tao wrote: > > > From: Hou Tao > > > > > > When invoking virtio_fs

Re: [PATCH v2] virtiofs: use GFP_NOFS when enqueuing request through kworker

2024-01-05 Thread Vivek Goyal
On Fri, Jan 05, 2024 at 06:53:05PM +0800, Hou Tao wrote: > From: Hou Tao > > When invoking virtio_fs_enqueue_req() through kworker, both the > allocation of the sg array and the bounce buffer still use GFP_ATOMIC. > Considering the size of both the sg array and the bounce buffer may be > greater

Re: [PATCH 1/2] virtiofs: Improve three size determinations

2024-01-02 Thread Vivek Goyal
On Fri, Dec 29, 2023 at 09:36:36AM +0100, Markus Elfring wrote: > From: Markus Elfring > Date: Fri, 29 Dec 2023 08:42:04 +0100 > > Replace the specification of data structures by pointer dereferences > as the parameter for the operator “sizeof” to make the corresponding size > determination a

Re: [PATCH 2/2] virtiofs: Improve error handling in virtio_fs_get_tree()

2024-01-02 Thread Vivek Goyal
On Fri, Dec 29, 2023 at 09:38:47AM +0100, Markus Elfring wrote: > From: Markus Elfring > Date: Fri, 29 Dec 2023 09:15:07 +0100 > > The kfree() function was called in two cases by > the virtio_fs_get_tree() function during error handling > even if the passed variable contained a null pointer. >

Re: [Virtio-fs] [PATCH] virtiofs: propagate sync() to file server

2021-04-20 Thread Vivek Goyal
On Mon, Apr 19, 2021 at 05:08:48PM +0200, Greg Kurz wrote: > Even if POSIX doesn't mandate it, linux users legitimately expect > sync() to flush all data and metadata to physical storage when it > is located on the same system. This isn't happening with virtiofs > though : sync() inside the guest

Re: [Virtio-fs] [PATCH v3 2/3] dax: Add a wakeup mode parameter to put_unlocked_entry()

2021-04-20 Thread Vivek Goyal
On Tue, Apr 20, 2021 at 09:34:20AM +0200, Greg Kurz wrote: > On Mon, 19 Apr 2021 17:36:35 -0400 > Vivek Goyal wrote: > > > As of now put_unlocked_entry() always wakes up next waiter. In next > > patches we want to wake up all waiters at one callsite. Hence, add a > >

[PATCH v3 0/3] dax: Fix missed wakeup in put_unlocked_entry()

2021-04-19 Thread Vivek Goyal
Hi, This is V3 of patches. Posted V2 here. https://lore.kernel.org/linux-fsdevel/20210419184516.gc1472...@redhat.com/ Changes since v2: - Broke down patch in to a patch series (Dan) - Added an enum to communicate wake mode (Dan) Thanks Vivek Vivek Goyal (3): dax: Add an enum for specifying

[PATCH v3 1/3] dax: Add an enum for specifying dax wakup mode

2021-04-19 Thread Vivek Goyal
not introduce any change of behavior. Suggested-by: Dan Williams Signed-off-by: Vivek Goyal --- fs/dax.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index b3d27fdc6775..00978d0838b1 100644 --- a/fs/dax.c +++ b/fs/dax.c

[PATCH v3 3/3] dax: Wake up all waiters after invalidating dax entry

2021-04-19 Thread Vivek Goyal
all waiters when a dax entry has been invalidated. This seems to fix the deadlock I am facing and I can make forward progress. Reported-by: Sergio Lopez Fixes: ac401cc78242 ("dax: New fault locking") Suggested-by: Dan Williams Signed-off-by: Vivek Goyal --- fs/dax.c | 2 +- 1 file change

[PATCH v3 2/3] dax: Add a wakeup mode parameter to put_unlocked_entry()

2021-04-19 Thread Vivek Goyal
As of now put_unlocked_entry() always wakes up next waiter. In next patches we want to wake up all waiters at one callsite. Hence, add a parameter to the function. This patch does not introduce any change of behavior. Suggested-by: Dan Williams Signed-off-by: Vivek Goyal --- fs/dax.c | 13

Re: [PATCH][v2] dax: Fix missed wakeup during dax entry invalidation

2021-04-19 Thread Vivek Goyal
On Mon, Apr 19, 2021 at 04:39:47PM -0400, Vivek Goyal wrote: > On Mon, Apr 19, 2021 at 12:48:58PM -0700, Dan Williams wrote: > > On Mon, Apr 19, 2021 at 11:45 AM Vivek Goyal wrote: > > > > > > This is V2 of the patch. Posted V1 here. > > > > &g

Re: [PATCH][v2] dax: Fix missed wakeup during dax entry invalidation

2021-04-19 Thread Vivek Goyal
On Mon, Apr 19, 2021 at 12:48:58PM -0700, Dan Williams wrote: > On Mon, Apr 19, 2021 at 11:45 AM Vivek Goyal wrote: > > > > This is V2 of the patch. Posted V1 here. > > > > https://lore.kernel.org/linux-fsdevel/20210416173524.ga1379...@redhat.com/ > > >

[PATCH][v2] dax: Fix missed wakeup during dax entry invalidation

2021-04-19 Thread Vivek Goyal
been invalidated. This seems to fix the deadlock I am facing and I can make forward progress. Reported-by: Sergio Lopez Signed-off-by: Vivek Goyal --- fs/dax.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) Index: redhat-linux/fs/dax.c

Re: [PATCH] dax: Fix missed wakeup in put_unlocked_entry()

2021-04-16 Thread Vivek Goyal
On Fri, Apr 16, 2021 at 12:56:05PM -0700, Dan Williams wrote: > On Fri, Apr 16, 2021 at 10:35 AM Vivek Goyal wrote: > > > > I am seeing missed wakeups which ultimately lead to a deadlock when I am > > using virtiofs with DAX enabled and running "make -j". I had

[PATCH] dax: Fix missed wakeup in put_unlocked_entry()

2021-04-16 Thread Vivek Goyal
alls invalidate_inode_pages2() without any locking. That allows it to make progress in parallel to dax fault path as well as allows multiple instances of invalidate_inode_pages2() to run in parallel. Not-yet-signed-off-by: Vivek Goyal --- fs/dax.c |7 --- 1 file changed, 4 insertion

Re: [PATCH v2 0/2] fuse: Fix clearing SGID when access ACL is set

2021-04-14 Thread Vivek Goyal
On Wed, Apr 14, 2021 at 01:57:01PM +0200, Miklos Szeredi wrote: > On Thu, Mar 25, 2021 at 4:19 PM Vivek Goyal wrote: > > > > > > Hi, > > > > This is V2 of the patchset. Posted V1 here. > > > > https://lore.kernel.org/linux-fsdevel/20210319195547.4273

Re: [Virtio-fs] [PATCH v2 0/2] fuse: Fix clearing SGID when access ACL is set

2021-04-13 Thread Vivek Goyal
Hi Miklos, Ping for this patch series. Vivek On Thu, Mar 25, 2021 at 11:18:21AM -0400, Vivek Goyal wrote: > > Hi, > > This is V2 of the patchset. Posted V1 here. > > https://lore.kernel.org/linux-fsdevel/20210319195547.427371-1-vgo...@redhat.com/ > > Changes

Re: [PATCH] fuse: Avoid potential use after free

2021-04-07 Thread Vivek Goyal
On Tue, Apr 06, 2021 at 06:53:32PM -0500, Aditya Pakki wrote: > In virtio_fs_get_tree, after fm is freed, it is again freed in case > s_root is NULL and virtio_fs_fill_super() returns an error. To avoid > a double free, set fm to NULL. > > Signed-off-by: Aditya Pakki > --- > fs/fuse/virtio_fs.c

Re: [PATCH v1] ovl: Fix leaked dentry

2021-04-01 Thread Vivek Goyal
do_group_exit+0x135/0x380 >__do_sys_exit_group.isra.0+0x20/0x20 >__x64_sys_exit_group+0x3c/0x50 >do_syscall_64+0x45/0x70 >entry_SYSCALL_64_after_hwframe+0x44/0xae > ... > VFS: Busy inodes after unmount of overlay. Self-destruct in 5 seconds. > Have a nice day... > > This

Re: [PATCH v1] ovl: Fix leaked dentry

2021-04-01 Thread Vivek Goyal
> > This fix has been tested with a syzkaller reproducer. > Looks good to me. I realized that dentry leak will happen on underlying filesystem so unmount of underlying filesystem will give this warning. I created nested overlayfs configuration and could reproduce this error and te

Re: [PATCH v2 1/2] fuse: Add support for FUSE_SETXATTR_V2

2021-03-29 Thread Vivek Goyal
On Mon, Mar 29, 2021 at 03:54:03PM +0100, Luis Henriques wrote: > On Thu, Mar 25, 2021 at 11:18:22AM -0400, Vivek Goyal wrote: > > Fuse client needs to send additional information to file server when > > it calls SETXATTR(system.posix_acl_access). Right now there is no

Re: [PATCH v2 1/2] fuse: Add support for FUSE_SETXATTR_V2

2021-03-29 Thread Vivek Goyal
On Mon, Mar 29, 2021 at 03:50:37PM +0100, Luis Henriques wrote: > On Thu, Mar 25, 2021 at 11:18:22AM -0400, Vivek Goyal wrote: > > Fuse client needs to send additional information to file server when > > it calls SETXATTR(system.posix_acl_access). Right now there is no

[PATCH v2 2/2] fuse: Add a flag FUSE_SETXATTR_ACL_KILL_SGID to kill SGID

2021-03-25 Thread Vivek Goyal
. But it does not know whether to clear SGID or not. So add a flag FUSE_SETXATTR_ACL_KILL_SGID and send this info with SETXATTR to let file server know that sgid needs to be cleared as well. Reported-by: Luis Henriques Signed-off-by: Vivek Goyal --- fs/fuse/acl.c | 8 +++- include

[PATCH v2 1/2] fuse: Add support for FUSE_SETXATTR_V2

2021-03-25 Thread Vivek Goyal
in_v2" is only used if file server opts-in for it using flag FUSE_SETXATTR_V2 during feature negotiations. Signed-off-by: Vivek Goyal --- fs/fuse/acl.c | 2 +- fs/fuse/fuse_i.h | 5 - fs/fuse/inode.c | 4 +++- fs/fuse/xattr.c

[PATCH v2 0/2] fuse: Fix clearing SGID when access ACL is set

2021-03-25 Thread Vivek Goyal
g acl" passes now on virtiofs. Thanks Vivek Vivek Goyal (2): fuse: Add support for FUSE_SETXATTR_V2 fuse: Add a flag FUSE_SETXATTR_ACL_KILL_SGID to kill SGID fs/fuse/acl.c | 8 +++- fs/fuse/fuse_i.h | 5 - fs/fuse/inode.c | 4 +++- fs/fu

Re: [PATCH 1/3] posic_acl: Add a helper determine if SGID should be cleared

2021-03-23 Thread Vivek Goyal
On Tue, Mar 23, 2021 at 10:32:33AM +0100, Christian Brauner wrote: > On Mon, Mar 22, 2021 at 01:01:11PM -0400, Vivek Goyal wrote: > > On Sat, Mar 20, 2021 at 11:03:22AM +0100, Christian Brauner wrote: > > > On Fri, Mar 19, 2021 at 11:42:48PM +0100, Andreas Grünbacher

Re: [PATCH] fuse: Fix a potential double free in virtio_fs_get_tree

2021-03-23 Thread Vivek Goyal
On Mon, Mar 22, 2021 at 10:18:31PM -0700, Lv Yunlong wrote: > In virtio_fs_get_tree, fm is allocated by kzalloc() and > assigned to fsc->s_fs_info by fsc->s_fs_info=fm statement. > If the kzalloc() failed, it will goto err directly, so that > fsc->s_fs_info must be non-NULL and fm will be freed.

Re: [PATCH 2/3] virtiofs: split requests that exceed virtqueue size

2021-03-22 Thread Vivek Goyal
ealistically fit on the virtqueue > when it is decomposed into a scattergather list and avoid violating section > 2.6.5.3.1 of the virtio spec. > > Signed-off-by: Connor Kuehl > Signed-off-by: Miklos Szeredi > --- Looks good to me. Reviewed-by: Vivek Goyal Vivek > fs/fuse/fuse_i

Re: [PATCH 1/3] posic_acl: Add a helper determine if SGID should be cleared

2021-03-22 Thread Vivek Goyal
On Sat, Mar 20, 2021 at 11:03:22AM +0100, Christian Brauner wrote: > On Fri, Mar 19, 2021 at 11:42:48PM +0100, Andreas Grünbacher wrote: > > Hi, > > > > Am Fr., 19. März 2021 um 20:58 Uhr schrieb Vivek Goyal : > > > posix_acl_update_mode() determines what's t

[PATCH 2/3] fuse: Add support for FUSE_SETXATTR_V2

2021-03-19 Thread Vivek Goyal
in_v2" is only used if file server opts-in for it using flag FUSE_SETXATTR_V2 during feature negotiations. Signed-off-by: Vivek Goyal --- fs/fuse/acl.c | 2 +- fs/fuse/fuse_i.h | 5 - fs/fuse/inode.c | 4 +++- fs/fuse/xattr.c

[PATCH 1/3] posic_acl: Add a helper determine if SGID should be cleared

2021-03-19 Thread Vivek Goyal
this code in a separate helper so that more than one place can call into it. Cc: Jan Kara Cc: Andreas Gruenbacher Cc: Alexander Viro Signed-off-by: Vivek Goyal --- fs/posix_acl.c| 3 +-- include/linux/posix_acl.h | 11 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff

[PATCH 0/3] fuse: Fix clearing SGID when access ACL is set

2021-03-19 Thread Vivek Goyal
virtiofsd patches here. https://github.com/rhvgoyal/qemu/commits/acl-sgid-setxattr-flag With these patches applied "./check -g acl" passes now on virtiofs. Vivek Goyal (3): posic_acl: Add a helper determine if SGID should be cleared fuse: Add support for FUSE_SETXATTR_V2 fuse:

[PATCH 3/3] fuse: Add a flag FUSE_SETXATTR_ACL_KILL_SGID to kill SGID

2021-03-19 Thread Vivek Goyal
. But it does not know whether to clear SGID or not. So add a flag FUSE_SETXATTR_ACL_KILL_SGID and send this info with SETXATTR to let file server know that sgid needs to be cleared as well. Reported-by: Luis Henriques Signed-off-by: Vivek Goyal --- fs/fuse/acl.c | 7 ++- include

Re: [PATCH 2/3] virtiofs: split requests that exceed virtqueue size

2021-03-19 Thread Vivek Goyal
On Thu, Mar 18, 2021 at 08:52:22AM -0500, Connor Kuehl wrote: > If an incoming FUSE request can't fit on the virtqueue, the request is > placed onto a workqueue so a worker can try to resubmit it later where > there will (hopefully) be space for it next time. > > This is fine for requests that

Re: Question about sg_count_fuse_req() in linux/fs/fuse/virtio_fs.c

2021-03-18 Thread Vivek Goyal
On Wed, Mar 17, 2021 at 01:12:01PM -0500, Connor Kuehl wrote: > Hi, > > I've been familiarizing myself with the virtiofs guest kernel module and I'm > trying to better understand how virtiofs maps a FUSE request into > scattergather lists. > > sg_count_fuse_req() starts knowing that there will

Re: [PATCH v2] virtiofs: fix memory leak in virtio_fs_probe()

2021-03-17 Thread Vivek Goyal
_sys_finit_module+0xb5/0x120 > [<ad2f48c6>] do_syscall_64+0x33/0x40 > [<809526b5>] entry_SYSCALL_64_after_hwframe+0x44/0xae > > Cc: sta...@vger.kernel.org > Signed-off-by: Luis Henriques Reviewed-by: Vivek Goyal Thanks Vivek > --- > Changes since v1:

Re: [PATCH] virtiofs: fix memory leak in virtio_fs_probe()

2021-03-16 Thread Vivek Goyal
On Tue, Mar 16, 2021 at 05:02:34PM +, Luis Henriques wrote: > When accidentally passing twice the same tag to qemu, kmemleak ended up > reporting a memory leak in virtiofs. Also, looking at the log I saw the > following error (that's when I realised the duplicated tag): > > virtiofs: probe

Re: [RFC PATCH] fuse: Clear SGID bit when setting mode in setacl

2021-03-02 Thread Vivek Goyal
On Tue, Mar 02, 2021 at 11:00:33AM -0500, Vivek Goyal wrote: > On Mon, Mar 01, 2021 at 06:20:30PM +, Luis Henriques wrote: > > On Mon, Mar 01, 2021 at 11:33:24AM -0500, Vivek Goyal wrote: > > > On Fri, Feb 26, 2021 at 06:33:57PM +, Luis Henriques wrote: > > >

Re: [RFC PATCH] fuse: Clear SGID bit when setting mode in setacl

2021-03-02 Thread Vivek Goyal
On Mon, Mar 01, 2021 at 06:20:30PM +, Luis Henriques wrote: > On Mon, Mar 01, 2021 at 11:33:24AM -0500, Vivek Goyal wrote: > > On Fri, Feb 26, 2021 at 06:33:57PM +, Luis Henriques wrote: > > > Setting file permissions with POSIX ACLs (setxattr) isn't clearing th

Re: [RFC PATCH] fuse: Clear SGID bit when setting mode in setacl

2021-03-02 Thread Vivek Goyal
On Mon, Mar 01, 2021 at 11:33:24AM -0500, Vivek Goyal wrote: > On Fri, Feb 26, 2021 at 06:33:57PM +, Luis Henriques wrote: > > Setting file permissions with POSIX ACLs (setxattr) isn't clearing the > > setgid bit. This seems to be CVE-2016-7097, detected by running fstest

Re: [RFC PATCH] fuse: Clear SGID bit when setting mode in setacl

2021-03-01 Thread Vivek Goyal
On Fri, Feb 26, 2021 at 06:33:57PM +, Luis Henriques wrote: > Setting file permissions with POSIX ACLs (setxattr) isn't clearing the > setgid bit. This seems to be CVE-2016-7097, detected by running fstest > generic/375 in virtiofs. Unfortunately, when the fix for this CVE landed > in the

Re: [PATCH v3 1/1] kernel/crash_core: Add crashkernel=auto for vmcore creation

2021-02-17 Thread Vivek Goyal
On Wed, Feb 17, 2021 at 02:26:53PM -0500, Steven Rostedt wrote: > On Wed, 17 Feb 2021 12:40:43 -0600 > john.p.donne...@oracle.com wrote: > > > Hello. > > > > Ping. > > > > Can we get this reviewed and staged ? > > > > Thank you. > > Andrew, > > Seems you are the only one pushing patches in

Re: [PATCH 03/18] ovl: stack miscattr

2021-02-04 Thread Vivek Goyal
On Wed, Feb 03, 2021 at 01:40:57PM +0100, Miklos Szeredi wrote: > Add stacking for the miscattr operations. > > Signed-off-by: Miklos Szeredi > --- > fs/overlayfs/dir.c | 2 ++ > fs/overlayfs/inode.c | 43 > fs/overlayfs/overlayfs.h | 2 ++ >

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2021-01-05 Thread Vivek Goyal
On Tue, Jan 05, 2021 at 09:11:23AM +0200, Amir Goldstein wrote: > > > > > > What I would rather see is: > > > - Non-volatile: first syncfs in every container gets an error (nice to > > > have) > > > > I am not sure why are we making this behavior per container. This should > > be no different

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2021-01-04 Thread Vivek Goyal
On Mon, Jan 04, 2021 at 11:42:51PM +0200, Amir Goldstein wrote: > On Mon, Jan 4, 2021 at 5:40 PM Vivek Goyal wrote: > > > > On Mon, Jan 04, 2021 at 05:22:07PM +0200, Amir Goldstein wrote: > > > > > Since Jeff's patch is minimal, I think that it should be the fix >

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2021-01-04 Thread Vivek Goyal
On Wed, Dec 23, 2020 at 06:20:27PM +, Sargun Dhillon wrote: > On Mon, Dec 21, 2020 at 02:50:55PM -0500, Vivek Goyal wrote: > > Currently syncfs() and fsync() seem to be two interfaces which check and > > return writeback errors on superblock to user space. fsync() shoul

Re: [PATCH 2/3] vfs: Add a super block operation to check for writeback errors

2021-01-04 Thread Vivek Goyal
On Wed, Dec 23, 2020 at 07:48:52AM -0500, Jeff Layton wrote: > On Mon, 2020-12-21 at 14:50 -0500, Vivek Goyal wrote: > > Right now we check for errors on super block in syncfs(). > > > > ret2 = errseq_check_and_advance(>s_wb_err, >f_sb_err); > > > >

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2021-01-04 Thread Vivek Goyal
On Mon, Dec 28, 2020 at 03:56:18PM +, Matthew Wilcox wrote: > On Mon, Dec 28, 2020 at 08:25:50AM -0500, Jeff Layton wrote: > > To be clear, the main thing you'll lose with the method above is the > > ability to see an unseen error on a newly opened fd, if there was an > > overlayfs mount using

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2021-01-04 Thread Vivek Goyal
On Mon, Dec 28, 2020 at 05:51:06PM +0200, Amir Goldstein wrote: > On Mon, Dec 28, 2020 at 3:25 PM Jeff Layton wrote: > > > > On Fri, 2020-12-25 at 08:50 +0200, Amir Goldstein wrote: > > > On Thu, Dec 24, 2020 at 2:13 PM Matthew Wilcox > > > wrote: > > > > > > > > On Thu, Dec 24, 2020 at

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2021-01-04 Thread Vivek Goyal
On Mon, Jan 04, 2021 at 05:22:07PM +0200, Amir Goldstein wrote: > > > Since Jeff's patch is minimal, I think that it should be the fix applied > > > first and proposed for stable (with adaptations for non-volatile overlay). > > > > Does stable fix has to be same as mainline fix. IOW, I think

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2021-01-04 Thread Vivek Goyal
On Thu, Dec 24, 2020 at 11:32:55AM +0200, Amir Goldstein wrote: > On Wed, Dec 23, 2020 at 10:44 PM Matthew Wilcox wrote: > > > > On Wed, Dec 23, 2020 at 08:21:41PM +, Sargun Dhillon wrote: > > > On Wed, Dec 23, 2020 at 08:07:46PM +, Matthew Wilcox wrote: > > > > On Wed, Dec 23, 2020 at

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-22 Thread Vivek Goyal
On Tue, Dec 22, 2020 at 05:46:37PM +, Matthew Wilcox wrote: > On Tue, Dec 22, 2020 at 11:29:25AM -0500, Vivek Goyal wrote: > > On Tue, Dec 22, 2020 at 04:20:27PM +, Matthew Wilcox wrote: > > > On Mon, Dec 21, 2020 at 02:50:55PM -0500, Vivek Goyal wrote: &

Re: [PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-22 Thread Vivek Goyal
On Tue, Dec 22, 2020 at 04:20:27PM +, Matthew Wilcox wrote: > On Mon, Dec 21, 2020 at 02:50:55PM -0500, Vivek Goyal wrote: > > +static int ovl_errseq_check_advance(struct super_block *sb, struct file > > *file) > > +{ > > + struct ovl_fs *ofs = sb->s_fs_in

Re: [PATCH 2/3] vfs: Add a super block operation to check for writeback errors

2020-12-22 Thread Vivek Goyal
On Tue, Dec 22, 2020 at 04:19:00PM +, Matthew Wilcox wrote: > On Mon, Dec 21, 2020 at 02:50:54PM -0500, Vivek Goyal wrote: > > - ret2 = errseq_check_and_advance(>s_wb_err, >f_sb_err); > > + if (sb->s_op->errseq_check_advance) > > + ret2 = sb->s

Re: [PATCH 1/3] vfs: Do not ignore return code from s_op->sync_fs

2020-12-22 Thread Vivek Goyal
quot_quota_sync(): Jan thinks that it might make some sense to capture return code here. But I am leaving it untouched for now. When somebody needs it, they can easily fix it. Signed-off-by: Vivek Goyal --- fs/sync.c |8 ++-- 1 file changed,

[PATCH 2/3] vfs: Add a super block operation to check for writeback errors

2020-12-21 Thread Vivek Goyal
ic method and provide its own method to check for writeback errors. Signed-off-by: Vivek Goyal --- fs/sync.c | 5 - include/linux/fs.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/sync.c b/fs/sync.c index b5fb83a734cd..57e43a16dfca 100644 --- a/fs/sync.c

[RFC PATCH 0/3][v3] vfs, overlayfs: Fix syncfs() to return correct errors

2020-12-21 Thread Vivek Goyal
ing the writeback error issue. Thanks Vivek Vivek Goyal (3): vfs: Do not ignore return code from s_op->sync_fs vfs: Add a super block operation to check for writeback errors overlayfs: Report writeback errors on upper fs/overlayfs/file.c | 1 + fs/overlayfs/overlayfs.h |

[PATCH 3/3] overlayfs: Report writeback errors on upper

2020-12-21 Thread Vivek Goyal
o figure out if any error on upper sb has happened since then. Note, Right now this patch only deals with regular file and directories. Yet to deal with special files like device inodes, socket, fifo etc. Suggested-by: Jeff Layton Signed-off-by: Vivek Goyal --- fs/overlayfs/file.c | 1 + fs/o

[PATCH 1/3] vfs: Do not ignore return code from s_op->sync_fs

2020-12-21 Thread Vivek Goyal
dquot_disable() just beacuse caches might be incoherent. dquot_quota_sync(): Jan thinks that it might make some sense to capture return code here. But I am leaving it untouched for now. When somebody needs it, they can easily fix it. Signed-off-by:

Re: [PATCH 3/3] overlayfs: Check writeback errors w.r.t upper in ->syncfs()

2020-12-18 Thread Vivek Goyal
On Fri, Dec 18, 2020 at 10:02:58AM -0500, Jeff Layton wrote: > On Fri, Dec 18, 2020 at 09:44:18AM -0500, Vivek Goyal wrote: > > On Thu, Dec 17, 2020 at 03:08:56PM -0500, Jeffrey Layton wrote: > > > On Wed, Dec 16, 2020 at 06:31:49PM -0500, Vivek Goyal wrote: > > >

Re: [PATCH 3/3] overlayfs: Check writeback errors w.r.t upper in ->syncfs()

2020-12-18 Thread Vivek Goyal
On Thu, Dec 17, 2020 at 03:08:56PM -0500, Jeffrey Layton wrote: > On Wed, Dec 16, 2020 at 06:31:49PM -0500, Vivek Goyal wrote: > > Check for writeback error on overlay super block w.r.t "struct file" > > passed in ->syncfs(). > > > > As of now real error

Re: [PATCH 1/3] vfs: add new f_op->syncfs vector

2020-12-17 Thread Vivek Goyal
On Thu, Dec 17, 2020 at 10:57:28AM +0100, Jan Kara wrote: > On Thu 17-12-20 00:49:35, Al Viro wrote: > > [Christoph added to Cc...] > > On Wed, Dec 16, 2020 at 06:31:47PM -0500, Vivek Goyal wrote: > > > Current implementation of __sync_filesystem() ignores the return code &

Re: [PATCH 1/3] vfs: add new f_op->syncfs vector

2020-12-17 Thread Vivek Goyal
On Thu, Dec 17, 2020 at 12:49:35AM +, Al Viro wrote: > [Christoph added to Cc...] > On Wed, Dec 16, 2020 at 06:31:47PM -0500, Vivek Goyal wrote: > > Current implementation of __sync_filesystem() ignores the return code > > from ->sync_fs(). I am not sure why that's the

[PATCH 1/3] vfs: add new f_op->syncfs vector

2020-12-16 Thread Vivek Goyal
Current implementation of __sync_filesystem() ignores the return code from ->sync_fs(). I am not sure why that's the case. There must have been some historical reason for this. Ignoring ->sync_fs() return code is problematic for overlayfs where it can return error if sync_filesystem() on upper

[PATCH 3/3] overlayfs: Check writeback errors w.r.t upper in ->syncfs()

2020-12-16 Thread Vivek Goyal
pen to change it if there are issues in this method. Signed-off-by: Vivek Goyal --- fs/overlayfs/ovl_entry.h | 2 ++ fs/overlayfs/super.c | 15 --- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/fs/overlayfs/ovl_entry.h b/fs/overlayfs/ovl_entry.h index 1b5a2094df8e..a08fd719ee7b 10

[PATCH 2/3] overlayfs: Implement f_op->syncfs() call

2020-12-16 Thread Vivek Goyal
Provide an implementation for ->syncfs(). Now if there is an error returned by sync_filesystem(upper_sb), it will be visible to user space. Currently in ovl_sync_fs() path, this error is ignored by VFS. A later patch also adds logic to detect writeback error. Signed-off-by: Vivek Goyal ---

[RFC PATCH 0/3] vfs, overlayfs: Fix syncfs() to return error

2020-12-16 Thread Vivek Goyal
compile tested patch series. Trying to get early feedback to figure out what direction to move in to fix this issue. Thanks Vivek Vivek Goyal (3): vfs: add new f_op->syncfs vector overlayfs: Implement f_op->syncfs() call overlayfs: Check writeback errors w.r.t upper in ->syncfs() fs/

Re: [PATCH] vfs, syncfs: Do not ignore return code from ->sync_fs()

2020-12-16 Thread Vivek Goyal
On Wed, Dec 16, 2020 at 10:53:16AM -0500, Jeff Layton wrote: > On Wed, 2020-12-16 at 10:44 -0500, Jeff Layton wrote: > > On Wed, 2020-12-16 at 10:14 -0500, Vivek Goyal wrote: > > > On Wed, Dec 16, 2020 at 09:57:49AM -0500, Jeff Layton wrote: > > > > On Wed, 2020-12-

Re: [PATCH] vfs, syncfs: Do not ignore return code from ->sync_fs()

2020-12-16 Thread Vivek Goyal
On Wed, Dec 16, 2020 at 09:57:49AM -0500, Jeff Layton wrote: > On Wed, 2020-12-16 at 09:38 -0500, Vivek Goyal wrote: > > I see that current implementation of __sync_filesystem() ignores the > > return code from ->sync_fs(). I am not sure why that's the case. > > > &g

[PATCH] vfs, syncfs: Do not ignore return code from ->sync_fs()

2020-12-16 Thread Vivek Goyal
ow to propagate overlay sync_fs() errors to user space. Signed-off-by: Vivek Goyal --- fs/sync.c |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) Index: redhat-linux/fs/sync.c === --- redhat-linux.orig/fs/sync.c 2

Re: Unbreakable loop in fuse_fill_write_pages()

2020-10-13 Thread Vivek Goyal
On Tue, Oct 13, 2020 at 03:53:19PM -0400, Qian Cai wrote: > On Tue, 2020-10-13 at 14:58 -0400, Vivek Goyal wrote: > > > I am wondering if virtiofsd still alive and responding to requests? I > > see another task which is blocked on getdents() for more than 120s. > > &

Re: Unbreakable loop in fuse_fill_write_pages()

2020-10-13 Thread Vivek Goyal
On Tue, Oct 13, 2020 at 02:40:26PM -0400, Vivek Goyal wrote: > On Tue, Oct 13, 2020 at 01:11:05PM -0400, Qian Cai wrote: > > Running some fuzzing on virtiofs with an unprivileged user on today's > > linux-next > > could trigger soft-lockups below. > > > &g

Re: Unbreakable loop in fuse_fill_write_pages()

2020-10-13 Thread Vivek Goyal
On Tue, Oct 13, 2020 at 01:11:05PM -0400, Qian Cai wrote: > Running some fuzzing on virtiofs with an unprivileged user on today's > linux-next > could trigger soft-lockups below. > > # virtiofsd --socket-path=/tmp/vhostqemu -o source=$TESTDIR -o cache=always > -o no_posix_lock > > Basically,

Re: [PATCH v4] kvm,x86: Exit to user space in case page fault error

2020-10-06 Thread Vivek Goyal
On Tue, Oct 06, 2020 at 10:17:04AM -0700, Sean Christopherson wrote: [..] > > > Note, TDX doesn't allow injection exceptions, so reflecting a #PF back > > > into the guest is not an option. > > > > Not even #MC? So sad :-) > > Heh, #MC isn't allowed either, yet... If #MC is not allowd, logic

Re: [Virtio-fs] [PATCH v4] kvm, x86: Exit to user space in case page fault error

2020-10-06 Thread Vivek Goyal
n Tue, Oct 06, 2020 at 05:24:54PM +0200, Vitaly Kuznetsov wrote: > > > >> Vivek Goyal writes: > > > >> > So you will have to report token (along with -EFAULT) to user space. > > > >> > So this > > > >> > is basically th

Re: [PATCH v4] kvm,x86: Exit to user space in case page fault error

2020-10-06 Thread Vivek Goyal
On Tue, Oct 06, 2020 at 09:12:00AM -0700, Sean Christopherson wrote: > On Tue, Oct 06, 2020 at 05:24:54PM +0200, Vitaly Kuznetsov wrote: > > Vivek Goyal writes: > > > So you will have to report token (along with -EFAULT) to user space. So > > > this > > >

Re: [PATCH v4] kvm,x86: Exit to user space in case page fault error

2020-10-06 Thread Vivek Goyal
On Tue, Oct 06, 2020 at 04:50:44PM +0200, Vitaly Kuznetsov wrote: > Vivek Goyal writes: > > > On Tue, Oct 06, 2020 at 04:05:16PM +0200, Vitaly Kuznetsov wrote: > >> Vivek Goyal writes: > >> > >> > A. Just exit to user space with -EFAULT (u

Re: [PATCH v4] kvm,x86: Exit to user space in case page fault error

2020-10-06 Thread Vivek Goyal
On Tue, Oct 06, 2020 at 04:05:16PM +0200, Vitaly Kuznetsov wrote: > Vivek Goyal writes: > > > A. Just exit to user space with -EFAULT (using kvm request) and don't > >wait for the accessing task to run on vcpu again. > > What if we also save the requir

Re: [PATCH v4] kvm,x86: Exit to user space in case page fault error

2020-10-06 Thread Vivek Goyal
On Mon, Oct 05, 2020 at 09:16:20AM -0700, Sean Christopherson wrote: > On Mon, Oct 05, 2020 at 11:33:18AM -0400, Vivek Goyal wrote: > > On Fri, Oct 02, 2020 at 02:13:14PM -0700, Sean Christopherson wrote: > > Now I have few questions. > > > > - If we exit to user spac

Re: virtiofs: WARN_ON(out_sgs + in_sgs != total_sgs)

2020-10-06 Thread Vivek Goyal
On Tue, Oct 06, 2020 at 10:04:27AM +0100, Stefan Hajnoczi wrote: > On Sun, Oct 04, 2020 at 10:31:19AM -0400, Vivek Goyal wrote: > > On Fri, Oct 02, 2020 at 10:44:37PM -0400, Qian Cai wrote: > > > On Fri, 2020-10-02 at 12:28 -0400, Qian Cai wrote: > > > > Running some

Re: [PATCH v4] kvm,x86: Exit to user space in case page fault error

2020-10-05 Thread Vivek Goyal
On Fri, Oct 02, 2020 at 02:13:14PM -0700, Sean Christopherson wrote: > On Fri, Oct 02, 2020 at 04:02:14PM -0400, Vivek Goyal wrote: > > On Fri, Oct 02, 2020 at 12:45:18PM -0700, Sean Christopherson wrote: > > > On Fri, Oct 02, 2020 at 03:27:34PM -0400, Vivek Goyal wrote: >

Re: virtiofs: WARN_ON(out_sgs + in_sgs != total_sgs)

2020-10-04 Thread Vivek Goyal
On Fri, Oct 02, 2020 at 10:44:37PM -0400, Qian Cai wrote: > On Fri, 2020-10-02 at 12:28 -0400, Qian Cai wrote: > > Running some fuzzing on virtiofs from a non-privileged user could trigger a > > warning in virtio_fs_enqueue_req(): > > > > WARN_ON(out_sgs + in_sgs != total_sgs); > > Okay, I can

Re: [PATCH v4] kvm,x86: Exit to user space in case page fault error

2020-10-02 Thread Vivek Goyal
On Fri, Oct 02, 2020 at 12:45:18PM -0700, Sean Christopherson wrote: > On Fri, Oct 02, 2020 at 03:27:34PM -0400, Vivek Goyal wrote: > > On Fri, Oct 02, 2020 at 11:30:37AM -0700, Sean Christopherson wrote: > > > On Fri, Oct 02, 2020 at 11:38:54AM -0400, Vivek Goyal wrote: >

Re: [PATCH v4] kvm,x86: Exit to user space in case page fault error

2020-10-02 Thread Vivek Goyal
On Fri, Oct 02, 2020 at 11:30:37AM -0700, Sean Christopherson wrote: > On Fri, Oct 02, 2020 at 11:38:54AM -0400, Vivek Goyal wrote: > > On Thu, Oct 01, 2020 at 03:33:20PM -0700, Sean Christopherson wrote: > > > Alternatively, what about adding a new KVM request type to handle thi

Re: [PATCH v4] kvm,x86: Exit to user space in case page fault error

2020-10-02 Thread Vivek Goyal
On Thu, Oct 01, 2020 at 03:33:20PM -0700, Sean Christopherson wrote: > On Thu, Oct 01, 2020 at 05:55:08PM -0400, Vivek Goyal wrote: > > On Mon, Sep 28, 2020 at 09:37:00PM -0700, Sean Christopherson wrote: > > > On Mon, Jul 20, 2020 at 05:13:59PM -0400, Vivek Goyal wrote: &

Re: [PATCH v4] kvm,x86: Exit to user space in case page fault error

2020-10-01 Thread Vivek Goyal
On Mon, Sep 28, 2020 at 09:37:00PM -0700, Sean Christopherson wrote: > On Mon, Jul 20, 2020 at 05:13:59PM -0400, Vivek Goyal wrote: > > --- > > arch/x86/include/asm/kvm_host.h | 2 ++ > > arch/x86/kvm/mmu.h | 2 +- > > arch/x86/kvm/mmu/mmu.c | 2

Re: [PATCH v2] ovl: introduce new "index=nouuid" option for inodes index feature

2020-09-24 Thread Vivek Goyal
On Thu, Sep 24, 2020 at 05:44:22AM +0300, Amir Goldstein wrote: > On Wed, Sep 23, 2020 at 10:47 PM Vivek Goyal wrote: > > > > On Wed, Sep 23, 2020 at 06:23:08PM +0300, Pavel Tikhomirov wrote: > > > This relaxes uuid checks for overlay index feature. It is only possible >

Re: [PATCH v2] ovl: introduce new "index=nouuid" option for inodes index feature

2020-09-23 Thread Vivek Goyal
container and we require fs uuid to be uniq for a new > container. > > v2: in v1 I missed actual uuid check skip - add it > > CC: Amir Goldstein > CC: Vivek Goyal > CC: Miklos Szeredi > CC: linux-unio...@vger.kernel.org > CC: linux-kernel@vger.kernel.org > Signed-o

Re: linux-next: build failure after merge of the akpm-current tree

2020-09-08 Thread Vivek Goyal
On Tue, Sep 08, 2020 at 08:09:50PM +1000, Stephen Rothwell wrote: [..] > fs/fuse/virtio_fs.c: In function 'virtio_fs_setup_dax': > fs/fuse/virtio_fs.c:838:9: error: 'struct dev_pagemap' has no member named > 'res'; did you mean 'ref'? > 838 | pgmap->res = (struct resource){ > |

Re: [PATCH v3 00/18] virtiofs: Add DAX support

2020-08-28 Thread Vivek Goyal
On Fri, Aug 28, 2020 at 04:26:55PM +0200, Miklos Szeredi wrote: > On Thu, Aug 20, 2020 at 12:21 AM Vivek Goyal wrote: > > > > Hi All, > > > > This is V3 of patches. I had posted version v2 version here. > > Pushed to: > > git://git.kernel.org/pub/scm

Re: [PATCH v3 11/18] fuse: implement FUSE_INIT map_alignment field

2020-08-26 Thread Vivek Goyal
On Wed, Aug 26, 2020 at 09:26:29PM +0200, Miklos Szeredi wrote: > On Wed, Aug 26, 2020 at 9:17 PM Dr. David Alan Gilbert > wrote: > > > Agreed, because there's not much that the server can do about it if the > > client would like a smaller granularity - the servers granularity might > > be

Re: [PATCH v3 11/18] fuse: implement FUSE_INIT map_alignment field

2020-08-26 Thread Vivek Goyal
On Wed, Aug 26, 2020 at 04:06:35PM +0200, Miklos Szeredi wrote: > On Thu, Aug 20, 2020 at 12:21 AM Vivek Goyal wrote: > > > > The device communicates FUSE_SETUPMAPPING/FUSE_REMOVMAPPING alignment > > constraints via the FUST_INIT map_alignment field. Parse this field a

Re: [PATCH v3 02/18] dax: Create a range version of dax_layout_busy_page()

2020-08-20 Thread Vivek Goyal
dated patch. I also captured your Reviewed-by. >From 3f81f769be9419ffc5a788833339ed439dbcd48e Mon Sep 17 00:00:00 2001 From: Vivek Goyal Date: Tue, 3 Mar 2020 14:58:21 -0500 Subject: [PATCH 02/20] dax: Create a range version of dax_layout_busy_page() virtiofs device has a range of memory which is mapped into fil

[PATCH v3 02/18] dax: Create a range version of dax_layout_busy_page()

2020-08-19 Thread Vivek Goyal
of this function named dax_layout_busy_page_range() which can be used to pass a range which needs to be unmapped. Cc: Dan Williams Cc: linux-nvd...@lists.01.org Cc: Jan Kara Cc: Vishal L Verma Cc: "Weiny, Ira" Signed-off-by: Vivek Goyal --- fs/dax.c

[PATCH v3 11/18] fuse: implement FUSE_INIT map_alignment field

2020-08-19 Thread Vivek Goyal
where the host page sizes are different. Signed-off-by: Stefan Hajnoczi Signed-off-by: Vivek Goyal --- fs/fuse/fuse_i.h | 5 - fs/fuse/inode.c | 18 -- include/uapi/linux/fuse.h | 4 +++- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/fs

[PATCH v3 09/18] fuse,virtiofs: Add a mount option to enable dax

2020-08-19 Thread Vivek Goyal
Add a mount option to allow using dax with virtio_fs. Signed-off-by: Vivek Goyal --- fs/fuse/fuse_i.h| 7 fs/fuse/inode.c | 3 ++ fs/fuse/virtio_fs.c | 82 + 3 files changed, 78 insertions(+), 14 deletions(-) diff --git a/fs/fuse

[PATCH v3 17/18] fuse,virtiofs: Maintain a list of busy elements

2020-08-19 Thread Vivek Goyal
This list will be used selecting fuse_dax_mapping to free when number of free mappings drops below a threshold. Signed-off-by: Vivek Goyal --- fs/fuse/file.c | 22 ++ fs/fuse/fuse_i.h | 7 +++ fs/fuse/inode.c | 4 3 files changed, 33 insertions(+) diff --git

[PATCH v3 06/18] virtiofs: Provide a helper function for virtqueue initialization

2020-08-19 Thread Vivek Goyal
This reduces code duplication and make it little easier to read code. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 50 +++-- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index

[PATCH v3 07/18] fuse: Get rid of no_mount_options

2020-08-19 Thread Vivek Goyal
tions does not work anymore. What we need is a per mount option specific flag so that filesystem can specify which options to show. Add few such flags to control the behavior in more fine grained manner and get rid of no_mount_options. Signed-off-by: Vivek Goyal --- fs/fuse/fuse_i

  1   2   3   4   5   6   7   8   9   10   >