linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] vfs: change sb->s_maxbytes to loff_t (try #2)
@ 2009-08-10 12:17 Jeff Layton
  2009-08-10 12:17 ` [PATCH 1/3] vfs: make get_sb_pseudo set s_maxbytes to value that can be cast to signed Jeff Layton
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Jeff Layton @ 2009-08-10 12:17 UTC (permalink / raw)
  To: linux-fsdevel, linux-kernel; +Cc: akpm, hch, rlove, msb, viro, hannes

This is the second attempt at a set to convert s_maxbytes to loff_t. The
first set had a patch for fiemap that doesn't seem to actually be needed
and removed a check from do_sendfile that does seem to be needed. This
set should fix those problems and also cleans up the warning in
vfs_kern_mount a bit.

Recently, I spent a day or so tracking down a long-standing problem with
CIFS and sendfile(). The problem turned out to be that CIFS was setting
s_maxbytes to a value that, when cast to a signed value, became
negative. This broke the offset checks in do_sendfile().

While I fixed this in CIFS, it turns out that this problem is actually a
little more widespread. Since setting s_maxbytes to a value larger than
MAX_LFS_FILESIZE breaks things, I believe it makes sense to turn
s_maxbytes into an loff_t. Most of the places that compare values to
s_maxbytes are comparing it against signed loff_t values, so this change
should help reduce the amount of implicit conversion that needs to be
done.

I've looked at the places that use s_maxbytes and didn't see any that
would immediately break with this change. That said, some of the
calculations that filesystems use to set s_maxbytes are convoluted, so
it's possible that I missed some. A critical eye toward that when
reviewing would be good.

This set is only lightly tested, but it's fairly straightforward. Many
thanks to those that have reviewed this so far.

Jeff Layton (3):
  vfs: make get_sb_pseudo set s_maxbytes to value that can be cast to
    signed
  vfs: remove redundant position check in do_sendfile
  vfs: change sb->s_maxbytes to a loff_t

 fs/libfs.c         |    2 +-
 fs/read_write.c    |    3 ---
 fs/super.c         |   10 ++++++++++
 include/linux/fs.h |    2 +-
 4 files changed, 12 insertions(+), 5 deletions(-)


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

end of thread, other threads:[~2009-08-10 21:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-10 12:17 [PATCH 0/3] vfs: change sb->s_maxbytes to loff_t (try #2) Jeff Layton
2009-08-10 12:17 ` [PATCH 1/3] vfs: make get_sb_pseudo set s_maxbytes to value that can be cast to signed Jeff Layton
2009-08-10 13:49   ` Christoph Hellwig
2009-08-10 14:08     ` Jeff Layton
2009-08-10 14:16       ` Christoph Hellwig
2009-08-10 12:17 ` [PATCH 2/3] vfs: remove redundant position check in do_sendfile Jeff Layton
2009-08-10 14:56   ` Johannes Weiner
2009-08-10 12:17 ` [PATCH 3/3] vfs: change sb->s_maxbytes to a loff_t Jeff Layton
2009-08-10 21:24   ` Mandeep Singh Baines

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).