Re: [PATCH 09/11] vfs: factor out inode_insert5()

2018-06-11 Thread Miklos Szeredi
On Mon, Jun 11, 2018 at 11:15:55AM +0200, Miklos Szeredi wrote: > On Sun, Jun 10, 2018 at 8:02 AM, Al Viro wrote: > > On Sun, Jun 10, 2018 at 06:49:10AM +0100, Al Viro wrote: > >> On Tue, May 29, 2018 at 04:41:41PM +0200, Miklos Szeredi wrote: > >> > From: Miklos Sz

Re: [PATCH 09/11] vfs: factor out inode_insert5()

2018-06-11 Thread Miklos Szeredi
On Sun, Jun 10, 2018 at 8:02 AM, Al Viro wrote: > On Sun, Jun 10, 2018 at 06:49:10AM +0100, Al Viro wrote: >> On Tue, May 29, 2018 at 04:41:41PM +0200, Miklos Szeredi wrote: >> > From: Miklos Szeredi >> > >> > Split out common helper for race free insertio

Re: [PATCH 09/11] vfs: factor out inode_insert5()

2018-06-11 Thread Miklos Szeredi
On Sun, Jun 10, 2018 at 8:02 AM, Al Viro wrote: > On Sun, Jun 10, 2018 at 06:49:10AM +0100, Al Viro wrote: >> On Tue, May 29, 2018 at 04:41:41PM +0200, Miklos Szeredi wrote: >> > From: Miklos Szeredi >> > >> > Split out common helper for race free insertio

Re: [GIT PULL] overlayfs update for 4.18

2018-06-11 Thread Miklos Szeredi
On Sun, Jun 10, 2018 at 7:54 AM, Al Viro wrote: > On Fri, Jun 08, 2018 at 11:52:08PM -0700, Christoph Hellwig wrote: >> On Fri, Jun 08, 2018 at 02:13:30PM +0200, Miklos Szeredi wrote: >> > Hi Linus, >> > >> > Please pull from: >> > >> >

Re: [GIT PULL] overlayfs update for 4.18

2018-06-11 Thread Miklos Szeredi
On Sun, Jun 10, 2018 at 7:54 AM, Al Viro wrote: > On Fri, Jun 08, 2018 at 11:52:08PM -0700, Christoph Hellwig wrote: >> On Fri, Jun 08, 2018 at 02:13:30PM +0200, Miklos Szeredi wrote: >> > Hi Linus, >> > >> > Please pull from: >> > >> >

Re: [PATCH 15/39] ovl: add helper to return real file

2018-06-11 Thread Miklos Szeredi
On Sun, Jun 10, 2018 at 7:42 AM, Al Viro wrote: > On Tue, May 29, 2018 at 04:43:15PM +0200, Miklos Szeredi wrote: >> In the common case we can just use the real file cached in >> file->private_data. There are two exceptions: >> >> 1) File has been copied up since

Re: [PATCH 15/39] ovl: add helper to return real file

2018-06-11 Thread Miklos Szeredi
On Sun, Jun 10, 2018 at 7:42 AM, Al Viro wrote: > On Tue, May 29, 2018 at 04:43:15PM +0200, Miklos Szeredi wrote: >> In the common case we can just use the real file cached in >> file->private_data. There are two exceptions: >> >> 1) File has been copied up since

Re: [PATCH 23/39] ovl: add O_DIRECT support

2018-06-11 Thread Miklos Szeredi
On Sun, Jun 10, 2018 at 7:31 AM, Al Viro wrote: > On Tue, May 29, 2018 at 04:43:23PM +0200, Miklos Szeredi wrote: >> Signed-off-by: Miklos Szeredi >> --- >> fs/overlayfs/file.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/fs/overlayf

Re: [PATCH 23/39] ovl: add O_DIRECT support

2018-06-11 Thread Miklos Szeredi
On Sun, Jun 10, 2018 at 7:31 AM, Al Viro wrote: > On Tue, May 29, 2018 at 04:43:23PM +0200, Miklos Szeredi wrote: >> Signed-off-by: Miklos Szeredi >> --- >> fs/overlayfs/file.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/fs/overlayf

Re: [PATCH 19/39] ovl: add ovl_mmap()

2018-06-11 Thread Miklos Szeredi
On Sun, Jun 10, 2018 at 06:24:59AM +0100, Al Viro wrote: > On Tue, May 29, 2018 at 04:43:19PM +0200, Miklos Szeredi wrote: > > Implement stacked mmap. > > > > Signed-off-by: Miklos Szeredi > > --- > > fs/overlayfs/file.c | 28 &

Re: [PATCH 19/39] ovl: add ovl_mmap()

2018-06-11 Thread Miklos Szeredi
On Sun, Jun 10, 2018 at 06:24:59AM +0100, Al Viro wrote: > On Tue, May 29, 2018 at 04:43:19PM +0200, Miklos Szeredi wrote: > > Implement stacked mmap. > > > > Signed-off-by: Miklos Szeredi > > --- > > fs/overlayfs/file.c | 28 &

Re: [PATCH 07/39] vfs: export vfs_ioctl() to modules

2018-06-11 Thread Miklos Szeredi
On Sun, Jun 10, 2018 at 6:57 AM, Al Viro wrote: > On Mon, Jun 04, 2018 at 01:49:04AM -0700, Christoph Hellwig wrote: >> On Tue, May 29, 2018 at 04:43:07PM +0200, Miklos Szeredi wrote: >> > This is needed by the stacked ioctl implementation in overlayfs. >> >> E

