Message ID | 20201004180428.14494-3-willy@infradead.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=rKX+=DL=oss.oracle.com=ocfs2-devel-bounces@kernel.org> Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4B238112E for <patchwork-ocfs2-devel@patchwork.kernel.org>; Sun, 4 Oct 2020 18:06:10 +0000 (UTC) Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1904B206B6 for <patchwork-ocfs2-devel@patchwork.kernel.org>; Sun, 4 Oct 2020 18:06:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1904B206B6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=ocfs2-devel-bounces@oss.oracle.com Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 094I63U2082387; Sun, 4 Oct 2020 18:06:03 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 33xh8kjtxn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 04 Oct 2020 18:06:03 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 094I61ut086152; Sun, 4 Oct 2020 18:06:02 GMT Received: from oss.oracle.com (oss-old-reserved.oracle.com [137.254.22.2]) by userp3030.oracle.com with ESMTP id 33y37u7w0g-1 (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO); Sun, 04 Oct 2020 18:06:02 +0000 Received: from localhost ([127.0.0.1] helo=lb-oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from <ocfs2-devel-bounces@oss.oracle.com>) id 1kP8OQ-0000aX-6h; Sun, 04 Oct 2020 11:05:54 -0700 Received: from userp3030.oracle.com ([156.151.31.80]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from <willy@infradead.org>) id 1kP8Nh-0000VN-9Y for ocfs2-devel@oss.oracle.com; Sun, 04 Oct 2020 11:05:09 -0700 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 094I02ko076394 for <ocfs2-devel@oss.oracle.com>; Sun, 4 Oct 2020 18:05:09 GMT Received: from userp2040.oracle.com (userp2040.oracle.com [156.151.31.90]) by userp3030.oracle.com with ESMTP id 33y37u7ve5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <ocfs2-devel@oss.oracle.com>; Sun, 04 Oct 2020 18:05:07 +0000 Received: from pps.filterd (userp2040.oracle.com [127.0.0.1]) by userp2040.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 094I4naH001099 for <ocfs2-devel@oss.oracle.com>; Sun, 4 Oct 2020 18:05:07 GMT Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by userp2040.oracle.com with ESMTP id 33xfwsr00a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for <ocfs2-devel@oss.oracle.com>; Sun, 04 Oct 2020 18:05:07 +0000 Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kP8N5-0003mc-D3; Sun, 04 Oct 2020 18:04:31 +0000 From: "Matthew Wilcox (Oracle)" <willy@infradead.org> To: linux-fsdevel@vger.kernel.org Date: Sun, 4 Oct 2020 19:04:23 +0100 Message-Id: <20201004180428.14494-3-willy@infradead.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20201004180428.14494-1-willy@infradead.org> References: <20201004180428.14494-1-willy@infradead.org> MIME-Version: 1.0 X-PDR: PASS X-Source-IP: 90.155.50.34 X-ServerName: casper.infradead.org X-Proofpoint-SPF-Result: None X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9764 signatures=668680 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 malwarescore=0 lowpriorityscore=0 phishscore=0 impostorscore=0 mlxlogscore=525 priorityscore=216 clxscore=315 bulkscore=0 suspectscore=1 spamscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2010040140 X-Spam: Clean Cc: lucho@ionkov.net, stable@vger.kernel.org, clm@fb.com, ericvh@gmail.com, linux-btrfs@vger.kernel.org, jlayton@kernel.org, linux-kernel@vger.kernel.org, josef@toxicpanda.com, viro@zeniv.linux.org.uk, dsterba@suse.com, v9fs-developer@lists.sourceforge.net, idryomov@gmail.com, ceph-devel@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: [Ocfs2-devel] [PATCH 2/7] buffer: Promote to unsigned long long before shifting X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: <ocfs2-devel.oss.oracle.com> List-Unsubscribe: <https://oss.oracle.com/mailman/listinfo/ocfs2-devel>, <mailto:ocfs2-devel-request@oss.oracle.com?subject=unsubscribe> List-Archive: <http://oss.oracle.com/pipermail/ocfs2-devel> List-Post: <mailto:ocfs2-devel@oss.oracle.com> List-Help: <mailto:ocfs2-devel-request@oss.oracle.com?subject=help> List-Subscribe: <https://oss.oracle.com/mailman/listinfo/ocfs2-devel>, <mailto:ocfs2-devel-request@oss.oracle.com?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9764 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 malwarescore=0 suspectscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2010040140 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9764 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 suspectscore=0 impostorscore=0 priorityscore=1501 clxscore=1034 phishscore=0 malwarescore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2010040140 |
Series |
Fix a pile of 4GB file problems on 32-bit
|
expand
|
diff --git a/fs/buffer.c b/fs/buffer.c index 50bbc99e3d96..66f4765e60ee 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2515,7 +2515,7 @@ int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, } /* page is wholly or partially inside EOF */ - if (((page->index + 1) << PAGE_SHIFT) > size) + if (((page->index + 1ULL) << PAGE_SHIFT) > size) end = size & ~PAGE_MASK; else end = PAGE_SIZE;
On 32-bit systems, this shift will overflow for files larger than 4GB. Cc: stable@vger.kernel.org Fixes: 5417169026c3 ("[FS] Implement block_page_mkwrite.") Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> --- fs/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)