Re: [Virtio-fs] [PATCH v3 06/10] virtiofsd: Let lo_inode_open() return a TempFd

2021-08-09 Thread Max Reitz
On 06.08.21 21:55, Vivek Goyal wrote: On Fri, Jul 30, 2021 at 05:01:30PM +0200, Max Reitz wrote: Strictly speaking, this is not necessary, because lo_inode_open() will always return a new FD owned by the caller, so TempFd.owned will always be true. However, auto-cleanup is nice, and in some

Re: [Virtio-fs] [PATCH v3 04/10] virtiofsd: Add lo_inode_fd() helper

2021-08-09 Thread Max Reitz
On 06.08.21 20:25, Vivek Goyal wrote: On Fri, Jul 30, 2021 at 05:01:28PM +0200, Max Reitz wrote: [..] @@ -1335,12 +1359,18 @@ static void lo_mknod_symlink(fuse_req_t req, fuse_ino_t parent, return; } +res = lo_inode_fd(dir, _fd); +if (res < 0) { +sav

Re: [Virtio-fs] [PATCH v3 02/10] virtiofsd: Add TempFd structure

2021-08-09 Thread Max Reitz
On 06.08.21 16:41, Vivek Goyal wrote: On Fri, Jul 30, 2021 at 05:01:26PM +0200, Max Reitz wrote: We are planning to add file handles to lo_inode objects as an alternative to lo_inode.fd. That means that everywhere where we currently reference lo_inode.fd, we will have to open a temporary file

Re: [Virtio-fs] [PATCH v3 01/10] virtiofsd: Limit setxattr()'s creds-dropped region

2021-08-09 Thread Max Reitz
On 06.08.21 16:16, Vivek Goyal wrote: On Fri, Jul 30, 2021 at 05:01:25PM +0200, Max Reitz wrote: We only need to drop/switch our credentials for the (f)setxattr() call alone, not for the openat() or fchdir() around it. (Right now, this may not be that big of a problem, but with inodes being

Re: [Virtio-fs] Deleting files when using NFS as a shared folder

2021-08-02 Thread Max Reitz
On 02.08.21 13:30, Gal Hammer wrote: On Mon, 2 Aug 2021 at 13:49, Max Reitz <mailto:mre...@redhat.com>> wrote: On 02.08.21 12:44, Gal Hammer wrote: > > > On Mon, 2 Aug 2021 at 13:36, Dr. David Alan Gilbert > mailto:dgilb...@redhat.com> <

Re: [Virtio-fs] Deleting files when using NFS as a shared folder

2021-08-02 Thread Max Reitz
On 02.08.21 12:44, Gal Hammer wrote: On Mon, 2 Aug 2021 at 13:36, Dr. David Alan Gilbert mailto:dgilb...@redhat.com>> wrote: * Gal Hammer (gham...@redhat.com ) wrote: > Hello, > > When using NFS as a shared folder (mount type nfs4) with a Linux

[Virtio-fs] [PATCH v3 06/10] virtiofsd: Let lo_inode_open() return a TempFd

2021-07-30 Thread Max Reitz
()). Signed-off-by: Max Reitz --- tools/virtiofsd/passthrough_ll.c | 138 +-- 1 file changed, 59 insertions(+), 79 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index 9e1bc37af8..292b7f7e27 100644 --- a/tools/virtiofsd

[Virtio-fs] [PATCH v3 09/10] virtiofsd: Optionally fill lo_inode.fhandle

2021-07-30 Thread Max Reitz
use statx(). Therefore, using file handles requires statx() support. Signed-off-by: Max Reitz --- tools/virtiofsd/helper.c | 3 + tools/virtiofsd/passthrough_ll.c | 194 -- tools/virtiofsd/passthrough_seccomp.c | 1 + 3 files changed, 190 insertions

[Virtio-fs] [PATCH v3 07/10] virtiofsd: Add lo_inode.fhandle

2021-07-30 Thread Max Reitz
(mapping ID to FD). get_file_handle(), which is added by a later patch, will ensure that every mount ID for which we have generated a handle has a corresponding entry in mount_fds. Signed-off-by: Max Reitz Reviewed-by: Connor Kuehl --- tools/virtiofsd/passthrough_ll.c | 116

[Virtio-fs] [PATCH v3 10/10] virtiofsd: Add lazy lo_do_find()

2021-07-30 Thread Max Reitz
() call. Signed-off-by: Max Reitz --- tools/virtiofsd/passthrough_ll.c | 93 ++-- 1 file changed, 76 insertions(+), 17 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index ac95961d12..41e9f53878 100644 --- a/tools/virtiofsd

[Virtio-fs] [PATCH v3 08/10] virtiofsd: Add inodes_by_handle hash table

2021-07-30 Thread Max Reitz
in the dentry cache, basically. Signed-off-by: Max Reitz --- tools/virtiofsd/passthrough_ll.c | 81 +--- 1 file changed, 65 insertions(+), 16 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index 487448d666..f9d8b2f134 100644

[Virtio-fs] [PATCH v3 02/10] virtiofsd: Add TempFd structure

2021-07-30 Thread Max Reitz
lo_inode.fd). By using g_auto(TempFd) to store this result, callers will not even have to care about closing a temporary FD after use. It will be done automatically once the object goes out of scope. Signed-off-by: Max Reitz Reviewed-by: Connor Kuehl --- tools/virtiofsd/passthrough_ll.c | 49

