From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [patch 09/12] sendfile: several fixes Date: Thu, 6 Aug 2009 19:24:18 -0400 Message-ID: <20090806232418.GA6279@infradead.org> References: <200908062310.n76NAFKE012978@imap1.linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, msb@google.com, rlove@google.com To: akpm@linux-foundation.org Return-path: Received: from bombadil.infradead.org ([18.85.46.34]:44938 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932201AbZHFXYS (ORCPT ); Thu, 6 Aug 2009 19:24:18 -0400 Content-Disposition: inline In-Reply-To: <200908062310.n76NAFKE012978@imap1.linux-foundation.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Aug 06, 2009 at 04:10:15PM -0700, akpm@linux-foundation.org wrote: > From: Mandeep Singh Baines > > Three fixes for sendfile, mostly related to sending large files from pseudo > filesystems: > > - Fix sendfile for offsets > 300G. This can happen with pseudo filesystems. > This happens because the overflow check is using inode->i_sb->s_maxbytes > and not the superblock of the backing device's s_maxbytes. For a regular file > these are interchangible but for a special file these are different and you > want the latter. > > - Don't compare against the max of the out_inode's superblock. Doesn't make > sense. > > - For pseudo and other filesystems with s_maxbytes set to ~0ULL, max ends up > holding a negative number as it is signed. Check for and correct that. The right fix is to not set s_maxbytes to ~0ULL. Jeff Layton has sent some patches for that recently.