[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

[PATCH 22/39] ovl: add ovl_fiemap()

2018-05-29 Thread Miklos Szeredi
Implement stacked fiemap(). Need to split inode operations for regular file (which has fiemap) and special file (which doesn't have fiemap). Signed-off-by: Miklos Szeredi --- fs/overlayfs/inode.c | 29 - 1 file changed, 28 insertions(+), 1 deletion(-) diff --git

[PATCH 21/39] ovl: add lsattr/chattr support

2018-05-29 Thread Miklos Szeredi
Implement FS_IOC_GETFLAGS and FS_IOC_SETFLAGS. Signed-off-by: Miklos Szeredi --- fs/overlayfs/file.c | 79 + 1 file changed, 79 insertions(+) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index 069599d53511..3f610a5b38e4 100644

[PATCH 10/39] ovl: copy up inode flags

2018-05-29 Thread Miklos Szeredi
On inode creation copy certain inode flags from the underlying real inode to the overlay inode. This is in preparation for moving overlay functionality out of the VFS. Signed-off-by: Miklos Szeredi --- fs/overlayfs/overlayfs.h | 7 +++ fs/overlayfs/util.c | 1 + 2 files changed, 8

[PATCH 21/39] ovl: add lsattr/chattr support

2018-05-29 Thread Miklos Szeredi
Implement FS_IOC_GETFLAGS and FS_IOC_SETFLAGS. Signed-off-by: Miklos Szeredi --- fs/overlayfs/file.c | 79 + 1 file changed, 79 insertions(+) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index 069599d53511..3f610a5b38e4 100644

[PATCH 10/39] ovl: copy up inode flags

2018-05-29 Thread Miklos Szeredi
On inode creation copy certain inode flags from the underlying real inode to the overlay inode. This is in preparation for moving overlay functionality out of the VFS. Signed-off-by: Miklos Szeredi --- fs/overlayfs/overlayfs.h | 7 +++ fs/overlayfs/util.c | 1 + 2 files changed, 8

[PATCH 22/39] ovl: add ovl_fiemap()

2018-05-29 Thread Miklos Szeredi
Implement stacked fiemap(). Need to split inode operations for regular file (which has fiemap) and special file (which doesn't have fiemap). Signed-off-by: Miklos Szeredi --- fs/overlayfs/inode.c | 29 - 1 file changed, 28 insertions(+), 1 deletion(-) diff --git

[PATCH 32/39] vfs: fix freeze protection in mnt_want_write_file() for overlayfs

2018-05-29 Thread Miklos Szeredi
th.mnt->mnt_sb. Reported-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/namespace.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/namespace.c b/fs/namespace.c index 5286c5313e67..0d9023a9af4f 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -441,10 +441,

[PATCH 33/39] Revert "ovl: fix relatime for directories"

2018-05-29 Thread Miklos Szeredi
This reverts commit cd91304e7190b4c4802f8e413ab2214b233e0260. Overlayfs no longer relies on the vfs correct atime handling. Signed-off-by: Miklos Szeredi --- fs/inode.c | 21 - fs/overlayfs/super.c | 3 --- include/linux/dcache.h | 3 --- 3 files changed, 4

[PATCH 34/39] Revert "vfs: update ovl inode before relatime check"

2018-05-29 Thread Miklos Szeredi
This reverts commit 598e3c8f72f5b77c84d2cb26cfd936ffb3cfdbaa. Overlayfs no longer relies on the vfs correct atime handling. Signed-off-by: Miklos Szeredi --- fs/inode.c | 33 ++--- fs/internal.h | 7 --- fs/namei.c | 2 +- include/linux

[PATCH 31/39] Revert "ovl: don't allow writing ioctl on lower layer"

2018-05-29 Thread Miklos Szeredi
This reverts commit 7c6893e3c9abf6a9676e060a1e35e5caca673d57. Overlayfs no longer relies on the vfs for checking writability of files. Signed-off-by: Miklos Szeredi --- fs/internal.h | 2 -- fs/namespace.c | 64 +++--- fs/open.c | 4

[PATCH 32/39] vfs: fix freeze protection in mnt_want_write_file() for overlayfs

2018-05-29 Thread Miklos Szeredi
th.mnt->mnt_sb. Reported-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/namespace.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/namespace.c b/fs/namespace.c index 5286c5313e67..0d9023a9af4f 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -441,10 +441,

[PATCH 33/39] Revert "ovl: fix relatime for directories"

2018-05-29 Thread Miklos Szeredi
This reverts commit cd91304e7190b4c4802f8e413ab2214b233e0260. Overlayfs no longer relies on the vfs correct atime handling. Signed-off-by: Miklos Szeredi --- fs/inode.c | 21 - fs/overlayfs/super.c | 3 --- include/linux/dcache.h | 3 --- 3 files changed, 4

[PATCH 34/39] Revert "vfs: update ovl inode before relatime check"

2018-05-29 Thread Miklos Szeredi
This reverts commit 598e3c8f72f5b77c84d2cb26cfd936ffb3cfdbaa. Overlayfs no longer relies on the vfs correct atime handling. Signed-off-by: Miklos Szeredi --- fs/inode.c | 33 ++--- fs/internal.h | 7 --- fs/namei.c | 2 +- include/linux

[PATCH 31/39] Revert "ovl: don't allow writing ioctl on lower layer"

2018-05-29 Thread Miklos Szeredi
This reverts commit 7c6893e3c9abf6a9676e060a1e35e5caca673d57. Overlayfs no longer relies on the vfs for checking writability of files. Signed-off-by: Miklos Szeredi --- fs/internal.h | 2 -- fs/namespace.c | 64 +++--- fs/open.c | 4

[PATCH 25/39] vfs: don't open real

2018-05-29 Thread Miklos Szeredi
-off-by: Miklos Szeredi --- fs/open.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/fs/open.c b/fs/open.c index 6e52fd6fea7c..244cd2ecfefd 100644 --- a/fs/open.c +++ b/fs/open.c @@ -897,13 +897,8 @@ EXPORT_SYMBOL(file_path); int vfs_open(const struct path *path, struct

[PATCH 25/39] vfs: don't open real

2018-05-29 Thread Miklos Szeredi
-off-by: Miklos Szeredi --- fs/open.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/fs/open.c b/fs/open.c index 6e52fd6fea7c..244cd2ecfefd 100644 --- a/fs/open.c +++ b/fs/open.c @@ -897,13 +897,8 @@ EXPORT_SYMBOL(file_path); int vfs_open(const struct path *path, struct

[PATCH 35/39] Revert "vfs: add flags to d_real()"

2018-05-29 Thread Miklos Szeredi
This reverts commit 495e642939114478a5237a7d91661ba93b76f15a. No user of "flags" argument of d_real() remain. Signed-off-by: Miklos Szeredi --- Documentation/filesystems/Locking | 2 +- Documentation/filesystems/vfs.txt | 2 +- fs/open.c | 2 +- fs/overlay

[PATCH 35/39] Revert "vfs: add flags to d_real()"

2018-05-29 Thread Miklos Szeredi
This reverts commit 495e642939114478a5237a7d91661ba93b76f15a. No user of "flags" argument of d_real() remain. Signed-off-by: Miklos Szeredi --- Documentation/filesystems/Locking | 2 +- Documentation/filesystems/vfs.txt | 2 +- fs/open.c | 2 +- fs/overlay

[PATCH 24/39] ovl: add reflink/copyfile/dedup support

2018-05-29 Thread Miklos Szeredi
Since set of arguments are so similar, handle in a common helper. Signed-off-by: Miklos Szeredi --- fs/overlayfs/file.c | 88 + 1 file changed, 88 insertions(+) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index e5e7ccaaf9ec

[PATCH 24/39] ovl: add reflink/copyfile/dedup support

2018-05-29 Thread Miklos Szeredi
Since set of arguments are so similar, handle in a common helper. Signed-off-by: Miklos Szeredi --- fs/overlayfs/file.c | 88 + 1 file changed, 88 insertions(+) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index e5e7ccaaf9ec

[PATCH 39/39] vfs: remove open_flags from d_real()

2018-05-29 Thread Miklos Szeredi
Opening regular files on overlayfs is now handled via ovl_open(). Remove the now unused "open_flags" argument from d_op->d_real() and the d_real() helper. Signed-off-by: Miklos Szeredi --- Documentation/filesystems/Locking | 3 +-- Documentation/filesystems/vfs.txt | 16 ---

[PATCH 39/39] vfs: remove open_flags from d_real()

2018-05-29 Thread Miklos Szeredi
Opening regular files on overlayfs is now handled via ovl_open(). Remove the now unused "open_flags" argument from d_op->d_real() and the d_real() helper. Signed-off-by: Miklos Szeredi --- Documentation/filesystems/Locking | 3 +-- Documentation/filesystems/vfs.txt | 16 ---

[PATCH 38/39] Revert "fsnotify: support overlayfs"

2018-05-29 Thread Miklos Szeredi
This reverts commit f3fbbb079263bd29ae592478de6808db7e708267. Overlayfs now works correctly without adding hacks to fsnotify. Signed-off-by: Miklos Szeredi --- include/linux/fsnotify.h | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/include/linux/fsnotify.h b

[PATCH 38/39] Revert "fsnotify: support overlayfs"

2018-05-29 Thread Miklos Szeredi
This reverts commit f3fbbb079263bd29ae592478de6808db7e708267. Overlayfs now works correctly without adding hacks to fsnotify. Signed-off-by: Miklos Szeredi --- include/linux/fsnotify.h | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/include/linux/fsnotify.h b

[PATCH 37/39] Partially revert "locks: fix file locking on overlayfs"

2018-05-29 Thread Miklos Szeredi
could revert those as well, but it would be unnecessary code churn and it makes sense to document that we are getting the inode for locking purposes. Signed-off-by: Miklos Szeredi Acked-by: Jeff Layton --- fs/locks.c | 17 ++--- fs/overlayfs/super.c| 2 +- include

[PATCH 30/39] Revert "ovl: fix may_write_real() for overlayfs directories"

2018-05-29 Thread Miklos Szeredi
This reverts commit 954c736f865d6c0c68ae4263a2f3502ee7c447a3. Overlayfs no longer relies on the vfs for checking writability of files. Signed-off-by: Miklos Szeredi --- fs/namespace.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/namespace.c b/fs/namespace.c index

[PATCH 36/39] Revert "vfs: do get_write_access() on upper layer of overlayfs"

2018-05-29 Thread Miklos Szeredi
This reverts commit 4d0c5ba2ff79ef9f5188998b29fd28fcb05f3667. We now get write access on both overlay and underlying layers so this patch is no longer needed for correct operation. Signed-off-by: Miklos Szeredi --- fs/locks.c | 3 +-- fs/open.c | 15 ++- 2 files changed, 3

[PATCH 37/39] Partially revert "locks: fix file locking on overlayfs"

2018-05-29 Thread Miklos Szeredi
could revert those as well, but it would be unnecessary code churn and it makes sense to document that we are getting the inode for locking purposes. Signed-off-by: Miklos Szeredi Acked-by: Jeff Layton --- fs/locks.c | 17 ++--- fs/overlayfs/super.c| 2 +- include

[PATCH 30/39] Revert "ovl: fix may_write_real() for overlayfs directories"

2018-05-29 Thread Miklos Szeredi
This reverts commit 954c736f865d6c0c68ae4263a2f3502ee7c447a3. Overlayfs no longer relies on the vfs for checking writability of files. Signed-off-by: Miklos Szeredi --- fs/namespace.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/namespace.c b/fs/namespace.c index

[PATCH 36/39] Revert "vfs: do get_write_access() on upper layer of overlayfs"

2018-05-29 Thread Miklos Szeredi
This reverts commit 4d0c5ba2ff79ef9f5188998b29fd28fcb05f3667. We now get write access on both overlay and underlying layers so this patch is no longer needed for correct operation. Signed-off-by: Miklos Szeredi --- fs/locks.c | 3 +-- fs/open.c | 15 ++- 2 files changed, 3

[PATCH 00/28] overlayfs: Delayed copy up of data

2018-05-29 Thread Miklos Szeredi
In one of the recent converstions, people mentioned that chown/chmod lead to copy up files as well as data. We could optimize it so that only metadata is copied up during chown/chmod and data is copied up when file is opened for WRITE. This optimization potentially could be useful with containers

[PATCH 00/28] overlayfs: Delayed copy up of data

2018-05-29 Thread Miklos Szeredi
In one of the recent converstions, people mentioned that chown/chmod lead to copy up files as well as data. We could optimize it so that only metadata is copied up during chown/chmod and data is copied up when file is opened for WRITE. This optimization potentially could be useful with containers

[PATCH 01/28] ovl: Initialize ovl_inode->redirect in ovl_get_inode()

2018-05-29 Thread Miklos Szeredi
roblem as redirects are used only for directories which don't share inode. But soon I want to use redirects for regular files also and there it can become an issue. Hence, move ->redirect initialization in ovl_get_inode(). Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-b

[PATCH 01/28] ovl: Initialize ovl_inode->redirect in ovl_get_inode()

2018-05-29 Thread Miklos Szeredi
roblem as redirects are used only for directories which don't share inode. But soon I want to use redirects for regular files also and there it can become an issue. Hence, move ->redirect initialization in ovl_get_inode(). Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-b

[PATCH 05/28] ovl: Copy up only metadata during copy up where it makes sense

2018-05-29 Thread Miklos Szeredi
off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c index c072a4c0cf08..38cfd1acc196 100644 --- a

[PATCH 04/28] ovl: During copy up, first copy up metadata and then data

2018-05-29 Thread Miklos Szeredi
From: Vivek Goyal Just a little re-ordering of code. This helps with next patch where after copying up metadata, we skip data copying step, if needed. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 36

[PATCH 05/28] ovl: Copy up only metadata during copy up where it makes sense

2018-05-29 Thread Miklos Szeredi
off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c index c072a4c0cf08..38cfd1acc196 100644 --- a

[PATCH 04/28] ovl: During copy up, first copy up metadata and then data

2018-05-29 Thread Miklos Szeredi
From: Vivek Goyal Just a little re-ordering of code. This helps with next patch where after copying up metadata, we skip data copying step, if needed. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 36

[PATCH 06/28] ovl: Add helper ovl_already_copied_up()

2018-05-29 Thread Miklos Szeredi
introduce a helper instead to check this so that code is easier to read. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 20 ++-- fs/overlayfs/overlayfs.h | 1 + fs/overlayfs/util.c | 26

[PATCH 06/28] ovl: Add helper ovl_already_copied_up()

2018-05-29 Thread Miklos Szeredi
introduce a helper instead to check this so that code is easier to read. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 20 ++-- fs/overlayfs/overlayfs.h | 1 + fs/overlayfs/util.c | 26

[PATCH 02/28] ovl: Move the copy up helpers to copy_up.c

2018-05-29 Thread Miklos Szeredi
From: Vivek Goyal Right now two copy up helpers are in inode.c. Amir suggested it might be better to move these to copy_up.c. There will one more related function which will come in later patch. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs

[PATCH 02/28] ovl: Move the copy up helpers to copy_up.c

2018-05-29 Thread Miklos Szeredi
From: Vivek Goyal Right now two copy up helpers are in inode.c. Amir suggested it might be better to move these to copy_up.c. There will one more related function which will come in later patch. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs

[PATCH 14/28] ovl: Add helper ovl_inode_realdata()

2018-05-29 Thread Miklos Szeredi
From: Vivek Goyal Add an helper to retrieve real data inode associated with overlay inode. This helper will ignore all metacopy inodes and will return only the real inode which has data. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs

[PATCH 14/28] ovl: Add helper ovl_inode_realdata()

2018-05-29 Thread Miklos Szeredi
From: Vivek Goyal Add an helper to retrieve real data inode associated with overlay inode. This helper will ignore all metacopy inodes and will return only the real inode which has data. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs

[PATCH 13/28] ovl: Store lower data inode in ovl_inode

2018-05-29 Thread Miklos Szeredi
mir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/inode.c | 2 +- fs/overlayfs/namei.c | 2 ++ fs/overlayfs/overlayfs.h | 4 +++- fs/overlayfs/ovl_entry.h | 5 - fs/overlayfs/super.c | 8 ++-- fs/overlayfs/util.c | 12 +++- 6 files changed, 27 inserti

[PATCH 13/28] ovl: Store lower data inode in ovl_inode

2018-05-29 Thread Miklos Szeredi
mir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/inode.c | 2 +- fs/overlayfs/namei.c | 2 ++ fs/overlayfs/overlayfs.h | 4 +++- fs/overlayfs/ovl_entry.h | 5 - fs/overlayfs/super.c | 8 ++-- fs/overlayfs/util.c | 12 +++- 6 files changed, 27 inserti

[PATCH 12/28] ovl: Fix ovl_getattr() to get number of blocks from lower

2018-05-29 Thread Miklos Szeredi
e from lowest data dentry and this could be different from lower dentry. Hence we end up making a separate vfs_getxattr() call for metacopy dentries to get number of blocks. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/inode.c

[PATCH 12/28] ovl: Fix ovl_getattr() to get number of blocks from lower

2018-05-29 Thread Miklos Szeredi
e from lowest data dentry and this could be different from lower dentry. Hence we end up making a separate vfs_getxattr() call for metacopy dentries to get number of blocks. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/inode.c

[PATCH 11/28] ovl: Add helper ovl_dentry_lowerdata() to get lower data dentry

2018-05-29 Thread Miklos Szeredi
lowerstack[1] is actual data dentry. So add an helper which returns lowest most dentry which is supposed to be data dentry. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/overlayfs.h | 1 + fs/overlayfs/util.c | 13 + 2 files

[PATCH 11/28] ovl: Add helper ovl_dentry_lowerdata() to get lower data dentry

2018-05-29 Thread Miklos Szeredi
lowerstack[1] is actual data dentry. So add an helper which returns lowest most dentry which is supposed to be data dentry. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/overlayfs.h | 1 + fs/overlayfs/util.c | 13 + 2 files

[PATCH 08/28] ovl: Use out_err instead of out_nomem

2018-05-29 Thread Miklos Szeredi
reorganization and no change of functionality. I am about to add more code and this organization helps laying more code and error paths on top of it. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/inode.c | 17 ++--- 1 file changed

[PATCH 07/28] ovl: A new xattr OVL_XATTR_METACOPY for file on upper

2018-05-29 Thread Miklos Szeredi
we will not break it in future. So hence trying to be safe here and introducing barriers explicitly for UPPERDATA flag/bit. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 56 ++ fs/overlayf

[PATCH 08/28] ovl: Use out_err instead of out_nomem

2018-05-29 Thread Miklos Szeredi
reorganization and no change of functionality. I am about to add more code and this organization helps laying more code and error paths on top of it. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/inode.c | 17 ++--- 1 file changed

[PATCH 07/28] ovl: A new xattr OVL_XATTR_METACOPY for file on upper

2018-05-29 Thread Miklos Szeredi
we will not break it in future. So hence trying to be safe here and introducing barriers explicitly for UPPERDATA flag/bit. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 56 ++ fs/overlayf

[PATCH 19/28] ovl: Treat metacopy dentries as type OVL_PATH_MERGE

2018-05-29 Thread Miklos Szeredi
on a metacopy file. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index 73939e08d8bf..61ace2de3019 100644 --- a/fs/overlayfs

[PATCH 19/28] ovl: Treat metacopy dentries as type OVL_PATH_MERGE

2018-05-29 Thread Miklos Szeredi
on a metacopy file. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index 73939e08d8bf..61ace2de3019 100644 --- a/fs/overlayfs

[PATCH 17/28] ovl: Move some dir related ovl_lookup_single() code in else block

2018-05-29 Thread Miklos Szeredi
and cleaner. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/namei.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index b28b255ea8e2..451cd6effcf6

[PATCH 17/28] ovl: Move some dir related ovl_lookup_single() code in else block

2018-05-29 Thread Miklos Szeredi
and cleaner. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/namei.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index b28b255ea8e2..451cd6effcf6

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

2018-05-29 Thread Miklos Szeredi
-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/file.c | 39 ++- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index 266692ce9a9a..c7738ef492c8 100644

[PATCH 16/28] ovl: Do not expose metacopy only dentry from d_real()

2018-05-29 Thread Miklos Szeredi
-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/super.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index e0326a686f45..6687d547ec6b 100644 --- a/fs/overlayfs/super.c +++ b/fs

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

2018-05-29 Thread Miklos Szeredi
-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/file.c | 39 ++- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index 266692ce9a9a..c7738ef492c8 100644

[PATCH 16/28] ovl: Do not expose metacopy only dentry from d_real()

2018-05-29 Thread Miklos Szeredi
-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/super.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index e0326a686f45..6687d547ec6b 100644 --- a/fs/overlayfs/super.c +++ b/fs

[PATCH 18/28] ovl: Check redirects for metacopy files

2018-05-29 Thread Miklos Szeredi
for metacopy files. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/namei.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index 451cd6effcf6..e38fa61e08df 100644 --- a/fs

[PATCH 18/28] ovl: Check redirects for metacopy files

2018-05-29 Thread Miklos Szeredi
for metacopy files. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/namei.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index 451cd6effcf6..e38fa61e08df 100644 --- a/fs

[PATCH 21/28] ovl: Do not set dentry type ORIGIN for broken hardlinks

2018-05-29 Thread Miklos Szeredi
rdlink is broken or will be broken over copy up. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index 61ace2de3019..1aa9e0

[PATCH 21/28] ovl: Do not set dentry type ORIGIN for broken hardlinks

2018-05-29 Thread Miklos Szeredi
rdlink is broken or will be broken over copy up. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index 61ace2de3019..1aa9e0

[PATCH 20/28] ovl: Add an inode flag OVL_CONST_INO

2018-05-29 Thread Miklos Szeredi
figure out if dentry is of type ORIGIN or not. And this can be derived by this flag. ORIGIN = (upperdentry && ovl_test_flag(OVL_CONST_INO, inode)). Suggested-by: Amir Goldstein Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/inode.c

[PATCH 20/28] ovl: Add an inode flag OVL_CONST_INO

2018-05-29 Thread Miklos Szeredi
figure out if dentry is of type ORIGIN or not. And this can be derived by this flag. ORIGIN = (upperdentry && ovl_test_flag(OVL_CONST_INO, inode)). Suggested-by: Amir Goldstein Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/inode.c

[PATCH 22/28] ovl: Set redirect on metacopy files upon rename

2018-05-29 Thread Miklos Szeredi
From: Vivek Goyal Set redirect on metacopy files upon rename. This will help find data dentry in lower dirs. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/dir.c | 66 +- 1 file

[PATCH 22/28] ovl: Set redirect on metacopy files upon rename

2018-05-29 Thread Miklos Szeredi
From: Vivek Goyal Set redirect on metacopy files upon rename. This will help find data dentry in lower dirs. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/dir.c | 66 +- 1 file

[PATCH 26/28] ovl: Do not do metadata only copy-up for truncate operation

2018-05-29 Thread Miklos Szeredi
() if size of file is changing. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/inode.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index ac1d2a581a6e..e31d64206a01

[PATCH 25/28] ovl: Disbale metacopy for MAP_SHARED mmap()

2018-05-29 Thread Miklos Szeredi
From: Vivek Goyal When user chose the option of copying up a file when mmap(MAP_SHARED) happens, then do full copy up and not just metacopy. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 5 + fs/overlayfs/file.c

[PATCH 27/28] ovl: Do not do metacopy only for ioctl modifying file attr

2018-05-29 Thread Miklos Szeredi
an revisit it. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index 953295774471..31f32fc1004b 100644 --- a/fs/overlayfs/file.

[PATCH 26/28] ovl: Do not do metadata only copy-up for truncate operation

2018-05-29 Thread Miklos Szeredi
() if size of file is changing. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/inode.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index ac1d2a581a6e..e31d64206a01

[PATCH 25/28] ovl: Disbale metacopy for MAP_SHARED mmap()

2018-05-29 Thread Miklos Szeredi
From: Vivek Goyal When user chose the option of copying up a file when mmap(MAP_SHARED) happens, then do full copy up and not just metacopy. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 5 + fs/overlayfs/file.c

[PATCH 27/28] ovl: Do not do metacopy only for ioctl modifying file attr

2018-05-29 Thread Miklos Szeredi
an revisit it. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index 953295774471..31f32fc1004b 100644 --- a/fs/overlayfs/file.

[PATCH 28/28] ovl: Enable metadata only feature

2018-05-29 Thread Miklos Szeredi
From: Vivek Goyal All the bits are in patches before this. So it is time to enable the metadata only copy up feature. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs

[PATCH 28/28] ovl: Enable metadata only feature

2018-05-29 Thread Miklos Szeredi
From: Vivek Goyal All the bits are in patches before this. So it is time to enable the metadata only copy up feature. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs

[PATCH 23/28] ovl: Set redirect on upper inode when it is linked

2018-05-29 Thread Miklos Szeredi
al Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/dir.c | 8 1 file changed, 8 insertions(+) diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c index 1658961a9762..7063e0f588cc 100644 --- a/fs/overlayfs/dir.c +++ b/fs/overlayfs/dir.c @@ -24,6 +24,8 @@ module_par

[PATCH 24/28] ovl: Check redirect on index as well

2018-05-29 Thread Miklos Szeredi
nd -ESTALE is returned.) So problem here is that we did not process redirect on index. Check redirect on index as well and then problem is fixed. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/namei.c | 50 +-

[PATCH 23/28] ovl: Set redirect on upper inode when it is linked

2018-05-29 Thread Miklos Szeredi
al Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/dir.c | 8 1 file changed, 8 insertions(+) diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c index 1658961a9762..7063e0f588cc 100644 --- a/fs/overlayfs/dir.c +++ b/fs/overlayfs/dir.c @@ -24,6 +24,8 @@ module_par

[PATCH 24/28] ovl: Check redirect on index as well

2018-05-29 Thread Miklos Szeredi
nd -ESTALE is returned.) So problem here is that we did not process redirect on index. Check redirect on index as well and then problem is fixed. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/namei.c | 50 +-

[PATCH 10/28] ovl: Copy up meta inode data from lowest data inode

2018-05-29 Thread Miklos Szeredi
chain. Find lower data inode in the chain and use that for data copy up. Introduced a helper called ovl_path_lowerdata() to find the lower data inode chain. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 13 + fs

[PATCH 10/28] ovl: Copy up meta inode data from lowest data inode

2018-05-29 Thread Miklos Szeredi
chain. Find lower data inode in the chain and use that for data copy up. Introduced a helper called ovl_path_lowerdata() to find the lower data inode chain. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 13 + fs

[PATCH 09/28] ovl: Modify ovl_lookup() and friends to lookup metacopy dentry

2018-05-29 Thread Miklos Szeredi
could hand craft upper and try to gain access to file on lower which it should not have to begin with. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/export.c| 3 ++ fs/overlayfs/inode.c | 11 - fs/overlayfs/namei.c

[PATCH 09/28] ovl: Modify ovl_lookup() and friends to lookup metacopy dentry

2018-05-29 Thread Miklos Szeredi
could hand craft upper and try to gain access to file on lower which it should not have to begin with. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/export.c| 3 ++ fs/overlayfs/inode.c | 11 - fs/overlayfs/namei.c

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

2018-05-29 Thread Miklos Szeredi
, it requires redirect_dir=follow atleast. As of now, metacopy does not work with nfs_export=on. So if both metacopy=on and nfs_export=on then nfs_export is disabled. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- Documentation/filesystems/overlayfs.txt

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

2018-05-29 Thread Miklos Szeredi
, it requires redirect_dir=follow atleast. As of now, metacopy does not work with nfs_export=on. So if both metacopy=on and nfs_export=on then nfs_export is disabled. Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- Documentation/filesystems/overlayfs.txt

[PATCH 29/39] vfs: simplify dentry_open()

2018-05-29 Thread Miklos Szeredi
dentry_open() can now just call path_open(). Signed-off-by: Miklos Szeredi --- fs/open.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/fs/open.c b/fs/open.c index 244cd2ecfefd..1d4bc541c619 100644 --- a/fs/open.c +++ b/fs/open.c @@ -935,25 +935,12

[PATCH 29/39] vfs: simplify dentry_open()

2018-05-29 Thread Miklos Szeredi
dentry_open() can now just call path_open(). Signed-off-by: Miklos Szeredi --- fs/open.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/fs/open.c b/fs/open.c index 244cd2ecfefd..1d4bc541c619 100644 --- a/fs/open.c +++ b/fs/open.c @@ -935,25 +935,12

[PATCH 28/39] ovl: fix documentation of non-standard behavior

2018-05-29 Thread Miklos Szeredi
We can now drop description of the ro/rw inconsistency from the documentation. Also clarify, that now fully standard compliant behavior can be enabled with kernel/module/mount options. Signed-off-by: Miklos Szeredi --- Documentation/filesystems/overlayfs.txt | 60

[PATCH 28/39] ovl: fix documentation of non-standard behavior

2018-05-29 Thread Miklos Szeredi
We can now drop description of the ro/rw inconsistency from the documentation. Also clarify, that now fully standard compliant behavior can be enabled with kernel/module/mount options. Signed-off-by: Miklos Szeredi --- Documentation/filesystems/overlayfs.txt | 60

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

2018-05-29 Thread Miklos Szeredi
This was provided for debugging the ro/rw inconsistecy. The inconsitency is now gone so this option is obsolete. Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 30 +++--- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/fs/overlayfs/copy_up.c b

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

2018-05-29 Thread Miklos Szeredi
This was provided for debugging the ro/rw inconsistecy. The inconsitency is now gone so this option is obsolete. Signed-off-by: Miklos Szeredi --- fs/overlayfs/copy_up.c | 30 +++--- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/fs/overlayfs/copy_up.c b

[PATCH 26/39] ovl: copy-up on MAP_SHARED

2018-05-29 Thread Miklos Szeredi
. Signed-off-by: Miklos Szeredi --- fs/overlayfs/Kconfig | 21 + fs/overlayfs/file.c | 22 ++ fs/overlayfs/overlayfs.h | 7 +++ fs/overlayfs/ovl_entry.h | 1 + fs/overlayfs/super.c | 22 ++ 5 files changed, 73 insertions

[PATCH 26/39] ovl: copy-up on MAP_SHARED

2018-05-29 Thread Miklos Szeredi
. Signed-off-by: Miklos Szeredi --- fs/overlayfs/Kconfig | 21 + fs/overlayfs/file.c | 22 ++ fs/overlayfs/overlayfs.h | 7 +++ fs/overlayfs/ovl_entry.h | 1 + fs/overlayfs/super.c | 22 ++ 5 files changed, 73 insertions

[PATCH 23/39] ovl: add O_DIRECT support

2018-05-29 Thread Miklos Szeredi
Signed-off-by: Miklos Szeredi --- fs/overlayfs/file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index 3f610a5b38e4..e5e7ccaaf9ec 100644 --- a/fs/overlayfs/file.c +++ b/fs/overlayfs/file.c @@ -110,6 +110,9 @@ static int ovl_open(struct inode

[PATCH 23/39] ovl: add O_DIRECT support

2018-05-29 Thread Miklos Szeredi
Signed-off-by: Miklos Szeredi --- fs/overlayfs/file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index 3f610a5b38e4..e5e7ccaaf9ec 100644 --- a/fs/overlayfs/file.c +++ b/fs/overlayfs/file.c @@ -110,6 +110,9 @@ static int ovl_open(struct inode

[PATCH 09/39] ovl: copy up times

2018-05-29 Thread Miklos Szeredi
Copy up mtime and ctime to overlay inode after times in real object are modified. Be careful not to dirty cachelines when not necessary. This is in preparation for moving overlay functionality out of the VFS. This patch shouldn't have any observable effect. Signed-off-by: Miklos Szeredi

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