mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
fs: make block fiemap mapping length at least blocksize long
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 <[email protected]> Cc: Steven Whitehouse <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
3cd90ea42f
commit
d54cdc8ca7
1 changed files with 7 additions and 0 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue