mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
xfs: clamp a pNFS LAYOUTCOMMIT extent before computing its end
xfs_fs_commit_blocks() adds the client's length to the offset before it
clamps the end to the file size. A large length wraps the sum and
reaches xfs_iomap_write_unwritten() unclamped. With the previous two
patches the LAYOUTCOMMIT then fails with -EIO and converts nothing.
Clamp the length first.
Fixes: 527851124d ("xfs: implement pNFS export operations")
Cc: stable@vger.kernel.org
Signed-off-by: Daejun Park <daejun7.park@samsung.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Pankaj Raghav <p.raghav@samsung.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
parent
bcf0b7f18a
commit
d8c2bc8846
|
|
@ -328,9 +328,7 @@ xfs_fs_commit_blocks(
|
|||
if (start > size)
|
||||
continue;
|
||||
|
||||
end = start + maps[i].length;
|
||||
if (end > size)
|
||||
end = size;
|
||||
end = start + min_t(u64, maps[i].length, size - start);
|
||||
|
||||
length = end - start;
|
||||
if (!length)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user