[Virtio-fs] [PATCH v3 00/10] virtiofsd: Allow using file handles instead of O_PATH FDs

2021-07-30 Thread Max Reitz
his makes the diff to master slightly smaller. - Rebase conflict in lookup_name() because of the fix in patch 4 - Patch 10: - Rebase conflict in lookup_name() because of the fix in patch 4 Max Reitz (10): virtiofsd: Limit setxattr()'s creds-dropped region virtiofsd: Add TempFd

[Virtio-fs] [PATCH v3 01/10] virtiofsd: Limit setxattr()'s creds-dropped region

2021-07-30 Thread Max Reitz
is really fickle when it comes to credentials being dropped.) Signed-off-by: Max Reitz --- tools/virtiofsd/passthrough_ll.c | 34 +++- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c

[Virtio-fs] [PATCH v3 05/10] virtiofsd: Let lo_fd() return a TempFd

2021-07-30 Thread Max Reitz
-off-by: Max Reitz Reviewed-by: Connor Kuehl --- tools/virtiofsd/passthrough_ll.c | 55 +--- 1 file changed, 44 insertions(+), 11 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index 86b901cf19..9e1bc37af8 100644

[Virtio-fs] [PATCH v3 03/10] virtiofsd: Use lo_inode_open() instead of openat()

2021-07-30 Thread Max Reitz
this patch, lo_inode_open() is the only place to invoke openat() to reopen an existing FD with different flags. Signed-off-by: Max Reitz --- tools/virtiofsd/passthrough_ll.c | 43 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll

[Virtio-fs] [PATCH v3 04/10] virtiofsd: Add lo_inode_fd() helper

2021-07-30 Thread Max Reitz
Once we let lo_inode.fd be optional, we will need its users to open the file handle stored in lo_inode instead. This function will do that. For now, it just returns lo_inode.fd, though. Signed-off-by: Max Reitz --- tools/virtiofsd/passthrough_ll.c | 150 +-- 1 file

Re: [Virtio-fs] [PATCH v2 7/9] virtiofsd: Add inodes_by_handle hash table

2021-07-21 Thread Max Reitz
On 20.07.21 16:50, Vivek Goyal wrote: On Tue, Jul 13, 2021 at 05:07:31PM +0200, Max Reitz wrote: [..] The next question is, how do we detect temporary failure, because if we look up some new inode, name_to_handle_at() fails, we ignore it, and then it starts to work and we fail all further

Re: [Virtio-fs] [PATCH v2 7/9] virtiofsd: Add inodes_by_handle hash table

2021-07-13 Thread Max Reitz
I’m sending this mail as a heads up before I send v3 in the next days, to explain my thought process. On 21.06.21 11:02, Max Reitz wrote: On 18.06.21 20:29, Vivek Goyal wrote: [...] I am still reading your code and trying to understand it. But one question came to mind. What happens if we can

Re: [Virtio-fs] [PATCH v2 7/9] virtiofsd: Add inodes_by_handle hash table

2021-06-21 Thread Max Reitz
On 21.06.21 17:51, Vivek Goyal wrote: On Mon, Jun 21, 2021 at 11:02:16AM +0200, Max Reitz wrote: On 18.06.21 20:29, Vivek Goyal wrote: [snip] What am I not able to understand is that why we can't return error if we run into a temporary issue and can't generate file handle. What's

Re: [Virtio-fs] [PATCH v2 7/9] virtiofsd: Add inodes_by_handle hash table

2021-06-21 Thread Max Reitz
On 18.06.21 20:29, Vivek Goyal wrote: On Fri, Jun 18, 2021 at 10:28:38AM +0200, Max Reitz wrote: On 17.06.21 23:21, Vivek Goyal wrote: On Wed, Jun 16, 2021 at 03:38:13PM +0200, Max Reitz wrote: On 11.06.21 22:04, Vivek Goyal wrote: On Wed, Jun 09, 2021 at 05:55:49PM +0200, Max Reitz wrote

Re: [Virtio-fs] [PATCH v2 7/9] virtiofsd: Add inodes_by_handle hash table

2021-06-18 Thread Max Reitz
On 09.06.21 17:55, Max Reitz wrote: Currently, lo_inode.fhandle is always NULL and so always keep an O_PATH FD in lo_inode.fd. Therefore, when the respective inode is unlinked, its inode ID will remain in use until we drop our lo_inode (and lo_inode_put() thus closes the FD). Therefore

Re: [Virtio-fs] [PATCH v2 7/9] virtiofsd: Add inodes_by_handle hash table

2021-06-18 Thread Max Reitz
On 17.06.21 23:21, Vivek Goyal wrote: On Wed, Jun 16, 2021 at 03:38:13PM +0200, Max Reitz wrote: On 11.06.21 22:04, Vivek Goyal wrote: On Wed, Jun 09, 2021 at 05:55:49PM +0200, Max Reitz wrote: Currently, lo_inode.fhandle is always NULL and so always keep an O_PATH FD in lo_inode.fd

Re: [Virtio-fs] [PATCH v2 0/9] virtiofsd: Allow using file handles instead of O_PATH FDs

2021-06-16 Thread Max Reitz
On 11.06.21 21:19, Vivek Goyal wrote: On Wed, Jun 09, 2021 at 05:55:42PM +0200, Max Reitz wrote: Hi, v1 cover letter for an overview: https://listman.redhat.com/archives/virtio-fs/2021-June/msg00033.html Hi Max, What's the impact of these patches on performance? Just trying to get some idea

