Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755197AbcCAXyP (ORCPT ); Tue, 1 Mar 2016 18:54:15 -0500 Received: from mail177-1.suw61.mandrillapp.com ([198.2.177.1]:60894 "EHLO mail177-1.suw61.mandrillapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755055AbcCAXyA (ORCPT ); Tue, 1 Mar 2016 18:54:00 -0500 From: Greg Kroah-Hartman Subject: [PATCH 3.14 122/130] nfs: fix nfs_size_to_loff_t X-Mailer: git-send-email 2.7.2 To: Cc: Greg Kroah-Hartman , , Christoph Hellwig , Trond Myklebust Message-Id: <20160301234504.083941585@linuxfoundation.org> In-Reply-To: <20160301234459.768886030@linuxfoundation.org> References: <20160301234459.768886030@linuxfoundation.org> X-Report-Abuse: Please forward a copy of this message, including all headers, to abuse@mandrill.com X-Report-Abuse: You can also report abuse here: http://mandrillapp.com/contact/abuse?id=30481620.b788b67f934249b69f070330bce479a7 X-Mandrill-User: md_30481620 Date: Tue, 01 Mar 2016 23:53:39 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1122 Lines: 38 3.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christoph Hellwig commit 50ab8ec74a153eb30db26529088bc57dd700b24c upstream. See http: //www.infradead.org/rpr.html X-Evolution-Source: 1451162204.2173.11@leira.trondhjem.org Content-Transfer-Encoding: 8bit Mime-Version: 1.0 We support OFFSET_MAX just fine, so don't round down below it. Also switch to using min_t to make the helper more readable. Signed-off-by: Christoph Hellwig Fixes: 433c92379d9c ("NFS: Clean up nfs_size_to_loff_t()") Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- include/linux/nfs_fs.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -580,9 +580,7 @@ static inline int nfs3_proc_setacls(stru static inline loff_t nfs_size_to_loff_t(__u64 size) { - if (size > (__u64) OFFSET_MAX - 1) - return OFFSET_MAX - 1; - return (loff_t) size; + return min_t(u64, size, OFFSET_MAX); } static inline ino_t