pNFS: Fix the pnfs block driver's calculation of layoutget size
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 17 Nov 2023 11:25:13 +0000 (06:25 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:35:18 +0000 (15:35 -0800)
commit75aa038d9f6ea47a10dda28a6c9fb864fccfab60
tree9a2d6f61eb525f265a521a267833b31408d98b5b
parentbcdb16220a584003b9093eac5dcff0b73776064f
pNFS: Fix the pnfs block driver's calculation of layoutget size

[ Upstream commit 8a6291bf3b0eae1bf26621e6419a91682f2d6227 ]

Instead of relying on the value of the 'bytes_left' field, we should
calculate the layout size based on the offset of the request that is
being written out.

Reported-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Fixes: 954998b60caa ("NFS: Fix error handling for O_DIRECT write scheduling")
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Tested-by: Benjamin Coddington <bcodding@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/blocklayout/blocklayout.c
fs/nfs/direct.c
fs/nfs/internal.h
fs/nfs/pnfs.c