Re: [Virtio-fs] [PATCH v2 7/9] virtiofsd: Add inodes_by_handle hash table

2021-06-16 Thread Max Reitz
On 11.06.21 22:04, Vivek Goyal wrote: On Wed, Jun 09, 2021 at 05:55:49PM +0200, Max Reitz wrote: Currently, lo_inode.fhandle is always NULL and so always keep an O_PATH FD in lo_inode.fd. Therefore, when the respective inode is unlinked, its inode ID will remain in use until we drop our

[Virtio-fs] [PATCH v2 5/9] virtiofsd: Let lo_inode_open() return a TempFd

2021-06-09 Thread Max Reitz
()). Signed-off-by: Max Reitz Reviewed-by: Connor Kuehl --- tools/virtiofsd/passthrough_ll.c | 137 +-- 1 file changed, 59 insertions(+), 78 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index 8f64bcd6c5..3014e8baf8 100644

[Virtio-fs] [PATCH v2 1/9] virtiofsd: Add TempFd structure

2021-06-09 Thread Max Reitz
lo_inode.fd). By using g_auto(TempFd) to store this result, callers will not even have to care about closing a temporary FD after use. It will be done automatically once the object goes out of scope. Signed-off-by: Max Reitz Reviewed-by: Connor Kuehl --- tools/virtiofsd/passthrough_ll.c | 49

[Virtio-fs] [PATCH v2 0/9] virtiofsd: Allow using file handles instead of O_PATH FDs