Re: [PATCH 07/39] vfs: export vfs_ioctl() to modules

2018-06-11 Thread Miklos Szeredi
On Sun, Jun 10, 2018 at 6:57 AM, Al Viro wrote: > On Mon, Jun 04, 2018 at 01:49:04AM -0700, Christoph Hellwig wrote: >> On Tue, May 29, 2018 at 04:43:07PM +0200, Miklos Szeredi wrote: >> > This is needed by the stacked ioctl implementation in overlayfs. >> >> E

Re: [PATCH 14/39] ovl: stack file ops

2018-06-11 Thread Miklos Szeredi
On Sun, Jun 10, 2018 at 6:13 AM, Al Viro wrote: > On Tue, May 29, 2018 at 04:43:14PM +0200, Miklos Szeredi wrote: >> Implement file operations on a regular overlay file. The underlying file >> is opened separately and cached in ->private_data. >> >> It migh

Re: [PATCH 14/39] ovl: stack file ops

2018-06-11 Thread Miklos Szeredi
On Sun, Jun 10, 2018 at 6:13 AM, Al Viro wrote: > On Tue, May 29, 2018 at 04:43:14PM +0200, Miklos Szeredi wrote: >> Implement file operations on a regular overlay file. The underlying file >> is opened separately and cached in ->private_data. >> >> It migh

[GIT PULL] overlayfs update for 4.18

