summaryrefslogtreecommitdiff
path: root/fs/ocfs2/refcounttree.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-10-30 02:42:24 +0300
committerDave Chinner <david@fromorbit.com>2018-10-30 02:42:24 +0300
commit8c5c836bd6c3b9f9fc1c5a210d630b8c42f4f7df (patch)
treeb30d576876330782bc620907b9693f5b20ef4ea7 /fs/ocfs2/refcounttree.c
parentc32e5f39953fa6bbff35c655bdcb7b3128f1e79f (diff)
downloadlinux-8c5c836bd6c3b9f9fc1c5a210d630b8c42f4f7df.tar.xz
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/ocfs2/refcounttree.c')
-rw-r--r--fs/ocfs2/refcounttree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
index 6a42c04ac0ab..46bbd315c39f 100644
--- a/fs/ocfs2/refcounttree.c
+++ b/fs/ocfs2/refcounttree.c
@@ -4852,7 +4852,7 @@ int ocfs2_reflink_remap_range(struct file *file_in,
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;
/* Lock out changes to the allocation maps and remap. */