2021-06-09 Thread Max Reitz
:[] [--] 'virtiofsd: Let lo_inode_open() return a TempFd' 006/9:[] [--] 'virtiofsd: Add lo_inode.fhandle' 007/9:[] [--] 'virtiofsd: Add inodes_by_handle hash table' 008/9:[0045] [FC] 'virtiofsd: Optionally fill lo_inode.fhandle' 009/9:[] [--] 'virtiofsd: Add lazy lo_do_find()' Max Reitz (9

[Virtio-fs] [PATCH v2 8/9] virtiofsd: Optionally fill lo_inode.fhandle

2021-06-09 Thread Max Reitz
use statx(). Therefore, using file handles requires statx() support. Signed-off-by: Max Reitz --- tools/virtiofsd/helper.c | 3 + tools/virtiofsd/passthrough_ll.c | 197 -- tools/virtiofsd/passthrough_seccomp.c | 1 + 3 files changed, 192 insertions

[Virtio-fs] [PATCH v2 3/9] virtiofsd: Add lo_inode_fd() helper

2021-06-09 Thread Max Reitz
Once we let lo_inode.fd be optional, we will need its users to open the file handle stored in lo_inode instead. This function will do that. For now, it just returns lo_inode.fd, though. Signed-off-by: Max Reitz Reviewed-by: Connor Kuehl --- tools/virtiofsd/passthrough_ll.c | 138

[Virtio-fs] [PATCH v2 7/9] virtiofsd: Add inodes_by_handle hash table

2021-06-09 Thread Max Reitz
in the dentry cache, basically. Signed-off-by: Max Reitz Reviewed-by: Connor Kuehl --- tools/virtiofsd/passthrough_ll.c | 80 +--- 1 file changed, 64 insertions(+), 16 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index

[Virtio-fs] [PATCH v2 2/9] virtiofsd: Use lo_inode_open() instead of openat()

2021-06-09 Thread Max Reitz
this patch, lo_inode_open() is the only place to invoke openat() to reopen an existing FD with different flags. Signed-off-by: Max Reitz Reviewed-by: Connor Kuehl --- tools/virtiofsd/passthrough_ll.c | 43 1 file changed, 27 insertions(+), 16 deletions(-) diff --g

[Virtio-fs] [PATCH v2 9/9] virtiofsd: Add lazy lo_do_find()

2021-06-09 Thread Max Reitz
() call. Signed-off-by: Max Reitz Reviewed-by: Connor Kuehl --- tools/virtiofsd/passthrough_ll.c | 93 ++-- 1 file changed, 76 insertions(+), 17 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index 2e56c40b2f..8990fd5bd2

[Virtio-fs] [PATCH v2 6/9] virtiofsd: Add lo_inode.fhandle

2021-06-09 Thread Max Reitz
(mapping ID to FD). get_file_handle(), which is added by a later patch, will ensure that every mount ID for which we have generated a handle has a corresponding entry in mount_fds. Signed-off-by: Max Reitz Reviewed-by: Connor Kuehl --- tools/virtiofsd/passthrough_ll.c | 116

[Virtio-fs] [PATCH v2 4/9] virtiofsd: Let lo_fd() return a TempFd

2021-06-09 Thread Max Reitz
-off-by: Max Reitz Reviewed-by: Connor Kuehl --- tools/virtiofsd/passthrough_ll.c | 55 +--- 1 file changed, 44 insertions(+), 11 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index 46c9dfe200..8f64bcd6c5 100644

Re: [Virtio-fs] [PATCH v2 0/7] fuse: Some fixes for submounts

2021-06-08 Thread Max Reitz
On 04.06.21 18:11, Greg Kurz wrote: v2: - add an extra fix (patch 2) : mount is now added to the list before unlocking sb->s_umount - set SB_BORN just before unlocking sb->s_umount, just like it would happen when using fc_mount() (Max) - don't allocate a FUSE context for the submounts

Re: [Virtio-fs] [PATCH v2 6/7] fuse: Switch to fc_mount() for submounts

2021-06-08 Thread Max Reitz
if (IS_ERR(fsc)) + return (struct vfsmount *) fsc; I think ERR_CAST(fsc) would be nicer. Apart from that: Reviewed-by: Max Reitz ___ Virtio-fs mailing list Virtio-fs@redhat.com https://listman.redhat.com/mailman/listinfo/virtio-fs

Re: [Virtio-fs] [PATCH v2 5/7] fuse: Call vfs_get_tree() for submounts

2021-06-08 Thread Max Reitz
(+), 48 deletions(-) Reviewed-by: Max Reitz ___ Virtio-fs mailing list Virtio-fs@redhat.com https://listman.redhat.com/mailman/listinfo/virtio-fs

Re: [Virtio-fs] [PATCH v2 4/7] fuse: Add dedicated filesystem context ops for submounts

2021-06-08 Thread Max Reitz
e stop allocating/freeing a useless FUSE filesystem context with submounts. Signed-off-by: Greg Kurz --- fs/fuse/fuse_i.h| 5 + fs/fuse/inode.c | 16 fs/fuse/virtio_fs.c | 3 +++ 3 files changed, 24 insertions(+) Reviewed-by: Max

Re: [Virtio-fs] [PATCH v2 3/7] fuse: Fix infinite loop in sget_fc()

2021-06-08 Thread Max Reitz
se/dir.c | 11 +++ 1 file changed, 11 insertions(+) Reviewed-by: Max Reitz ___ Virtio-fs mailing list Virtio-fs@redhat.com https://listman.redhat.com/mailman/listinfo/virtio-fs

Re: [Virtio-fs] [PATCH v2 2/7] fuse: Fix crash if superblock of submount gets killed early

2021-06-08 Thread Max Reitz
ns(+), 4 deletions(-) Reviewed-by: Max Reitz ___ Virtio-fs mailing list Virtio-fs@redhat.com https://listman.redhat.com/mailman/listinfo/virtio-fs

Re: [Virtio-fs] [PATCH 8/9] virtiofsd: Optionally fill lo_inode.fhandle

2021-06-08 Thread Max Reitz
On 08.06.21 12:43, Dr. David Alan Gilbert wrote: * Max Reitz (mre...@redhat.com) wrote: When the inode_file_handles option is set, try to generate a file handle for new inodes instead of opening an O_PATH FD. Being able to open these again will require CAP_DAC_READ_SEARCH, so the description

Re: [Virtio-fs] [PATCH 1/3] virtiofsd: Find original inode ID of mount points

2021-06-04 Thread Max Reitz
On 02.06.21 20:59, Miklos Szeredi wrote: On Wed, 2 Jun 2021 at 20:20, Vivek Goyal wrote: On Wed, May 12, 2021 at 02:55:42PM +0200, Max Reitz wrote: Mount point directories represent two inodes: On one hand, they are a normal directory on their parent filesystem. On the other

[Virtio-fs] [PATCH 9/9] virtiofsd: Add lazy lo_do_find()

2021-06-04 Thread Max Reitz
() call. Signed-off-by: Max Reitz --- tools/virtiofsd/passthrough_ll.c | 93 ++-- 1 file changed, 76 insertions(+), 17 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index d01f9d3a59..ef10a3ace6 100644 --- a/tools/virtiofsd

[Virtio-fs] [PATCH 8/9] virtiofsd: Optionally fill lo_inode.fhandle

2021-06-04 Thread Max Reitz
use statx(). Therefore, using file handles requires statx() support. Signed-off-by: Max Reitz --- tools/virtiofsd/helper.c | 3 + tools/virtiofsd/passthrough_ll.c | 170 -- tools/virtiofsd/passthrough_seccomp.c | 1 + 3 files changed, 165 insertions

[Virtio-fs] [PATCH 7/9] virtiofsd: Add inodes_by_handle hash table

2021-06-04 Thread Max Reitz
in the dentry cache, basically. Signed-off-by: Max Reitz --- tools/virtiofsd/passthrough_ll.c | 80 +--- 1 file changed, 64 insertions(+), 16 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index e665575401..793d2c333e 100644

[Virtio-fs] [PATCH 6/9] virtiofsd: Add lo_inode.fhandle

2021-06-04 Thread Max Reitz
(mapping ID to FD). get_file_handle(), which is added by a later patch, will ensure that every mount ID for which we have generated a handle has a corresponding entry in mount_fds. Signed-off-by: Max Reitz --- tools/virtiofsd/passthrough_ll.c | 116 ++ tools/virtiofsd

[Virtio-fs] [PATCH 5/9] virtiofsd: Let lo_inode_open() return a TempFd

2021-06-04 Thread Max Reitz
()). Signed-off-by: Max Reitz --- tools/virtiofsd/passthrough_ll.c | 137 +-- 1 file changed, 59 insertions(+), 78 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index 8f64bcd6c5..3014e8baf8 100644 --- a/tools/virtiofsd

[Virtio-fs] [PATCH 4/9] virtiofsd: Let lo_fd() return a TempFd

2021-06-04 Thread Max Reitz
-off-by: Max Reitz --- tools/virtiofsd/passthrough_ll.c | 55 +--- 1 file changed, 44 insertions(+), 11 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index 46c9dfe200..8f64bcd6c5 100644 --- a/tools/virtiofsd

[Virtio-fs] [PATCH 3/9] virtiofsd: Add lo_inode_fd() helper

