From 483691f36307be815003a40825b00bbd9bcb21d3 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Tue, 1 Feb 2011 15:52:47 -0800 Subject: [PATCH] --- yaml --- r: 232738 b: refs/heads/master c: d54cdc8ca7aabc69e145a62155855db42b04ed0b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ioctl.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index c5ba8d9b2a73..c42004794c85 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3cd90ea42f2c15f928b70ed66f6d8ed0a8e7aadd +refs/heads/master: d54cdc8ca7aabc69e145a62155855db42b04ed0b diff --git a/trunk/fs/ioctl.c b/trunk/fs/ioctl.c index a59635e295fa..1eebeb72b202 100644 --- a/trunk/fs/ioctl.c +++ b/trunk/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);