aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-10-30 10:42:24 +1100
committerDave Chinner <david@fromorbit.com>2018-10-30 10:42:24 +1100
commit8c5c836bd6c3b9f9fc1c5a210d630b8c42f4f7df (patch)
treeb30d576876330782bc620907b9693f5b20ef4ea7 /fs/xfs
parentvfs: hide file range comparison function (diff)
downloadlinux-dev-8c5c836bd6c3b9f9fc1c5a210d630b8c42f4f7df.tar.xz
linux-dev-8c5c836bd6c3b9f9fc1c5a210d630b8c42f4f7df.zip
vfs: clean up generic_remap_file_range_prep return value
Since the remap prep function can update the length of the remap request, we can change this function to return the usual return status instead of the odd behavior it has now. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_reflink.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
index 3dbe5fb7e9c0..9b1ea42c81d1 100644
--- a/fs/xfs/xfs_reflink.c
+++ b/fs/xfs/xfs_reflink.c
@@ -1329,7 +1329,7 @@ xfs_reflink_remap_prep(
ret = generic_remap_file_range_prep(file_in, pos_in, file_out, pos_out,
len, remap_flags);
- if (ret <= 0)
+ if (ret < 0 || *len == 0)
goto out_unlock;
/*
@@ -1409,7 +1409,7 @@ xfs_reflink_remap_range(
/* Prepare and then clone file data. */
ret = xfs_reflink_remap_prep(file_in, pos_in, file_out, pos_out,
&len, remap_flags);
- if (ret <= 0)
+ if (ret < 0 || len == 0)
return ret;
trace_xfs_reflink_remap_range(src, pos_in, len, dest, pos_out);