2018-06-08 Thread Miklos Szeredi
of breaking existing setups. So added infrastruture that allows to skip accounting an open file in nr_files. I don't much like this, but can't see any other way of keeping backward compatibility. There are two conflicts when merging, attaching my resolution. Thanks, Miklos --- Miklos Szeredi (37

[GIT PULL] overlayfs update for 4.18

2018-06-08 Thread Miklos Szeredi
of breaking existing setups. So added infrastruture that allows to skip accounting an open file in nr_files. I don't much like this, but can't see any other way of keeping backward compatibility. There are two conflicts when merging, attaching my resolution. Thanks, Miklos --- Miklos Szeredi (37

Re: [PATCH 10/32] VFS: Implement a filesystem superblock creation/configuration context [ver #8]

2018-06-07 Thread Miklos Szeredi
On Fri, May 25, 2018 at 2:06 AM, David Howells wrote: > Implement a filesystem context concept to be used during superblock > creation for mount and superblock reconfiguration for remount. > > The mounting procedure then becomes: > > (1) Allocate new fs_context context. > > (2) Configure the

Re: [PATCH 10/32] VFS: Implement a filesystem superblock creation/configuration context [ver #8]

2018-06-07 Thread Miklos Szeredi
On Fri, May 25, 2018 at 2:06 AM, David Howells wrote: > Implement a filesystem context concept to be used during superblock > creation for mount and superblock reconfiguration for remount. > > The mounting procedure then becomes: > > (1) Allocate new fs_context context. > > (2) Configure the

[GIT PULL] overlayfs fixes for 4.18

2018-06-06 Thread Miklos Szeredi
: create helper ovl_create_temp() ovl: use inode_insert5() to hash a newly created inode Miklos Szeredi (5): ovl: Kconfig documentation fixes ovl: return dentry from ovl_create_real() ovl: return EIO on internal error ovl: clean up copy-up error paths vfs: factor out

[GIT PULL] overlayfs fixes for 4.18

2018-06-06 Thread Miklos Szeredi
: create helper ovl_create_temp() ovl: use inode_insert5() to hash a newly created inode Miklos Szeredi (5): ovl: Kconfig documentation fixes ovl: return dentry from ovl_create_real() ovl: return EIO on internal error ovl: clean up copy-up error paths vfs: factor out

[GIT PULL] fuse update for 4.18

2018-06-06 Thread Miklos Szeredi
outside of init_user_ns fuse: Ensure posix acls are translated outside of init_user_ns fuse: Allow fully unprivileged mounts Miklos Szeredi (5): fuse: atomic_o_trunc should truncate pagecache fuse: honor AT_STATX_DONT_SYNC fuse: honor AT_STATX_FORCE_SYNC fuse: add

[GIT PULL] fuse update for 4.18

2018-06-06 Thread Miklos Szeredi
outside of init_user_ns fuse: Ensure posix acls are translated outside of init_user_ns fuse: Allow fully unprivileged mounts Miklos Szeredi (5): fuse: atomic_o_trunc should truncate pagecache fuse: honor AT_STATX_DONT_SYNC fuse: honor AT_STATX_FORCE_SYNC fuse: add

Re: [PATCH 06/39] vfs: add f_op->pre_mmap()

2018-06-05 Thread Miklos Szeredi
On Mon, Jun 4, 2018 at 10:48 AM, Christoph Hellwig wrote: > On Tue, May 29, 2018 at 04:43:06PM +0200, Miklos Szeredi wrote: >> This is needed by overlayfs to be able to copy up a file from a read-only >> lower layer to a writable layer when being mapped shared. When copying u

Re: [PATCH 06/39] vfs: add f_op->pre_mmap()

2018-06-05 Thread Miklos Szeredi
On Mon, Jun 4, 2018 at 10:48 AM, Christoph Hellwig wrote: > On Tue, May 29, 2018 at 04:43:06PM +0200, Miklos Szeredi wrote: >> This is needed by overlayfs to be able to copy up a file from a read-only >> lower layer to a writable layer when being mapped shared. When copying u

Re: [PATCH][RFC] open_tree(2) (was Re: [PATCH 30/32] vfs: Allow cloning of a mount tree with open(O_PATH|O_CLONE_MOUNT) [ver #8])

2018-06-04 Thread Miklos Szeredi
On Mon, Jun 4, 2018 at 7:35 PM, Al Viro wrote: > On Mon, Jun 04, 2018 at 10:16:30AM -0700, Matthew Wilcox wrote: >> On Sun, Jun 03, 2018 at 01:55:37AM +0100, Al Viro wrote: >> > +SYSCALL_DEFINE3(open_tree, int, dfd, const char *, filename, unsigned, >> > flags) >> > +{ >> > + struct file

Re: [PATCH][RFC] open_tree(2) (was Re: [PATCH 30/32] vfs: Allow cloning of a mount tree with open(O_PATH|O_CLONE_MOUNT) [ver #8])

2018-06-04 Thread Miklos Szeredi
On Mon, Jun 4, 2018 at 7:35 PM, Al Viro wrote: > On Mon, Jun 04, 2018 at 10:16:30AM -0700, Matthew Wilcox wrote: >> On Sun, Jun 03, 2018 at 01:55:37AM +0100, Al Viro wrote: >> > +SYSCALL_DEFINE3(open_tree, int, dfd, const char *, filename, unsigned, >> > flags) >> > +{ >> > + struct file

Re: [PATCH][RFC] open_tree(2) (was Re: [PATCH 30/32] vfs: Allow cloning of a mount tree with open(O_PATH|O_CLONE_MOUNT) [ver #8])

2018-06-04 Thread Miklos Szeredi
On Mon, Jun 4, 2018 at 5:52 PM, Al Viro wrote: > On Mon, Jun 04, 2018 at 12:34:44PM +0200, Miklos Szeredi wrote: > >> fsopen = create fsfd >> fsmount = fsfd -> mountfd & set attr on mountfd & attach mountfd >> fspick = path -> fsfd >> move_mount = atta

Re: [PATCH][RFC] open_tree(2) (was Re: [PATCH 30/32] vfs: Allow cloning of a mount tree with open(O_PATH|O_CLONE_MOUNT) [ver #8])

2018-06-04 Thread Miklos Szeredi
On Mon, Jun 4, 2018 at 5:52 PM, Al Viro wrote: > On Mon, Jun 04, 2018 at 12:34:44PM +0200, Miklos Szeredi wrote: > >> fsopen = create fsfd >> fsmount = fsfd -> mountfd & set attr on mountfd & attach mountfd >> fspick = path -> fsfd >> move_mount = atta

Re: [PATCH][RFC] open_tree(2) (was Re: [PATCH 30/32] vfs: Allow cloning of a mount tree with open(O_PATH|O_CLONE_MOUNT) [ver #8])

2018-06-04 Thread Miklos Szeredi
On Sun, Jun 3, 2018 at 2:55 AM, Al Viro wrote: > On Sat, Jun 02, 2018 at 06:49:58PM +0100, Al Viro wrote: > >> > > Hell, might even add AT_UMOUNT for "open root and detach, to be >> > > dissolved on >> > > close", incompatible with AT_CLONE. >> > >> > Cute. Guess you could do: >> > >> > fd

Re: [PATCH][RFC] open_tree(2) (was Re: [PATCH 30/32] vfs: Allow cloning of a mount tree with open(O_PATH|O_CLONE_MOUNT) [ver #8])

2018-06-04 Thread Miklos Szeredi
On Sun, Jun 3, 2018 at 2:55 AM, Al Viro wrote: > On Sat, Jun 02, 2018 at 06:49:58PM +0100, Al Viro wrote: > >> > > Hell, might even add AT_UMOUNT for "open root and detach, to be >> > > dissolved on >> > > close", incompatible with AT_CLONE. >> > >> > Cute. Guess you could do: >> > >> > fd

Re: [PATCH 05/39] vfs: optionally don't account file in nr_files

2018-06-04 Thread Miklos Szeredi
On Mon, Jun 4, 2018 at 10:47 AM, Christoph Hellwig wrote: > On Tue, May 29, 2018 at 04:43:05PM +0200, Miklos Szeredi wrote: >> Stacking file operations in overlay will store an extra open file for each >> overlay file opened. >> >> The overhead is just that of &

Re: [PATCH 05/39] vfs: optionally don't account file in nr_files

2018-06-04 Thread Miklos Szeredi
On Mon, Jun 4, 2018 at 10:47 AM, Christoph Hellwig wrote: > On Tue, May 29, 2018 at 04:43:05PM +0200, Miklos Szeredi wrote: >> Stacking file operations in overlay will store an extra open file for each >> overlay file opened. >> >> The overhead is just that of &

Re: [GIT PULL] overlayfs update for 4.18

2018-06-01 Thread Miklos Szeredi
On Fri, Jun 1, 2018 at 6:18 PM, Randy Dunlap wrote: > On 06/01/2018 08:26 AM, Miklos Szeredi wrote: >> On Tue, May 29, 2018 at 03:21:48PM +0200, Miklos Szeredi wrote: >>> Hi Al, >>> >>> I'm sending this pull request to you instead of Linus, because a bigger t

Re: [GIT PULL] overlayfs update for 4.18

2018-06-01 Thread Miklos Szeredi
On Fri, Jun 1, 2018 at 6:18 PM, Randy Dunlap wrote: > On 06/01/2018 08:26 AM, Miklos Szeredi wrote: >> On Tue, May 29, 2018 at 03:21:48PM +0200, Miklos Szeredi wrote: >>> Hi Al, >>> >>> I'm sending this pull request to you instead of Linus, because a bigger t

Re: [GIT PULL] overlayfs update for 4.18

2018-06-01 Thread Miklos Szeredi
On Tue, May 29, 2018 at 03:21:48PM +0200, Miklos Szeredi wrote: > Hi Al, > > I'm sending this pull request to you instead of Linus, because a bigger than > usual chunk involves the VFS. > > Please pull from: > > git://git.kernel.org/pub/scm/linux/kernel/git/m

Re: [GIT PULL] overlayfs update for 4.18

2018-06-01 Thread Miklos Szeredi
On Tue, May 29, 2018 at 03:21:48PM +0200, Miklos Szeredi wrote: > Hi Al, > > I'm sending this pull request to you instead of Linus, because a bigger than > usual chunk involves the VFS. > > Please pull from: > > git://git.kernel.org/pub/scm/linux/kernel/git/m

Re: [PATCH] fuse: fix NULL dereference when new_inode() fails

2018-06-01 Thread Miklos Szeredi
On Fri, Jun 1, 2018 at 11:24 AM, Stefan Hajnoczi wrote: > Ping? > > Archive link in case I broke email threading: > https://marc.info/?l=linux-fsdevel=152719324102009=2 Thanks for the patch. Should already be fixed in: git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git for-next

Re: [PATCH] fuse: fix NULL dereference when new_inode() fails

2018-06-01 Thread Miklos Szeredi
On Fri, Jun 1, 2018 at 11:24 AM, Stefan Hajnoczi wrote: > Ping? > > Archive link in case I broke email threading: > https://marc.info/?l=linux-fsdevel=152719324102009=2 Thanks for the patch. Should already be fixed in: git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git for-next

Re: [PATCH] fuse: Allow fully unprivileged mounts

2018-05-31 Thread Miklos Szeredi
On Tue, May 29, 2018 at 4:04 PM, Eric W. Biederman wrote: > > Now that the fuse and the vfs work is complete. Allow the fuse filesystem > to be mounted by the root user in a user namespace. Thanks, pushed to for-next branch of the fuse tree toghether with the xattr fix. Miklos

Re: [PATCH] fuse: Allow fully unprivileged mounts

2018-05-31 Thread Miklos Szeredi
On Tue, May 29, 2018 at 4:04 PM, Eric W. Biederman wrote: > > Now that the fuse and the vfs work is complete. Allow the fuse filesystem > to be mounted by the root user in a user namespace. Thanks, pushed to for-next branch of the fuse tree toghether with the xattr fix. Miklos

Re: general protection fault in fuse_ctl_remove_conn

2018-05-31 Thread Miklos Szeredi
On Sat, Apr 28, 2018 at 4:29 AM, Tetsuo Handa wrote: > From 9f41081f8bd6762a6f629e5e23e6d07a62bba69c Mon Sep 17 00:00:00 2001 > From: Tetsuo Handa > Date: Sat, 28 Apr 2018 11:24:09 +0900 > Subject: [PATCH] fuse: don't keep inode-less dentry at fuse_ctl_add_dentry(). > > syzbot is reporting NULL

Re: general protection fault in fuse_ctl_remove_conn

2018-05-31 Thread Miklos Szeredi
On Sat, Apr 28, 2018 at 4:29 AM, Tetsuo Handa wrote: > From 9f41081f8bd6762a6f629e5e23e6d07a62bba69c Mon Sep 17 00:00:00 2001 > From: Tetsuo Handa > Date: Sat, 28 Apr 2018 11:24:09 +0900 > Subject: [PATCH] fuse: don't keep inode-less dentry at fuse_ctl_add_dentry(). > > syzbot is reporting NULL

Re: [PATCH 15/28] ovl: Open file with data except for the case of fsync

2018-05-30 Thread Miklos Szeredi
On Wed, May 30, 2018 at 4:30 PM, Vivek Goyal wrote: > On Tue, May 29, 2018 at 04:45:59PM +0200, Miklos Szeredi wrote: >> From: Vivek Goyal >> >> ovl_open() should open file which contains data and not open metacopy >> inode. With the introduction of me

Re: [PATCH 15/28] ovl: Open file with data except for the case of fsync

2018-05-30 Thread Miklos Szeredi
On Wed, May 30, 2018 at 4:30 PM, Vivek Goyal wrote: > On Tue, May 29, 2018 at 04:45:59PM +0200, Miklos Szeredi wrote: >> From: Vivek Goyal >> >> ovl_open() should open file which contains data and not open metacopy >> inode. With the introduction of me

Re: [PATCH 2/2] FUSE: fix congested state leak on aborted connections

2018-05-30 Thread Miklos Szeredi
gt;sb). >> >> Drop fc->connected conditional to avoid leaking congestion states. >> >> Signed-off-by: Tejun Heo >> Reported-by: Joshua Miller >> Cc: Johannes Weiner >> Cc: Miklos Szeredi >> Cc: Jan Kara >> Cc: sta...@vger.kernel.org > > Y

Re: [PATCH 2/2] FUSE: fix congested state leak on aborted connections

2018-05-30 Thread Miklos Szeredi
gt;sb). >> >> Drop fc->connected conditional to avoid leaking congestion states. >> >> Signed-off-by: Tejun Heo >> Reported-by: Joshua Miller >> Cc: Johannes Weiner >> Cc: Miklos Szeredi >> Cc: Jan Kara >> Cc: sta...@vger.kernel.org > > Y

Re: [GIT PULL] overlayfs update for 4.18

2018-05-30 Thread Miklos Szeredi
On Tue, May 29, 2018 at 4:12 PM, Miklos Szeredi wrote: > On Tue, May 29, 2018 at 3:59 PM, Christoph Hellwig wrote: >>> vfs: export vfs_dedupe_file_range_one() to modules >> >> Please use EXPORT_SYMBOL_GPL for all these crazy low-level exports. I'd arg

Re: [GIT PULL] overlayfs update for 4.18

2018-05-30 Thread Miklos Szeredi
On Tue, May 29, 2018 at 4:12 PM, Miklos Szeredi wrote: > On Tue, May 29, 2018 at 3:59 PM, Christoph Hellwig wrote: >>> vfs: export vfs_dedupe_file_range_one() to modules >> >> Please use EXPORT_SYMBOL_GPL for all these crazy low-level exports. I'd arg

Re: [PATCH 05/11] ovl: return dentry from ovl_create_real()

2018-05-30 Thread Miklos Szeredi
On Tue, May 29, 2018 at 5:24 PM, Amir Goldstein wrote: > On Tue, May 29, 2018 at 5:41 PM, Miklos Szeredi wrote: >> From: Amir Goldstein >> >> Al Viro suggested to simplify callers of ovl_create_real() by >> returning the created dentry (or ERR_PTR) from ovl_create

Re: [PATCH 05/11] ovl: return dentry from ovl_create_real()

2018-05-30 Thread Miklos Szeredi
On Tue, May 29, 2018 at 5:24 PM, Amir Goldstein wrote: > On Tue, May 29, 2018 at 5:41 PM, Miklos Szeredi wrote: >> From: Amir Goldstein >> >> Al Viro suggested to simplify callers of ovl_create_real() by >> returning the created dentry (or ERR_PTR) from ovl_create

Re: [PATCH 03/28] ovl: Provide a mount option metacopy=on/off for metadata copyup

2018-05-30 Thread Miklos Szeredi
On Tue, May 29, 2018 at 10:44 PM, Randy Dunlap wrote: > On 05/29/2018 07:45 AM, Miklos Szeredi wrote: >> + If this config option is enabled then overlay filesystems will >> + copy up only metadata where appropriate and data copy up will >> + happen w

Re: [PATCH 03/28] ovl: Provide a mount option metacopy=on/off for metadata copyup

2018-05-30 Thread Miklos Szeredi
On Tue, May 29, 2018 at 10:44 PM, Randy Dunlap wrote: > On 05/29/2018 07:45 AM, Miklos Szeredi wrote: >> + If this config option is enabled then overlay filesystems will >> + copy up only metadata where appropriate and data copy up will >> + happen w

Re: [PATCH 27/39] ovl: obsolete "check_copy_up" module option

2018-05-30 Thread Miklos Szeredi
On Tue, May 29, 2018 at 5:13 PM, Amir Goldstein wrote: > On Tue, May 29, 2018 at 5:43 PM, Miklos Szeredi wrote: >> + WARN(1, "overlayfs: \"check_copy_up\" module option is obsolete\n"); > > I was under the impression that user controlled input should

Re: [PATCH 27/39] ovl: obsolete "check_copy_up" module option

2018-05-30 Thread Miklos Szeredi
On Tue, May 29, 2018 at 5:13 PM, Amir Goldstein wrote: > On Tue, May 29, 2018 at 5:43 PM, Miklos Szeredi wrote: >> + WARN(1, "overlayfs: \"check_copy_up\" module option is obsolete\n"); > > I was under the impression that user controlled input should

Re: [PATCH 07/11] ovl: make ovl_create_real() cope with vfs_mkdir() safely

2018-05-30 Thread Miklos Szeredi
On Tue, May 29, 2018 at 5:29 PM, Amir Goldstein wrote: > On Tue, May 29, 2018 at 5:41 PM, Miklos Szeredi wrote: >> From: Amir Goldstein >> >> vfs_mkdir() may succeed and leave the dentry passed to it unhashed and >> negative. ovl_create_real() is the last caller br

Re: [PATCH 07/11] ovl: make ovl_create_real() cope with vfs_mkdir() safely

2018-05-30 Thread Miklos Szeredi
On Tue, May 29, 2018 at 5:29 PM, Amir Goldstein wrote: > On Tue, May 29, 2018 at 5:41 PM, Miklos Szeredi wrote: >> From: Amir Goldstein >> >> vfs_mkdir() may succeed and leave the dentry passed to it unhashed and >> negative. ovl_create_real() is the last caller br

[PATCH 03/11] ovl: strip debug argument from ovl_do_ helpers

2018-05-29 Thread Miklos Szeredi
From: Amir Goldstein It did not prove to be useful. Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 9 - fs/overlayfs/dir.c | 20 ++-- fs/overlayfs/overlayfs.h | 42 ++ fs

[PATCH 01/11] ovl: update documentation for unionmount-testsuite

2018-05-29 Thread Miklos Szeredi
-by: Miklos Szeredi --- Documentation/filesystems/overlayfs.txt | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/filesystems/overlayfs.txt b/Documentation/filesystems/overlayfs.txt index 961b287ef323..72615a2c0752 100644 --- a/Documentation/filesystems/overlayfs.txt

[PATCH 05/11] ovl: return dentry from ovl_create_real()

2018-05-29 Thread Miklos Szeredi
, so now all callers of ovl_do_mkdir() are routed through ovl_create_real(), which paves the way for Al's fix for non-hashed result from vfs_mkdir(). Suggested-by: Al Viro Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 15 fs/overlayfs

[PATCH 04/11] ovl: struct cattr cleanups

2018-05-29 Thread Miklos Szeredi
From: Amir Goldstein * Rename to ovl_cattr * Fold ovl_create_real() hardlink argument into struct ovl_cattr * Create macro OVL_CATTR() to initialize struct ovl_cattr from mode Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 5 ++--- fs/overlayfs

[PATCH 03/11] ovl: strip debug argument from ovl_do_ helpers

2018-05-29 Thread Miklos Szeredi
From: Amir Goldstein It did not prove to be useful. Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 9 - fs/overlayfs/dir.c | 20 ++-- fs/overlayfs/overlayfs.h | 42 ++ fs

[PATCH 01/11] ovl: update documentation for unionmount-testsuite

2018-05-29 Thread Miklos Szeredi
-by: Miklos Szeredi --- Documentation/filesystems/overlayfs.txt | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/filesystems/overlayfs.txt b/Documentation/filesystems/overlayfs.txt index 961b287ef323..72615a2c0752 100644 --- a/Documentation/filesystems/overlayfs.txt

[PATCH 05/11] ovl: return dentry from ovl_create_real()

2018-05-29 Thread Miklos Szeredi
, so now all callers of ovl_do_mkdir() are routed through ovl_create_real(), which paves the way for Al's fix for non-hashed result from vfs_mkdir(). Suggested-by: Al Viro Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 15 fs/overlayfs

[PATCH 04/11] ovl: struct cattr cleanups

2018-05-29 Thread Miklos Szeredi
From: Amir Goldstein * Rename to ovl_cattr * Fold ovl_create_real() hardlink argument into struct ovl_cattr * Create macro OVL_CATTR() to initialize struct ovl_cattr from mode Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 5 ++--- fs/overlayfs

[PATCH 09/11] vfs: factor out inode_insert5()

2018-05-29 Thread Miklos Szeredi
From: Miklos Szeredi Split out common helper for race free insertion of an already allocated inode into the cache. Use this from iget5_locked() and insert_inode_locked4(). Make iget5_locked() use new_inode()/iput() instead of alloc_inode()/destroy_inode() directly. Also export to modules

[PATCH 09/11] vfs: factor out inode_insert5()

2018-05-29 Thread Miklos Szeredi
From: Miklos Szeredi Split out common helper for race free insertion of an already allocated inode into the cache. Use this from iget5_locked() and insert_inode_locked4(). Make iget5_locked() use new_inode()/iput() instead of alloc_inode()/destroy_inode() directly. Also export to modules

[PATCH 03/39] vfs: dedupe: extract helper for a single dedup

2018-05-29 Thread Miklos Szeredi
Extract vfs_dedupe_file_range_one() helper to deal with a single dedup request. Signed-off-by: Miklos Szeredi --- fs/read_write.c | 89 +++-- 1 file changed, 49 insertions(+), 40 deletions(-) diff --git a/fs/read_write.c b/fs/read_write.c

[PATCH 02/39] vfs: dedupe: rationalize args

2018-05-29 Thread Miklos Szeredi
Clean up f_op->dedupe_file_range() interface. 1) Use loff_t for offsets and length instead of u64 2) Order the arguments the same way as {copy|clone}_file_range(). Signed-off-by: Miklos Szeredi --- fs/btrfs/ctree.h | 5 +++-- fs/btrfs/ioctl.c | 5 +++-- fs/ocfs2/file.c| 6 +++---

[PATCH 04/39] vfs: add path_open()

2018-05-29 Thread Miklos Szeredi
inode to open is given as a separate argument. This is in preparation for stacking I/O operations on overlay files. Later, when implicit opening is removed, dentry_open() can be implemented by just calling path_open(). Signed-off-by: Miklos Szeredi --- fs/open.c | 31

[PATCH 02/39] vfs: dedupe: rationalize args

2018-05-29 Thread Miklos Szeredi
Clean up f_op->dedupe_file_range() interface. 1) Use loff_t for offsets and length instead of u64 2) Order the arguments the same way as {copy|clone}_file_range(). Signed-off-by: Miklos Szeredi --- fs/btrfs/ctree.h | 5 +++-- fs/btrfs/ioctl.c | 5 +++-- fs/ocfs2/file.c| 6 +++---

[PATCH 04/39] vfs: add path_open()

2018-05-29 Thread Miklos Szeredi
inode to open is given as a separate argument. This is in preparation for stacking I/O operations on overlay files. Later, when implicit opening is removed, dentry_open() can be implemented by just calling path_open(). Signed-off-by: Miklos Szeredi --- fs/open.c | 31

[PATCH 03/39] vfs: dedupe: extract helper for a single dedup

2018-05-29 Thread Miklos Szeredi
Extract vfs_dedupe_file_range_one() helper to deal with a single dedup request. Signed-off-by: Miklos Szeredi --- fs/read_write.c | 89 +++-- 1 file changed, 49 insertions(+), 40 deletions(-) diff --git a/fs/read_write.c b/fs/read_write.c

[PATCH 00/39] overlayfs: stack file operations

2018-05-29 Thread Miklos Szeredi
tsuite, pjd-fstest). Performance impact of stacking was found to be minimal. Memory use for open overlay files increases by about 256bytes or 12%. Git tree is here: git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git overlayfs-rorw --- Miklos Szeredi (39): vfs: dedpue: return

[PATCH 00/39] overlayfs: stack file operations

2018-05-29 Thread Miklos Szeredi
tsuite, pjd-fstest). Performance impact of stacking was found to be minimal. Memory use for open overlay files increases by about 256bytes or 12%. Git tree is here: git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git overlayfs-rorw --- Miklos Szeredi (39): vfs: dedpue: return

[PATCH 05/39] vfs: optionally don't account file in nr_files

2018-05-29 Thread Miklos Szeredi
the count is not decremented. Signed-off-by: Miklos Szeredi --- fs/file_table.c| 13 + fs/internal.h | 7 ++- fs/open.c | 10 +- include/linux/fs.h | 5 - 4 files changed, 24 insertions(+), 11 deletions(-) diff --git a/fs/file_table.c b/fs/file_tab

[PATCH 05/39] vfs: optionally don't account file in nr_files

2018-05-29 Thread Miklos Szeredi
the count is not decremented. Signed-off-by: Miklos Szeredi --- fs/file_table.c| 13 + fs/internal.h | 7 ++- fs/open.c | 10 +- include/linux/fs.h | 5 - 4 files changed, 24 insertions(+), 11 deletions(-) diff --git a/fs/file_table.c b/fs/file_tab

[PATCH 06/39] vfs: add f_op->pre_mmap()

2018-05-29 Thread Miklos Szeredi
ore taking mmap_sem. Signed-off-by: Miklos Szeredi --- Documentation/filesystems/Locking | 1 + Documentation/filesystems/vfs.txt | 3 +++ include/linux/fs.h| 1 + mm/util.c | 5 + 4 files changed, 10 insertions(+) diff --git a/Documentation/filesyst

[PATCH 06/39] vfs: add f_op->pre_mmap()

2018-05-29 Thread Miklos Szeredi
ore taking mmap_sem. Signed-off-by: Miklos Szeredi --- Documentation/filesystems/Locking | 1 + Documentation/filesystems/vfs.txt | 3 +++ include/linux/fs.h| 1 + mm/util.c | 5 + 4 files changed, 10 insertions(+) diff --git a/Documentation/filesyst

[PATCH 07/39] vfs: export vfs_ioctl() to modules

2018-05-29 Thread Miklos Szeredi
This is needed by the stacked ioctl implementation in overlayfs. Signed-off-by: Miklos Szeredi --- fs/internal.h | 1 - fs/ioctl.c | 1 + include/linux/fs.h | 2 ++ 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/internal.h b/fs/internal.h index b82725ba3054

[PATCH 07/39] vfs: export vfs_ioctl() to modules

2018-05-29 Thread Miklos Szeredi
This is needed by the stacked ioctl implementation in overlayfs. Signed-off-by: Miklos Szeredi --- fs/internal.h | 1 - fs/ioctl.c | 1 + include/linux/fs.h | 2 ++ 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/internal.h b/fs/internal.h index b82725ba3054

[PATCH 13/39] ovl: deal with overlay files in ovl_d_real()

2018-05-29 Thread Miklos Szeredi
Signed-off-by: Miklos Szeredi --- fs/overlayfs/super.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index 704b37311467..211975921a90 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -97,6 +97,10 @@ static struct dentry

[PATCH 12/39] ovl: copy up file size as well

2018-05-29 Thread Miklos Szeredi
Copy i_size of the underlying inode to the overlay inode in ovl_copyattr(). This is in preparation for stacking I/O operations on overlay files. This patch shouldn't have any observable effect. Remove stale comment from ovl_setattr() [spotted by Vivek Goyal]. Signed-off-by: Miklos Szeredi

[PATCH 13/39] ovl: deal with overlay files in ovl_d_real()

2018-05-29 Thread Miklos Szeredi
Signed-off-by: Miklos Szeredi --- fs/overlayfs/super.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index 704b37311467..211975921a90 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -97,6 +97,10 @@ static struct dentry

[PATCH 12/39] ovl: copy up file size as well

2018-05-29 Thread Miklos Szeredi
Copy i_size of the underlying inode to the overlay inode in ovl_copyattr(). This is in preparation for stacking I/O operations on overlay files. This patch shouldn't have any observable effect. Remove stale comment from ovl_setattr() [spotted by Vivek Goyal]. Signed-off-by: Miklos Szeredi

[PATCH 17/39] ovl: add ovl_write_iter()

2018-05-29 Thread Miklos Szeredi
Implement stacked writes. Signed-off-by: Miklos Szeredi --- fs/overlayfs/file.c | 39 +++ 1 file changed, 39 insertions(+) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index bbc40a14acf8..a7af56861aa5 100644 --- a/fs/overlayfs/file.c +++ b/fs

[PATCH 17/39] ovl: add ovl_write_iter()

2018-05-29 Thread Miklos Szeredi
Implement stacked writes. Signed-off-by: Miklos Szeredi --- fs/overlayfs/file.c | 39 +++ 1 file changed, 39 insertions(+) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index bbc40a14acf8..a7af56861aa5 100644 --- a/fs/overlayfs/file.c +++ b/fs

[PATCH 16/39] ovl: add ovl_read_iter()

2018-05-29 Thread Miklos Szeredi
Implement stacked reading. Signed-off-by: Miklos Szeredi --- fs/overlayfs/file.c | 67 + 1 file changed, 67 insertions(+) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index db8778e7c37a..bbc40a14acf8 100644 --- a/fs/overlayfs/file.c

[PATCH 16/39] ovl: add ovl_read_iter()

2018-05-29 Thread Miklos Szeredi
Implement stacked reading. Signed-off-by: Miklos Szeredi --- fs/overlayfs/file.c | 67 + 1 file changed, 67 insertions(+) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index db8778e7c37a..bbc40a14acf8 100644 --- a/fs/overlayfs/file.c

[PATCH 14/39] ovl: stack file ops

2018-05-29 Thread Miklos Szeredi
tes for the struct file) since the real inode and dentry are pinned by overlayfs anyway. This patch doesn't have any effect, since the vfs will use d_real() to find the real underlying file to open. The patch at the end of the series will actually enable this functionality. Signed-off-by: Miklos Szer

[PATCH 15/39] ovl: add helper to return real file

2018-05-29 Thread Miklos Szeredi
nce overlayfs has been doing most fine without correctly handling this case at all), then we can deal with that by updating the cached real file. 2) File's f_flags have changed since open: no need to reopen the cached real file, we can just change the flags there as well. Signed-off-by: Miklos Szer

[PATCH 14/39] ovl: stack file ops

2018-05-29 Thread Miklos Szeredi
tes for the struct file) since the real inode and dentry are pinned by overlayfs anyway. This patch doesn't have any effect, since the vfs will use d_real() to find the real underlying file to open. The patch at the end of the series will actually enable this functionality. Signed-off-by: Miklos Szer

[PATCH 15/39] ovl: add helper to return real file

2018-05-29 Thread Miklos Szeredi
nce overlayfs has been doing most fine without correctly handling this case at all), then we can deal with that by updating the cached real file. 2) File's f_flags have changed since open: no need to reopen the cached real file, we can just change the flags there as well. Signed-off-by: Miklos Szer

[PATCH 18/39] ovl: add ovl_fsync()

2018-05-29 Thread Miklos Szeredi
Implement stacked fsync(). Don't sync if lower (noticed by Amir Goldstein). Signed-off-by: Miklos Szeredi --- fs/overlayfs/file.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index a7af56861aa5..7b47dce4b072 100644

[PATCH 18/39] ovl: add ovl_fsync()

2018-05-29 Thread Miklos Szeredi
Implement stacked fsync(). Don't sync if lower (noticed by Amir Goldstein). Signed-off-by: Miklos Szeredi --- fs/overlayfs/file.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index a7af56861aa5..7b47dce4b072 100644

[PATCH 11/39] Revert "Revert "ovl: get_write_access() in truncate""

2018-05-29 Thread Miklos Szeredi
overlay functionality out of the VFS. Signed-off-by: Miklos Szeredi --- fs/overlayfs/inode.c | 21 + 1 file changed, 21 insertions(+) diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index 24fc27683a57..0116ec12451d 100644 --- a/fs/overlayfs/inode.c +++ b/fs

[PATCH 11/39] Revert "Revert "ovl: get_write_access() in truncate""

2018-05-29 Thread Miklos Szeredi
overlay functionality out of the VFS. Signed-off-by: Miklos Szeredi --- fs/overlayfs/inode.c | 21 + 1 file changed, 21 insertions(+) diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index 24fc27683a57..0116ec12451d 100644 --- a/fs/overlayfs/inode.c +++ b/fs

[PATCH 19/39] ovl: add ovl_mmap()

2018-05-29 Thread Miklos Szeredi
Implement stacked mmap. Signed-off-by: Miklos Szeredi --- fs/overlayfs/file.c | 28 1 file changed, 28 insertions(+) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index 7b47dce4b072..4057bbf2e141 100644 --- a/fs/overlayfs/file.c +++ b/fs/overlayfs/file.c

[PATCH 19/39] ovl: add ovl_mmap()

2018-05-29 Thread Miklos Szeredi
Implement stacked mmap. Signed-off-by: Miklos Szeredi --- fs/overlayfs/file.c | 28 1 file changed, 28 insertions(+) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index 7b47dce4b072..4057bbf2e141 100644 --- a/fs/overlayfs/file.c +++ b/fs/overlayfs/file.c

[PATCH 20/39] ovl: add ovl_fallocate()

2018-05-29 Thread Miklos Szeredi
Implement stacked fallocate. Signed-off-by: Miklos Szeredi --- fs/overlayfs/file.c | 24 1 file changed, 24 insertions(+) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index 4057bbf2e141..069599d53511 100644 --- a/fs/overlayfs/file.c +++ b/fs/overlayfs/file.c

<    3   4   5   6   7   8   9   10   11   12   >