generic: Add test to check for mounting a huge sparse dm device
authorRitesh Harjani <riteshh@linux.ibm.com>
Wed, 9 Dec 2020 04:03:41 +0000 (09:33 +0530)
committerEryu Guan <guaneryu@gmail.com>
Sun, 20 Dec 2020 16:18:42 +0000 (00:18 +0800)
commit72dc169b442eefea2668e02277621a2cc9db9474
tree59106c7c184361cf6983988c45142042b812b1b4
parent2a7406efecc29471420390f479eec4c1285b0d01
generic: Add test to check for mounting a huge sparse dm device

Add this test to check for regression which was reported when ext4 bmap
aops was moved to use iomap APIs. jbd2 calls bmap() kernel function
from fs/inode.c which was failing since iomap_bmap() implementation earlier
returned 0 for block addr > INT_MAX.
This regression was fixed with following kernel commit [1]
commit b75dfde1212991b24b220c3995101c60a7b8ae74
("fibmap: Warn and return an error in case of block > INT_MAX")
[1]: https://patchwork.ozlabs.org/patch/1279914

w/o the kernel fix we get below errors and mount fails

[ 1461.988701] run fstests generic/613 at 2020-10-27 19:57:34
[ 1530.406645] ------------[ cut here ]------------
[ 1530.407332] would truncate bmap result
[ 1530.408956] WARNING: CPU: 0 PID: 6401 at fs/iomap/fiemap.c:116 iomap_bmap_actor+0x43/0x50
[ 1530.410607] Modules linked in:
[ 1530.411024] CPU: 0 PID: 6401 Comm: mount Tainted: G        W
<...>
[ 1530.511978] jbd2_journal_init_inode: Cannot locate journal superblock
[ 1530.513310] EXT4-fs (dm-1): Could not load journal inode

Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
common/rc
tests/generic/620 [new file with mode: 0755]
tests/generic/620.out [new file with mode: 0644]
tests/generic/group