All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs: make block fiemap mapping length at least blocksize long
@ 2010-12-08 17:03 Josef Bacik
  2011-02-01 11:46 ` Steven Whitehouse
  0 siblings, 1 reply; 3+ messages in thread
From: Josef Bacik @ 2010-12-08 17:03 UTC (permalink / raw)
  To: linux-fsdevel, akpm, swhiteho

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 <josef@redhat.com>
---
 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);
 
-- 
1.6.6.1


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

* Re: [PATCH] fs: make block fiemap mapping length at least blocksize long
  2010-12-08 17:03 [PATCH] fs: make block fiemap mapping length at least blocksize long Josef Bacik
@ 2011-02-01 11:46 ` Steven Whitehouse
  2011-02-01 20:28   ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Whitehouse @ 2011-02-01 11:46 UTC (permalink / raw)
  To: Josef Bacik; +Cc: linux-fsdevel, akpm

Hi,

Is there any reason this cannot be sent to Linus now?

Steve.

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 <josef@redhat.com>
> ---
>  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);
>  



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

* Re: [PATCH] fs: make block fiemap mapping length at least blocksize long
  2011-02-01 11:46 ` Steven Whitehouse
@ 2011-02-01 20:28   ` Andrew Morton
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2011-02-01 20:28 UTC (permalink / raw)
  To: Steven Whitehouse; +Cc: Josef Bacik, linux-fsdevel

On Tue, 01 Feb 2011 11:46:50 +0000
Steven Whitehouse <swhiteho@redhat.com> 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 <josef@redhat.com>
> > ---
> >  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 :(


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

end of thread, other threads:[~2011-02-01 20:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-08 17:03 [PATCH] fs: make block fiemap mapping length at least blocksize long Josef Bacik
2011-02-01 11:46 ` Steven Whitehouse
2011-02-01 20:28   ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.