mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-19 02:34:01 +08:00
nfs: fix v4.2 SEEK on files over 2 gigs
We're incorrectly assigning a loff_t return to an int. If SEEK_HOLE or
SEEK_DATA returns an offset over 2^31 then the application will see a
weird lseek() result (usually -EIO).
Cc: stable@vger.kernel.org
Fixes: bdcc2cd14e
"NFSv4.2: handle NFS-specific llseek errors"
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Reviewed-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
parent
03c78827db
commit
306a554935
@ -175,10 +175,12 @@ loff_t nfs42_proc_llseek(struct file *filep, loff_t offset, int whence)
|
|||||||
{
|
{
|
||||||
struct nfs_server *server = NFS_SERVER(file_inode(filep));
|
struct nfs_server *server = NFS_SERVER(file_inode(filep));
|
||||||
struct nfs4_exception exception = { };
|
struct nfs4_exception exception = { };
|
||||||
int err;
|
loff_t err;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
err = _nfs42_proc_llseek(filep, offset, whence);
|
err = _nfs42_proc_llseek(filep, offset, whence);
|
||||||
|
if (err >= 0)
|
||||||
|
break;
|
||||||
if (err == -ENOTSUPP)
|
if (err == -ENOTSUPP)
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
err = nfs4_handle_exception(server, err, &exception);
|
err = nfs4_handle_exception(server, err, &exception);
|
||||||
|
Loading…
Reference in New Issue
Block a user