From patchwork Tue Nov 7 19:41:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13449248 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACBB636AFE for ; Tue, 7 Nov 2023 19:42:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="pyFIZPDq" Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3537D184 for ; Tue, 7 Nov 2023 11:42:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=mtzc42jL92/A9PanSigtfnK/05Wkzw2xa6Ym8wnoe4o=; b=pyFIZPDqctPbt7Katju0AIszWP NJd1Sq4rnvUhPffnwpknxn2EQQrIUmp4mHxyzHhQfwL/c/XSxnqW7/ZjOTy5Y+PgIJO3Qysm7lvOn A/vCwRHWN1VNp0moP0OuzzHytuT1ir7EMFSkC3SLGFtyVdPp4mwCqOhawQFyPW5oqweM1ESq77DQ6 FgrkP4vBD9bZ4NIPFCrXkIhXqyubxD9Uci0ql6d7NcSMoeQnhjDm/5FkQg70QlcRZ5uCrR5vjFGoZ StxoJtg8y4XxUxVugVylTKtPji0tzZL9r3xcfc5X5R06UGs1PuO1fOeGjlHcg8+tO/YHmKPzOB/jL BmvFpAKg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1r0RxU-00E9l5-0C; Tue, 07 Nov 2023 19:41:56 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , Hannes Reinecke , Luis Chamberlain , Pankaj Raghav , linux-fsdevel@vger.kernel.org Subject: [PATCH 4/5] buffer: Cast block to loff_t before shifting it Date: Tue, 7 Nov 2023 19:41:51 +0000 Message-Id: <20231107194152.3374087-5-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20231107194152.3374087-1-willy@infradead.org> References: <20231107194152.3374087-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 While sector_t is always defined as a u64 today, that hasn't always been the case and it might not always be the same size as loff_t in the future. Signed-off-by: Matthew Wilcox (Oracle) --- fs/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/buffer.c b/fs/buffer.c index c83bb89b2e24..2f08af3c47a2 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2008,7 +2008,7 @@ static int iomap_to_bh(struct inode *inode, sector_t block, struct buffer_head *bh, const struct iomap *iomap) { - loff_t offset = block << inode->i_blkbits; + loff_t offset = (loff_t)block << inode->i_blkbits; bh->b_bdev = iomap->bdev;