2021-06-04 Thread Max Reitz
Once we let lo_inode.fd be optional, we will need its users to open the file handle stored in lo_inode instead. This function will do that. For now, it just returns lo_inode.fd, though. Signed-off-by: Max Reitz --- tools/virtiofsd/passthrough_ll.c | 138 ++- 1 file

[Virtio-fs] [PATCH 2/9] virtiofsd: Use lo_inode_open() instead of openat()

2021-06-04 Thread Max Reitz
this patch, lo_inode_open() is the only place to invoke openat() to reopen an existing FD with different flags. Signed-off-by: Max Reitz --- tools/virtiofsd/passthrough_ll.c | 43 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll

[Virtio-fs] [PATCH 1/9] virtiofsd: Add TempFd structure

2021-06-04 Thread Max Reitz
lo_inode.fd). By using g_auto(TempFd) to store this result, callers will not even have to care about closing a temporary FD after use. It will be done automatically once the object goes out of scope. Signed-off-by: Max Reitz --- tools/virtiofsd/passthrough_ll.c | 49

[Virtio-fs] [PATCH 0/9] virtiofsd: Allow using file handles instead of O_PATH FDs

2021-06-04 Thread Max Reitz
handles include a generation ID, so we can discern between the old and the new inode.) Patch 9 is completely optional, but I just really felt compelled to write it. Max Reitz (9): virtiofsd: Add TempFd structure virtiofsd: Use lo_inode_open() instead of openat() virtiofsd: Add lo_inode_fd

Re: [Virtio-fs] [PATCH 1/3] virtiofsd: Find original inode ID of mount points

2021-05-27 Thread Max Reitz
On 26.05.21 20:50, Vivek Goyal wrote: On Wed, May 26, 2021 at 02:13:24PM -0400, Vivek Goyal wrote: On Wed, May 12, 2021 at 02:55:42PM +0200, Max Reitz wrote: Mount point directories represent two inodes: On one hand, they are a normal directory on their parent filesystem. On the other

Re: [Virtio-fs] [PATCH 4/4] fuse: Make fuse_fill_super_submount() static

2021-05-27 Thread Max Reitz
/fuse/fuse_i.h | 9 - fs/fuse/inode.c | 4 ++-- 2 files changed, 2 insertions(+), 11 deletions(-) Reviewed-by: Max Reitz ___ Virtio-fs mailing list Virtio-fs@redhat.com https://listman.redhat.com/mailman/listinfo/virtio-fs

Re: [Virtio-fs] [PATCH 3/4] fuse: Call vfs_get_tree() for submounts

2021-05-27 Thread Max Reitz
On 25.05.21 17:02, Greg Kurz wrote: We recently fixed an infinite loop by setting the SB_BORN flag on submounts along with the write barrier needed by super_cache_count(). This is the job of vfs_get_tree() and FUSE shouldn't have to care about the barrier at all. Split out some code from

Re: [Virtio-fs] [PATCH 2/4] fuse: Fix infinite loop in sget_fc()

2021-05-27 Thread Max Reitz
ecause that too was part of the fuse_get_tree_submount() function of your “fuse: Call vfs_get_tree() for submounts” patch. From a quick look at SB_BORN users, it doesn’t seem to make a difference to me, though, so: Reviewed-by: Max Reitz sb->s_flags |= SB_ACTIVE;

Re: [Virtio-fs] [PATCH 1/4] fuse: Fix crash in fuse_dentry_automount() error path

2021-05-27 Thread Max Reitz
6 +- 1 file changed, 5 insertions(+), 1 deletion(-) Reviewed-by: Max Reitz ___ Virtio-fs mailing list Virtio-fs@redhat.com https://listman.redhat.com/mailman/listinfo/virtio-fs

Re: [Virtio-fs] [PATCH 1/3] virtiofsd: Find original inode ID of mount points

2021-05-17 Thread Max Reitz
On 17.05.21 16:57, Vivek Goyal wrote: On Wed, May 12, 2021 at 02:55:42PM +0200, Max Reitz wrote: Mount point directories represent two inodes: On one hand, they are a normal directory on their parent filesystem. On the other, they are the root node of the filesystem mounted there. Thus

[Virtio-fs] Fwd: [PATCH 0/3] virtiofsd: Find original inode ID of mount points

2021-05-12 Thread Max Reitz
of mount points Date: Wed, 12 May 2021 14:55:41 +0200 From: Max Reitz To: qemu-de...@nongnu.org Copy (CC): Max Reitz , Dr . David Alan Gilbert , Stefan Hajnoczi Hi, Not announcing submounts to the guest may lead to duplicated st_dev/st_ino combinations, because inodes on different filesystems

Re: [Virtio-fs] [PATCH 2/7] block: use GDateTime for formatting timestamp when dumping snapshot info

2021-05-07 Thread Max Reitz
-off-by: Daniel P. Berrangé --- block/qapi.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) Reviewed-by: Max Reitz ___ Virtio-fs mailing list Virtio-fs@redhat.com https://listman.redhat.com/mailman/listinfo/virtio-fs

Re: [Virtio-fs] Current file handle status and open questions

2021-04-13 Thread Max Reitz
On 13.04.21 16:05, Vivek Goyal wrote: On Thu, Mar 18, 2021 at 06:09:58PM +0100, Max Reitz wrote: Hi, As threatened in our last meeting, I’ve written this mail to give an overview on where we stand with regards to virtiofsd(-rs) using file handles. Technically, this should be a reply

