From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH] fs: make block fiemap mapping length at least blocksize long Date: Tue, 1 Feb 2011 12:28:37 -0800 Message-ID: <20110201122837.7a83fdec.akpm@linux-foundation.org> References: <1291827790-21377-1-git-send-email-josef@redhat.com> <1296560810.2586.12.camel@dolmen> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Josef Bacik , linux-fsdevel@vger.kernel.org To: Steven Whitehouse Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:40913 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751622Ab1BAU3T (ORCPT ); Tue, 1 Feb 2011 15:29:19 -0500 In-Reply-To: <1296560810.2586.12.camel@dolmen> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, 01 Feb 2011 11:46:50 +0000 Steven Whitehouse wrote: > On Wed, 2010-12-08 at 12:03 -0500, Josef Bacik wrote: > > Some filesystems don't deal well with being asked to map less than blocksize > > blocks (GFS2 for example). Since we are always mapping at least blocksize > > sections anyway, just make sure len is at least as big as a blocksize so we > > don't trip up any filesystems. Thanks, > > > > Signed-off-by: Josef Bacik > > --- > > fs/ioctl.c | 7 +++++++ > > 1 files changed, 7 insertions(+), 0 deletions(-) > > > > diff --git a/fs/ioctl.c b/fs/ioctl.c > > index d6cc164..6b53c24 100644 > > --- a/fs/ioctl.c > > +++ b/fs/ioctl.c > > @@ -273,6 +273,13 @@ int __generic_block_fiemap(struct inode *inode, > > len = isize; > > } > > > > + /* > > + * Some filesystems can't deal with being asked to map less than > > + * blocksize, so make sure our len is at least block length. > > + */ > > + if (logical_to_blk(inode, len) == 0) > > + len = blk_to_logical(inode, 1); > > + > > start_blk = logical_to_blk(inode, start); > > last_blk = logical_to_blk(inode, start + len - 1); > > (top-posting repaired) > Hi, > > Is there any reason this cannot be sent to Linus now? > I sent it to viro a couple of weeks back and it was ignored. I don't know why this happens :(