Skip to content

Commit 388bc03

Browse files
iridesakpm00
authored andcommitted
fsdax: dax_unshare_iter() should return a valid length
The copy_mc_to_kernel() will return 0 if it executed successfully. Then the return value should be set to the length it copied. [[email protected]: don't mess up `ret', per Matthew] Link: https://lkml.kernel.org/r/[email protected] Fixes: d984648 ("fsdax,xfs: port unshare to fsdax") Signed-off-by: Shiyang Ruan <[email protected]> Cc: Darrick J. Wong <[email protected]> Cc: Alistair Popple <[email protected]> Cc: Dan Williams <[email protected]> Cc: Dave Chinner <[email protected]> Cc: Jason Gunthorpe <[email protected]> Cc: John Hubbard <[email protected]> Cc: Matthew Wilcox <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent aa1e6a9 commit 388bc03

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/dax.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,8 +1271,9 @@ static s64 dax_unshare_iter(struct iomap_iter *iter)
12711271
if (ret < 0)
12721272
goto out_unlock;
12731273

1274-
ret = copy_mc_to_kernel(daddr, saddr, length);
1275-
if (ret)
1274+
if (copy_mc_to_kernel(daddr, saddr, length) == 0)
1275+
ret = length;
1276+
else
12761277
ret = -EIO;
12771278

12781279
out_unlock:

0 commit comments

Comments
 (0)