* [PATCH] vfs: allow remap flags to be passed to vfs_clone_file_range
@ 2018-11-30 20:42 Darrick J. Wong
2018-12-01 9:37 ` Amir Goldstein
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Darrick J. Wong @ 2018-11-30 20:42 UTC (permalink / raw)
To: Dave Chinner; +Cc: xfs, linux-fsdevel, amir73il, linux-unionfs
From: Darrick J. Wong <darrick.wong@oracle.com>
In overlayfs, ovl_remap_file_range calls vfs_clone_file_range on the
lower filesystem's inode, passing through whatever remap flags it got
from its caller. Since vfs_copy_file_range first tries a filesystem's
remap function with REMAP_FILE_CAN_SHORTEN, this can get passed through
to the second vfs_copy_file_range call, which isn't an issue.
Remove the WARN_ON because it's unnecessary.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
fs/read_write.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/fs/read_write.c b/fs/read_write.c
index 4dae0399c75a..2d9fed57e7dd 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -1956,8 +1956,6 @@ loff_t do_clone_file_range(struct file *file_in, loff_t pos_in,
struct inode *inode_out = file_inode(file_out);
loff_t ret;
- WARN_ON_ONCE(remap_flags);
-
if (S_ISDIR(inode_in->i_mode) || S_ISDIR(inode_out->i_mode))
return -EISDIR;
if (!S_ISREG(inode_in->i_mode) || !S_ISREG(inode_out->i_mode))
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] vfs: allow remap flags to be passed to vfs_clone_file_range
2018-11-30 20:42 [PATCH] vfs: allow remap flags to be passed to vfs_clone_file_range Darrick J. Wong
@ 2018-12-01 9:37 ` Amir Goldstein
2018-12-02 1:07 ` [PATCH v2] vfs: allow some " Darrick J. Wong
2018-12-02 15:59 ` [PATCH] vfs: allow " Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Amir Goldstein @ 2018-12-01 9:37 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: Dave Chinner, linux-xfs, linux-fsdevel, overlayfs
On Fri, Nov 30, 2018 at 10:42 PM Darrick J. Wong
<darrick.wong@oracle.com> wrote:
>
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> In overlayfs, ovl_remap_file_range calls vfs_clone_file_range on the
> lower filesystem's inode, passing through whatever remap flags it got
> from its caller. Since vfs_copy_file_range first tries a filesystem's
> remap function with REMAP_FILE_CAN_SHORTEN, this can get passed through
> to the second vfs_copy_file_range call, which isn't an issue.
> Remove the WARN_ON because it's unnecessary.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
> fs/read_write.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/fs/read_write.c b/fs/read_write.c
> index 4dae0399c75a..2d9fed57e7dd 100644
> --- a/fs/read_write.c
> +++ b/fs/read_write.c
> @@ -1956,8 +1956,6 @@ loff_t do_clone_file_range(struct file *file_in, loff_t pos_in,
> struct inode *inode_out = file_inode(file_out);
> loff_t ret;
>
> - WARN_ON_ONCE(remap_flags);
> -
WARN_ON_ONCE(remap_flags & ~REMAP_FILE_ADVISORY);
We still do not want anyone to call do_clone_file_range(..., REMAP_FILE_DEDUP)
If we had more users of the overloaded interface, we need to do:
WARN_ON_ONCE((remap_flags & REMAP_FILE_OP_MASK) == REMAP_FILE_OP_CLONE);
With the minor fix, you can add:
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Thanks,
Amir.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] vfs: allow some remap flags to be passed to vfs_clone_file_range
2018-11-30 20:42 [PATCH] vfs: allow remap flags to be passed to vfs_clone_file_range Darrick J. Wong
2018-12-01 9:37 ` Amir Goldstein
@ 2018-12-02 1:07 ` Darrick J. Wong
2018-12-02 15:59 ` [PATCH] vfs: allow " Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Darrick J. Wong @ 2018-12-02 1:07 UTC (permalink / raw)
To: Dave Chinner; +Cc: xfs, linux-fsdevel, amir73il, linux-unionfs
From: Darrick J. Wong <darrick.wong@oracle.com>
In overlayfs, ovl_remap_file_range calls vfs_clone_file_range on the
lower filesystem's inode, passing through whatever remap flags it got
from its caller. Since vfs_copy_file_range first tries a filesystem's
remap function with REMAP_FILE_CAN_SHORTEN, this can get passed through
to the second vfs_copy_file_range call, and this isn't an issue.
Change the WARN_ON to look only for the DEDUP flag.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
---
fs/read_write.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/read_write.c b/fs/read_write.c
index 4dae0399c75a..58f30537c47a 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -1956,7 +1956,7 @@ loff_t do_clone_file_range(struct file *file_in, loff_t pos_in,
struct inode *inode_out = file_inode(file_out);
loff_t ret;
- WARN_ON_ONCE(remap_flags);
+ WARN_ON_ONCE(remap_flags & REMAP_FILE_DEDUP);
if (S_ISDIR(inode_in->i_mode) || S_ISDIR(inode_out->i_mode))
return -EISDIR;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] vfs: allow remap flags to be passed to vfs_clone_file_range
2018-11-30 20:42 [PATCH] vfs: allow remap flags to be passed to vfs_clone_file_range Darrick J. Wong
2018-12-01 9:37 ` Amir Goldstein
2018-12-02 1:07 ` [PATCH v2] vfs: allow some " Darrick J. Wong
@ 2018-12-02 15:59 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2018-12-02 15:59 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: Dave Chinner, xfs, linux-fsdevel, amir73il, linux-unionfs
On Fri, Nov 30, 2018 at 12:42:38PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> In overlayfs, ovl_remap_file_range calls vfs_clone_file_range on the
> lower filesystem's inode, passing through whatever remap flags it got
> from its caller. Since vfs_copy_file_range first tries a filesystem's
> remap function with REMAP_FILE_CAN_SHORTEN, this can get passed through
> to the second vfs_copy_file_range call, which isn't an issue.
> Remove the WARN_ON because it's unnecessary.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This looks ok:
Reviewed-by: Christoph Hellwig <hch@lst.de>
But this also indicates that do_clone_file_range/vfs_clone_file_range
are misnamed now, as they are wrappers for the remap_file_range method.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-12-02 15:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-30 20:42 [PATCH] vfs: allow remap flags to be passed to vfs_clone_file_range Darrick J. Wong
2018-12-01 9:37 ` Amir Goldstein
2018-12-02 1:07 ` [PATCH v2] vfs: allow some " Darrick J. Wong
2018-12-02 15:59 ` [PATCH] vfs: allow " Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).