mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
fsdax: dax_unshare_iter() should return a valid length
commit388bc034d9upstream. The copy_mc_to_kernel() will return 0 if it executed successfully. Then the return value should be set to the length it copied. [akpm@linux-foundation.org: don't mess up `ret', per Matthew] Link: https://lkml.kernel.org/r/1675341227-14-1-git-send-email-ruansy.fnst@fujitsu.com Fixes:d984648e42("fsdax,xfs: port unshare to fsdax") Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com> Cc: Darrick J. Wong <djwong@kernel.org> Cc: Alistair Popple <apopple@nvidia.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Dave Chinner <david@fromorbit.com> Cc: Jason Gunthorpe <jgg@nvidia.com> Cc: John Hubbard <jhubbard@nvidia.com> Cc: Matthew Wilcox <willy@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
acebeb375f
commit
bea229ba8b
5
fs/dax.c
5
fs/dax.c
@@ -1247,8 +1247,9 @@ static s64 dax_unshare_iter(struct iomap_iter *iter)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
|
|
||||||
ret = copy_mc_to_kernel(daddr, saddr, length);
|
if (copy_mc_to_kernel(daddr, saddr, length) == 0)
|
||||||
if (ret)
|
ret = length;
|
||||||
|
else
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
|
|
||||||
out_unlock:
|
out_unlock:
|
||||||
|
|||||||
Reference in New Issue
Block a user