Re: [Virtio-fs] [RFC] Using hard links instead of lo_inode->fd

2021-04-09 Thread Max Reitz
On 08.04.21 19:51, Vivek Goyal wrote: Hi All, Max has been trying to solve the problem of not having to keep an O_PATH fd open for every file (until inode goes away). Lot of inodes can get cached in guest inode cache and soon we can hit number of max fd limit. Today Christophe de Dinechin

Re: [Virtio-fs] Current file handle status and open questions

2021-03-24 Thread Max Reitz
On 24.03.21 17:44, Dr. David Alan Gilbert wrote: * Stefan Hajnoczi (stefa...@redhat.com) wrote: On Thu, Mar 18, 2021 at 06:09:58PM +0100, Max Reitz wrote: [...] Final minor question that doesn’t really fit in fully elsewhere: When generating a MAC over a file handle, should the mount ID

Re: [Virtio-fs] Current file handle status and open questions

2021-03-24 Thread Max Reitz
On 24.03.21 12:51, Stefan Hajnoczi wrote: On Thu, Mar 18, 2021 at 06:09:58PM +0100, Max Reitz wrote: So, overall it seems like it may be workable to extend the in-kernel MAC verification to allow for persistent keys, but I still have some open questions, and I don’t know whether I should just

Re: [Virtio-fs] Current file handle status and open questions

2021-03-24 Thread Max Reitz
On 23.03.21 17:39, Sergio Lopez wrote: On Thu, Mar 18, 2021 at 06:09:58PM +0100, Max Reitz wrote: Hi, As threatened in our last meeting, I’ve written this mail to give an overview on where we stand with regards to virtiofsd(-rs) using file handles. Technically, this should be a reply

[Virtio-fs] Current file handle status and open questions

2021-03-18 Thread Max Reitz
Hi, As threatened in our last meeting, I’ve written this mail to give an overview on where we stand with regards to virtiofsd(-rs) using file handles. Technically, this should be a reply to the “Securint file handles” thread, but this mail is so long I think it’s better to split it off. There

Re: [Virtio-fs] Notifications from virtiofsd-rs project

2021-03-18 Thread Max Reitz
On 17.03.21 13:41, Sergio Lopez wrote: Hi, I've just created a service [1] that receives GitLab webhook events from the virtiofsd-rs project and sends an email to this mailing list. To keep the noise as low as possible, it only sends an event when an Issue or Merge Request is opened, reopened,

Re: [Virtio-fs] Securing file handles

2021-03-16 Thread Max Reitz
On 08.03.21 15:50, Miklos Szeredi wrote: On Mon, Mar 8, 2021 at 2:39 PM Max Reitz wrote: Admittedly I’m not yet at the point where I feel comfortable doing changes to the kernel at all, so if you have the time, I’d appreciate it. (If you don’t really have the time, I could try my hand first

Re: [Virtio-fs] Securing file handles

2021-03-08 Thread Max Reitz
On 08.03.21 13:30, Miklos Szeredi wrote: On Mon, Mar 8, 2021 at 12:29 PM Max Reitz wrote: On 08.03.21 10:54, Miklos Szeredi wrote: Hi, Thanks for the good summary. Another aspect is what the file handle will be used for: a) allowing server to close O_PATH descriptors any time because

Re: [Virtio-fs] Securing file handles

2021-03-08 Thread Max Reitz
On 08.03.21 10:54, Miklos Szeredi wrote: Hi, Thanks for the good summary. Another aspect is what the file handle will be used for: a) allowing server to close O_PATH descriptors any time because they can be reconstructed using the file handle b) allowing NFS export on client, or just

Re: [Virtio-fs] Securing file handles

2021-03-08 Thread Max Reitz
On 08.03.21 10:06, Sergio Lopez wrote: On Fri, Mar 05, 2021 at 05:22:56PM +0100, Max Reitz wrote: == Summary == So, my current position is: - Bind mounts don’t help with restricting file handles to the exported directory. - A MAC is not very elegant, and we might encounter problems where

[Virtio-fs] Securing file handles

2021-03-05 Thread Max Reitz
Hi, We want virtio-fs to support persistent file handles. There’s a problem, though: If the guest can give arbitrary file handles for virtiofsd to open, it may be able to open host files that are not inside of the shared directory. I’m aware of two general ways that can solve this problem:

Re: [Virtio-fs] Query about announce_submounts and ro/rw mounts

2021-03-04 Thread Max Reitz
On 04.03.21 17:39, Dr. David Alan Gilbert wrote: * Max Reitz (mre...@redhat.com) wrote: On 03.03.21 19:20, Vivek Goyal wrote: Hi Max, Hi Vivek, I was playing with "announce_submounts". I have a read-only bind mounted mount point in shared directory. Inside guest, w

Re: [Virtio-fs] Query about announce_submounts and ro/rw mounts

2021-03-04 Thread Max Reitz
On 03.03.21 19:20, Vivek Goyal wrote: Hi Max, Hi Vivek, I was playing with "announce_submounts". I have a read-only bind mounted mount point in shared directory. Inside guest, when I step into that directory, I see that a mount point got created but its "rw" and not "ro". Is that

Re: [Virtio-fs] virtiofsd: sshfs as submount?

2020-12-21 Thread Max Reitz
On 20.12.20 00:41, Laszlo Ersek wrote: Hi Miklos, (I hope it’s OK for me not to be Miklos, even though I don’t have much to add) the following 2019 presentation on Stefan's website: https://vmsplice.net/ virtio-fs: A Shared File System for Virtual Machines at KVM Forum 2019

