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

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 casting that's done in the
code.

I've looked at most of the places that use s_maxbytes and have tried to
fix areas that look like they might have problems with this change. It's
quite possible though that I've missed some, so a careful eye for that
when reviewing this would be a good thing.

This set is only lightly tested, but it's fairly straightforward.

Jeff Layton (4):
  vfs: make get_sb_pseudo set s_maxbytes to value that can be cast to
    signed
  vfs: explicitly cast s_maxbytes in fiemap_check_ranges
  vfs: change sb->s_maxbytes to a loff_t
  vfs: remove redundant checks in do_sendfile

 fs/ioctl.c         |    9 +++++----
 fs/libfs.c         |    2 +-
 fs/read_write.c    |   11 -----------
 fs/super.c         |   10 ++++++++++
 include/linux/fs.h |    2 +-
 5 files changed, 17 insertions(+), 17 deletions(-)


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

end of thread, other threads:[~2009-08-08 11:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-07 18:57 [PATCH 0/4] vfs: change sb->s_maxbytes to loff_t Jeff Layton
2009-08-07 18:57 ` [PATCH 1/4] vfs: make get_sb_pseudo set s_maxbytes to value that can be cast to signed Jeff Layton
2009-08-07 22:28   ` Johannes Weiner
2009-08-07 18:57 ` [PATCH 2/4] vfs: explicitly cast s_maxbytes in fiemap_check_ranges Jeff Layton
2009-08-07 22:12   ` Johannes Weiner
2009-08-08 11:20     ` Jeff Layton
2009-08-07 18:57 ` [PATCH 3/4] vfs: change sb->s_maxbytes to a loff_t Jeff Layton
2009-08-07 20:14   ` Andreas Dilger
2009-08-07 22:51   ` Johannes Weiner
2009-08-08 11:15     ` Jeff Layton
2009-08-07 18:57 ` [PATCH 4/4] vfs: remove redundant checks in do_sendfile Jeff Layton
2009-08-07 20:58   ` Mandeep Singh Baines
2009-08-07 21:05     ` Jeff Layton

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).