All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Fix a pile of 4GB file problems on 32-bit
@ 2020-10-04 18:04 ` Matthew Wilcox
  0 siblings, 0 replies; 40+ messages in thread
From: Matthew Wilcox (Oracle) @ 2020-10-04 18:04 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: Matthew Wilcox (Oracle),
	ericvh, lucho, viro, jlayton, idryomov, mark, jlbec, joseph.qi,
	v9fs-developer, linux-kernel, ceph-devel, ocfs2-devel,
	linux-btrfs, clm, josef, dsterba

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


^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2020-10-26 17:21 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-04 18:04 [PATCH 0/7] Fix a pile of 4GB file problems on 32-bit Matthew Wilcox (Oracle)
2020-10-04 18:04 ` [Ocfs2-devel] " Matthew Wilcox
2020-10-04 18:04 ` [PATCH 1/7] 9P: Cast to loff_t before multiplying Matthew Wilcox (Oracle)
2020-10-04 18:04   ` [Ocfs2-devel] " Matthew Wilcox
2020-10-07  5:48   ` Christoph Hellwig
2020-10-07  5:48     ` [Ocfs2-devel] " Christoph Hellwig
2020-10-07 18:47     ` Matthew Wilcox
2020-10-07 18:47       ` [Ocfs2-devel] " Matthew Wilcox
2020-10-26 17:14   ` Dominique Martinet
2020-10-26 17:14     ` [Ocfs2-devel] " Dominique Martinet
2020-10-04 18:04 ` [PATCH 2/7] buffer: Promote to unsigned long long before shifting Matthew Wilcox (Oracle)
2020-10-04 18:04   ` [Ocfs2-devel] " Matthew Wilcox
2020-10-04 18:04 ` [PATCH 3/7] ceph: " Matthew Wilcox (Oracle)
2020-10-04 18:04   ` [Ocfs2-devel] " Matthew Wilcox
2020-10-06 11:29   ` Jeff Layton
2020-10-06 11:29     ` [Ocfs2-devel] " Jeff Layton
2020-10-06 17:20   ` Jeff Layton
2020-10-06 17:20     ` [Ocfs2-devel] " Jeff Layton
2020-10-04 18:04 ` [PATCH 4/7] ocfs2: " Matthew Wilcox (Oracle)
2020-10-04 18:04   ` [Ocfs2-devel] " Matthew Wilcox
2020-10-04 18:04 ` [PATCH 5/7] btrfs: " Matthew Wilcox (Oracle)
2020-10-04 18:04   ` [Ocfs2-devel] " Matthew Wilcox
2020-10-09 14:18   ` Josef Bacik
2020-10-09 14:18     ` [Ocfs2-devel] " Josef Bacik
2020-10-26 17:02   ` David Sterba
2020-10-26 17:02     ` [Ocfs2-devel] " David Sterba
2020-10-04 18:04 ` [PATCH 6/7] " Matthew Wilcox (Oracle)
2020-10-04 18:04   ` [Ocfs2-devel] " Matthew Wilcox
2020-10-09 14:18   ` Josef Bacik
2020-10-09 14:18     ` [Ocfs2-devel] " Josef Bacik
2020-10-26 16:35   ` David Sterba
2020-10-26 16:35     ` [Ocfs2-devel] " David Sterba
2020-10-26 16:44     ` Matthew Wilcox
2020-10-26 16:44       ` [Ocfs2-devel] " Matthew Wilcox
2020-10-26 17:03       ` David Sterba
2020-10-26 17:03         ` [Ocfs2-devel] " David Sterba
2020-10-04 18:04 ` [PATCH 7/7] btrfs: Promote to unsigned long long before multiplying Matthew Wilcox (Oracle)
2020-10-04 18:04   ` [Ocfs2-devel] " Matthew Wilcox
2020-10-26 16:21   ` David Sterba
2020-10-26 16:21     ` [Ocfs2-devel] " David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.