[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201004180428.14494-1-willy@infradead.org>
Date: Sun, 4 Oct 2020 19:04:21 +0100
From: "Matthew Wilcox (Oracle)" <willy@...radead.org>
To: linux-fsdevel@...r.kernel.org
Cc: "Matthew Wilcox (Oracle)" <willy@...radead.org>, ericvh@...il.com,
lucho@...kov.net, viro@...iv.linux.org.uk, jlayton@...nel.org,
idryomov@...il.com, mark@...heh.com, jlbec@...lplan.org,
joseph.qi@...ux.alibaba.com, v9fs-developer@...ts.sourceforge.net,
linux-kernel@...r.kernel.org, ceph-devel@...r.kernel.org,
ocfs2-devel@....oracle.com, linux-btrfs@...r.kernel.org,
clm@...com, josef@...icpanda.com, dsterba@...e.com
Subject: [PATCH 0/7] Fix a pile of 4GB file problems on 32-bit
I caught a bug in my own code where I forgot to cast to loff_t before
shifting. So I thought I'd grep around and see if I could find any
other occurrences. I found a few that were clearly bugs, and they're
fixed below. There are other places where we don't cast, and I think
they're OK. For example, some places we have a 'nr_pages' being shifted
by PAGE_SHIFT, and that's probably OK because it's probably a single I/O.
Also, I didn't touch AFFS or ROMFS or some other filesystems which
probably have never seen a 4GB file in their lives. Might be worth
fixing to be sure nobody copies bad code from them, but not worth cc'ing
stable for.
I didn't look for SECTOR_SHIFT or SECTOR_SIZE (or bare 9/512), just
PAGE_SIZE and PAGE_SHIFT.
I can't find a GCC warning to enable for this pattern, so I filed
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97287
Matthew Wilcox (Oracle) (7):
9P: Cast to loff_t before multiplying
buffer: Promote to unsigned long long before shifting
ceph: Promote to unsigned long long before shifting
ocfs2: Promote to unsigned long long before shifting
btrfs: Promote to unsigned long long before shifting
btrfs: Promote to unsigned long long before shifting
btrfs: Promote to unsigned long long before multiplying
fs/9p/vfs_file.c | 4 ++--
fs/btrfs/ioctl.c | 6 +++---
fs/btrfs/raid56.c | 2 +-
fs/btrfs/scrub.c | 25 ++++++++++++++++---------
fs/buffer.c | 2 +-
fs/ceph/addr.c | 2 +-
fs/ocfs2/alloc.c | 2 +-
7 files changed, 25 insertions(+), 18 deletions(-)
--
2.28.0
Powered by blists - more mailing lists