diff options
author | J. Bruce Fields <bfields@redhat.com> | 2015-09-16 17:21:27 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-09-17 15:48:23 -0400 |
commit | 306a5549355966e480e0dcacdc6b9321d153e0c0 (patch) | |
tree | 2518639baf4e333c4c0f20263694e0bf0b6c0a9a | |
parent | 03c78827db35be20ffa71cb5ccd2cedb192f95d6 (diff) |
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: bdcc2cd14e4e "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>
-rw-r--r-- | fs/nfs/nfs42proc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index d731bbf974aa..0f020e4d8421 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c | |||
@@ -175,10 +175,12 @@ loff_t nfs42_proc_llseek(struct file *filep, loff_t offset, int whence) | |||
175 | { | 175 | { |
176 | struct nfs_server *server = NFS_SERVER(file_inode(filep)); | 176 | struct nfs_server *server = NFS_SERVER(file_inode(filep)); |
177 | struct nfs4_exception exception = { }; | 177 | struct nfs4_exception exception = { }; |
178 | int err; | 178 | loff_t err; |
179 | 179 | ||
180 | do { | 180 | do { |
181 | err = _nfs42_proc_llseek(filep, offset, whence); | 181 | err = _nfs42_proc_llseek(filep, offset, whence); |
182 | if (err >= 0) | ||
183 | break; | ||
182 | if (err == -ENOTSUPP) | 184 | if (err == -ENOTSUPP) |
183 | return -EOPNOTSUPP; | 185 | return -EOPNOTSUPP; |
184 | err = nfs4_handle_exception(server, err, &exception); | 186 | err = nfs4_handle_exception(server, err, &exception); |