Test generic/614
Hello Filipe!
I have noticed test generic/614 is failing on ext2. The test creates sparse file, maps it, and writes data to it through mmap. Then it checks i_blocks has increased. However for ext2 (and other trivial filesystems supporting sparse files but not implementing delayed allocation) this is bound to fail because i_block gets incremented only during page writeback.
So would your btrfs test make sense even if we called fsync(2) before checking stat(2) results?
Honza
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Quoted 2 lines · Jan Kara
Hello Filipe!
Hi Jan!
Quoted 9 lines
I have noticed test generic/614 is failing on ext2. The test creates sparse file, maps it, and writes data to it through mmap. Then it checks
i_blockshas increased. However for ext2 (and other trivial filesystems supporting sparse files but not implementing delayed allocation) this is bound to fail becausei_blockgets incremented only during page writeback.So would your btrfs test make sense even if we called fsync(2) before checking stat(2) results?
Calling fsync before calling stat would defeat the purpose of the test. I.e. the test would pass both with and without the btrfs fix.
So maybe adding the following to the test:
_supported_fs ^ext2
And listing all other filesystems not supporting delayed allocation?
Or adding a _require_delayed_allocation() helper to make it _notrun().
Thanks.
Quoted 5 lines
Honza
--
Jan Kara <[email protected]>
SUSE Labs, CR
Quoted 16 lines · Filipe Manana
Quoted 2 lines · Jan Kara
Hello Filipe!
Hi Jan!
Quoted 9 lines
I have noticed test generic/614 is failing on ext2. The test creates sparse file, maps it, and writes data to it through mmap. Then it checks
i_blockshas increased. However for ext2 (and other trivial filesystems supporting sparse files but not implementing delayed allocation) this is bound to fail becausei_blockgets incremented only during page writeback.So would your btrfs test make sense even if we called fsync(2) before checking stat(2) results?
Quoted 8 lines
Calling fsync before calling stat would defeat the purpose of the test. I.e. the test would pass both with and without the btrfs fix.
So maybe adding the following to the test:
_supported_fs^ext2And listing all other filesystems not supporting delayed allocation?
Yeah, probably something like this. In fact, it is a filesystem bug that we don't reserve space for blocks written through mmap but one that is basically by design and difficult to fix. I'll think how to best avoid this failure.
Honza
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Quoted 19 lines · Filipe Manana
Quoted 2 lines · Jan Kara
Hello Filipe!
Hi Jan!
Quoted 9 lines
I have noticed test generic/614 is failing on ext2. The test creates sparse file, maps it, and writes data to it through mmap. Then it checks
i_blockshas increased. However for ext2 (and other trivial filesystems supporting sparse files but not implementing delayed allocation) this is bound to fail becausei_blockgets incremented only during page writeback.So would your btrfs test make sense even if we called fsync(2) before checking stat(2) results?
Calling fsync before calling stat would defeat the purpose of the test. I.e. the test would pass both with and without the btrfs fix.
Quoted 7 lines
So maybe adding the following to the test:
_supported_fs^ext2And listing all other filesystems not supporting delayed allocation?
Or adding a
_require_delayed_allocation()helper to make it_notrun().
_require_scratch_delalloc() ?
--D
Quoted 9 lines
Thanks.
Quoted 5 lines
Honza
--
Jan Kara <[email protected]>
SUSE Labs, CR
Quoted 22 lines · Darrick J. Wong
Quoted 21 lines · Filipe Manana
Quoted 2 lines · Jan Kara
Hello Filipe!
Hi Jan!
Quoted 9 lines
I have noticed test generic/614 is failing on ext2. The test creates sparse file, maps it, and writes data to it through mmap. Then it checks
i_blockshas increased. However for ext2 (and other trivial filesystems supporting sparse files but not implementing delayed allocation) this is bound to fail becausei_blockgets incremented only during page writeback.So would your btrfs test make sense even if we called fsync(2) before checking stat(2) results?
Calling fsync before calling stat would defeat the purpose of the test. I.e. the test would pass both with and without the btrfs fix.
So maybe adding the following to the test:
Quoted 7 lines
Quoted 5 lines
_supported_fs^ext2And listing all other filesystems not supporting delayed allocation?
Or adding a
_require_delayed_allocation()helper to make it_notrun().
_require_scratch_delalloc()?
Yeah, after some experimentation I think I can even sensibly detect delalloc using filefrag(1) (xfs_io's fiemap command always syncs file before doing fiemap). I'll give it a shot.
Honza
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR
Quoted 27 lines · Jan Kara
Quoted 26 lines · Darrick J. Wong
Quoted 25 lines · Filipe Manana
Quoted 2 lines · Jan Kara
Hello Filipe!
Hi Jan!
Quoted 9 lines
I have noticed test generic/614 is failing on ext2. The test creates sparse file, maps it, and writes data to it through mmap. Then it checks
i_blockshas increased. However for ext2 (and other trivial filesystems supporting sparse files but not implementing delayed allocation) this is bound to fail becausei_blockgets incremented only during page writeback.So would your btrfs test make sense even if we called fsync(2) before checking stat(2) results?
Calling fsync before calling stat would defeat the purpose of the test. I.e. the test would pass both with and without the btrfs fix.
So maybe adding the following to the test:
_supported_fs^ext2And listing all other filesystems not supporting delayed allocation?
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Or adding a
_require_delayed_allocation()helper to make it_notrun().
_require_scratch_delalloc()?Yeah, after some experimentation I think I can even sensibly detect delalloc using filefrag(1) (xfs_io's fiemap command always syncs file before doing fiemap). I'll give it a shot.
Aha, _require_scratch_delalloc already exists ;)
Honza
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR