From: J. Bruce Fields Date: Wed, 16 Sep 2015 21:21:27 +0000 (-0400) Subject: nfs: fix v4.2 SEEK on files over 2 gigs X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=306a5549355966e480e0dcacdc6b9321d153e0c0;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Reviewed-by: Anna Schumaker Signed-off-by: Trond Myklebust --- 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) { struct nfs_server *server = NFS_SERVER(file_inode(filep)); struct nfs4_exception exception = { }; - int err; + loff_t err; do { err = _nfs42_proc_llseek(filep, offset, whence); + if (err >= 0) + break; if (err == -ENOTSUPP) return -EOPNOTSUPP; err = nfs4_handle_exception(server, err, &exception);