[Virtio-fs] [PATCH for-5.2] virtiofsd: Announce submounts even without statx()

2020-11-03 Thread Max Reitz
() mount IDs, is utterly broken anyway. Thus, drop said check in lo_init(). Reported-by: Miklos Szeredi Signed-off-by: Max Reitz --- tools/virtiofsd/passthrough_ll.c | 8 1 file changed, 8 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c index

Re: [Virtio-fs] [PATCH v3 5/7] virtiofsd: Announce sub-mount points

2020-11-03 Thread Max Reitz
On 03.11.20 09:10, Miklos Szeredi wrote: > On Mon, Nov 2, 2020 at 5:19 PM Max Reitz wrote: >> >> Whenever we encounter a directory with an st_dev or mount ID that >> differs from that of its parent, we set the FUSE_ATTR_SUBMOUNT flag so >> the guest can create a sub

[Virtio-fs] [PATCH v3 6/7] tests/acceptance/boot_linux: Accept SSH pubkey

2020-11-02 Thread Max Reitz
Let download_cloudinit() take an optional pubkey, which subclasses of BootLinux can pass through setUp(). Signed-off-by: Max Reitz Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Willian Rampazzo Reviewed-by: Stefan Hajnoczi --- tests/acceptance/boot_linux.py | 13 +++-- 1 file

[Virtio-fs] [PATCH v3 1/7] virtiofsd: Check FUSE_SUBMOUNTS

2020-11-02 Thread Max Reitz
FUSE_SUBMOUNTS is a pure indicator by the kernel to signal that it supports submounts. It does not check its state in the init reply, so there is nothing for fuse_lowlevel.c to do but to check its existence and copy it into fuse_conn_info.capable. Signed-off-by: Max Reitz Reviewed-by: Stefan

[Virtio-fs] [PATCH v3 2/7] virtiofsd: Add attr_flags to fuse_entry_param

2020-11-02 Thread Max Reitz
fuse_entry_param is converted to fuse_attr on the line (by fill_entry()), so it should have a member that mirrors fuse_attr.flags. fill_entry() should then copy this fuse_entry_param.attr_flags to fuse_attr.flags. Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi --- tools/virtiofsd

[Virtio-fs] [PATCH v3 0/7] virtiofsd: Announce submounts to the guest

2020-11-02 Thread Max Reitz
' 007/7:[0042] [FC] 'tests/acceptance: Add virtiofs_submounts.py' Max Reitz (7): virtiofsd: Check FUSE_SUBMOUNTS virtiofsd: Add attr_flags to fuse_entry_param meson.build: Check for statx() virtiofsd: Add mount ID to the lo_inode key virtiofsd: Announce sub-mount points tests/acceptance

[Virtio-fs] [PATCH v3 4/7] virtiofsd: Add mount ID to the lo_inode key

2020-11-02 Thread Max Reitz
. If that is available, add it to the lo_inode key. Most of this patch is taken from Miklos's mail here: https://marc.info/?l=fuse-devel=160062521827983 (virtiofsd-use-mount-id.patch attachment) Suggested-by: Miklos Szeredi Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi --- tools/virtiofsd/passthrough_ll.c

[Virtio-fs] [PATCH v3 3/7] meson.build: Check for statx()

2020-11-02 Thread Max Reitz
Check whether the glibc provides statx() and if so, define CONFIG_STATX. Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi --- meson.build | 16 1 file changed, 16 insertions(+) diff --git a/meson.build b/meson.build index 47e32e1fcb..39ac5cf6d8 100644 --- a/meson.build

[Virtio-fs] [PATCH v3 7/7] tests/acceptance: Add virtiofs_submounts.py

2020-11-02 Thread Max Reitz
, virtiofsd requires them. (If you have a timestamp_timeout period for sudoers (e.g. the default of 5 min), you can provide this by executing something like "sudo true" before invoking Avocado.) Signed-off-by: Max Reitz --- tests/acceptance/virtiofs_submounts.py

[Virtio-fs] [PATCH v3 5/7] virtiofsd: Announce sub-mount points

2020-11-02 Thread Max Reitz
there is no statx().) Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi --- tools/virtiofsd/helper.c | 1 + tools/virtiofsd/passthrough_ll.c | 22 ++ 2 files changed, 23 insertions(+) diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c index 2e181a49b5

Re: [Virtio-fs] [PATCH v2 7/7] tests/acceptance: Add virtiofs_submounts.py

2020-10-30 Thread Max Reitz
On 29.10.20 21:46, Eduardo Habkost wrote: > On Thu, Oct 29, 2020 at 06:17:44PM +0100, Max Reitz wrote: >> This test invokes several shell scripts to create a random directory >> tree full of submounts, and then check in the VM whether every submount >> has its own ID an

[Virtio-fs] [PATCH v2 5/7] virtiofsd: Announce sub-mount points

2020-10-29 Thread Max Reitz
there is no statx().) Signed-off-by: Max Reitz --- tools/virtiofsd/helper.c | 1 + tools/virtiofsd/passthrough_ll.c | 22 ++ 2 files changed, 23 insertions(+) diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c index 2e181a49b5..4433724d3a 100644 --- a/tools

[Virtio-fs] [PATCH v2 6/7] tests/acceptance/boot_linux: Accept SSH pubkey

