From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754702AbZHGW1x (ORCPT ); Fri, 7 Aug 2009 18:27:53 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753130AbZHGW1w (ORCPT ); Fri, 7 Aug 2009 18:27:52 -0400 Received: from cmpxchg.org ([85.214.51.133]:49601 "EHLO cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751528AbZHGW1v (ORCPT ); Fri, 7 Aug 2009 18:27:51 -0400 Date: Sat, 8 Aug 2009 00:28:13 +0200 From: Johannes Weiner To: Jeff Layton Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, hch@infradead.org, rlove@google.com, msb@google.com, viro@zeniv.linux.org.uk Subject: Re: [PATCH 1/4] vfs: make get_sb_pseudo set s_maxbytes to value that can be cast to signed Message-ID: <20090807222813.GB28019@cmpxchg.org> References: <1249671461-9071-1-git-send-email-jlayton@redhat.com> <1249671461-9071-2-git-send-email-jlayton@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1249671461-9071-2-git-send-email-jlayton@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 07, 2009 at 02:57:38PM -0400, Jeff Layton wrote: > This patch is a counterpart to the CIFS patch posted yesterday. I > believe either patch will fix the problem seen in do_sendfile since the > smaller s_maxbytes value for the two superblocks is used there. This refers to the 'yesterday' 2-3 weeks ago, no? :-) > get_sb_pseudo sets s_maxbytes to ~0ULL, which becomes negative when cast > to a signed value. Fix it to use MAX_LFS_FILESIZE which casts properly > to a positive signed value. I think the proper term is 'converted' in this case, not 'cast'. Even without casts it gets converted by arithmetic operands. > Signed-off-by: Jeff Layton Reviewed-by: Johannes Weiner > --- > fs/libfs.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/fs/libfs.c b/fs/libfs.c > index ddfa899..dcec3d3 100644 > --- a/fs/libfs.c > +++ b/fs/libfs.c > @@ -217,7 +217,7 @@ int get_sb_pseudo(struct file_system_type *fs_type, char *name, > return PTR_ERR(s); > > s->s_flags = MS_NOUSER; > - s->s_maxbytes = ~0ULL; > + s->s_maxbytes = MAX_LFS_FILESIZE; > s->s_blocksize = PAGE_SIZE; > s->s_blocksize_bits = PAGE_SHIFT; > s->s_magic = magic; > -- > 1.6.0.6