linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Whitehouse <swhiteho@redhat.com>
To: Josef Bacik <josef@redhat.com>
Cc: linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: [PATCH] fs: make block fiemap mapping length at least blocksize long
Date: Tue, 01 Feb 2011 11:46:50 +0000	[thread overview]
Message-ID: <1296560810.2586.12.camel@dolmen> (raw)
In-Reply-To: <1291827790-21377-1-git-send-email-josef@redhat.com>

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



  reply	other threads:[~2011-02-01 11:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2011-02-01 20:28   ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1296560810.2586.12.camel@dolmen \
    --to=swhiteho@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=josef@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).