2020-10-29 Thread Max Reitz
Let download_cloudinit() take an optional pubkey, which subclasses of BootLinux can pass through setUp(). Signed-off-by: Max Reitz Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Willian Rampazzo Reviewed-by: Stefan Hajnoczi --- tests/acceptance/boot_linux.py | 13 +++-- 1 file

[Virtio-fs] [PATCH v2 3/7] meson.build: Check for statx()

2020-10-29 Thread Max Reitz
Check whether the glibc provides statx() and if so, define CONFIG_STATX. Signed-off-by: Max Reitz --- meson.build | 16 1 file changed, 16 insertions(+) diff --git a/meson.build b/meson.build index 47e32e1fcb..39ac5cf6d8 100644 --- a/meson.build +++ b/meson.build @@ -736,6

[Virtio-fs] [PATCH v2 1/7] virtiofsd: Check FUSE_SUBMOUNTS

2020-10-29 Thread Max Reitz
FUSE_SUBMOUNTS is a pure indicator by the kernel to signal that it supports submounts. It does not check its state in the init reply, so there is nothing for fuse_lowlevel.c to do but to check its existence and copy it into fuse_conn_info.capable. Signed-off-by: Max Reitz --- tools/virtiofsd

[Virtio-fs] [PATCH v2 0/7] virtiofsd: Announce submounts to the guest

2020-10-29 Thread Max Reitz
m' 003/7:[down] 'meson.build: Check for statx()' 004/7:[down] 'virtiofsd: Add mount ID to the lo_inode key' 005/7:[0077] [FC] 'virtiofsd: Announce sub-mount points' 006/7:[] [--] 'tests/acceptance/boot_linux: Accept SSH pubkey' 007/7:[] [--] 'tests/acceptance: Add virtiofs_submounts.py'

[Virtio-fs] [PATCH v2 7/7] tests/acceptance: Add virtiofs_submounts.py

2020-10-29 Thread Max Reitz
, virtiofsd requires them. (If you have a timestamp_timeout period for sudoers (e.g. the default of 5 min), you can provide this by executing something like "sudo true" before invoking Avocado.) Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi --- tests/acceptance/virtiofs_su

[Virtio-fs] [PATCH v2 4/7] virtiofsd: Add mount ID to the lo_inode key

2020-10-29 Thread Max Reitz
. If that is available, add it to the lo_inode key. Most of this patch is taken from Miklos's mail here: https://marc.info/?l=fuse-devel=160062521827983 (virtiofsd-use-mount-id.patch attachment) Suggested-by: Miklos Szeredi Signed-off-by: Max Reitz --- I’m not sure how to better mark Miklos as the original author

[Virtio-fs] [PATCH v2 2/7] virtiofsd: Add attr_flags to fuse_entry_param

2020-10-29 Thread Max Reitz
fuse_entry_param is converted to fuse_attr on the line (by fill_entry()), so it should have a member that mirrors fuse_attr.flags. fill_entry() should then copy this fuse_entry_param.attr_flags to fuse_attr.flags. Signed-off-by: Max Reitz --- tools/virtiofsd/fuse_lowlevel.h | 5 + tools

Re: [Virtio-fs] [fuse-devel] [PATCH 0/9] fuse: Mirror virtio-fs submounts

2020-09-24 Thread Max Reitz
On 23.09.20 19:15, Miklos Szeredi wrote: > On Wed, Sep 23, 2020 at 5:45 PM Max Reitz wrote: >> >> On 18.09.20 17:25, Miklos Szeredi wrote: >>> Pushed an updated version to fuse.git#submounts. >>> >>> Also attached incremental patch (against rebase of >

Re: [Virtio-fs] [fuse-devel] [PATCH 0/9] fuse: Mirror virtio-fs submounts

2020-09-23 Thread Max Reitz
On 18.09.20 17:25, Miklos Szeredi wrote: > Pushed an updated version to fuse.git#submounts. > > Also attached incremental patch (against rebase of > virtiofs-submounts-v2 on fuse.git#for-next). > > Changes: > > 1) rebased on top of DAX patches > 2) fixed CUSE > 3) added locking for

Re: [Virtio-fs] [fuse-devel] [PATCH 0/9] fuse: Mirror virtio-fs submounts

2020-09-23 Thread Max Reitz
On 18.09.20 17:25, Miklos Szeredi wrote: > Pushed an updated version to fuse.git#submounts. > > Also attached incremental patch (against rebase of > virtiofs-submounts-v2 on fuse.git#for-next). > > Changes: > > 1) rebased on top of DAX patches > 2) fixed CUSE > 3) added locking for

Re: [Virtio-fs] [PATCH 7/9] fuse: Split fuse_mount off of fuse_conn

2020-09-21 Thread Max Reitz
On 11.09.20 12:32, Stefan Hajnoczi wrote: > On Wed, Sep 09, 2020 at 08:46:01PM +0200, Max Reitz wrote: >> @@ -176,13 +177,22 @@ static ssize_t >> fuse_conn_congestion_threshold_write(struct file *file, >> >> spin_lock(>bg_lock); >> fc->congest

Re: [Virtio-fs] [fuse-devel] [PATCH 0/9] fuse: Mirror virtio-fs submounts

2020-09-21 Thread Max Reitz
On 18.09.20 17:25, Miklos Szeredi wrote: > Pushed an updated version to fuse.git#submounts. > > Also attached incremental patch (against rebase of > virtiofs-submounts-v2 on fuse.git#for-next). > > Changes: > > 1) rebased on top of DAX patches > 2) fixed CUSE > 3) added locking for

  1   2   >