All of lore.kernel.org
 help / color / mirror / Atom feed
* Test generic/614
@ 2022-11-21 12:36 Jan Kara
  2022-11-21 13:32 ` Filipe Manana
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Kara @ 2022-11-21 12:36 UTC (permalink / raw)
  To: Filipe Manana; +Cc: fstests

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
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Test generic/614
  2022-11-21 12:36 Test generic/614 Jan Kara
@ 2022-11-21 13:32 ` Filipe Manana
  2022-11-21 16:18   ` Jan Kara
  2022-11-21 16:51   ` Darrick J. Wong
  0 siblings, 2 replies; 6+ messages in thread
From: Filipe Manana @ 2022-11-21 13:32 UTC (permalink / raw)
  To: Jan Kara; +Cc: fstests

On Mon, Nov 21, 2022 at 12:37 PM Jan Kara <jack@suse.cz> wrote:
>
> Hello Filipe!

Hi Jan!

>
> 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?

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.



>
>                                                                 Honza
> --
> Jan Kara <jack@suse.com>
> SUSE Labs, CR

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Test generic/614
  2022-11-21 13:32 ` Filipe Manana
@ 2022-11-21 16:18   ` Jan Kara
  2022-11-21 16:51   ` Darrick J. Wong
  1 sibling, 0 replies; 6+ messages in thread
From: Jan Kara @ 2022-11-21 16:18 UTC (permalink / raw)
  To: Filipe Manana; +Cc: Jan Kara, fstests

On Mon 21-11-22 13:32:22, Filipe Manana wrote:
> On Mon, Nov 21, 2022 at 12:37 PM Jan Kara <jack@suse.cz> wrote:
> >
> > Hello Filipe!
> 
> Hi Jan!
> 
> >
> > 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?
> 
> 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?

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
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Test generic/614
  2022-11-21 13:32 ` Filipe Manana
  2022-11-21 16:18   ` Jan Kara
@ 2022-11-21 16:51   ` Darrick J. Wong
  2022-11-22 12:52     ` Jan Kara
  1 sibling, 1 reply; 6+ messages in thread
From: Darrick J. Wong @ 2022-11-21 16:51 UTC (permalink / raw)
  To: Filipe Manana; +Cc: Jan Kara, fstests

On Mon, Nov 21, 2022 at 01:32:22PM +0000, Filipe Manana wrote:
> On Mon, Nov 21, 2022 at 12:37 PM Jan Kara <jack@suse.cz> wrote:
> >
> > Hello Filipe!
> 
> Hi Jan!
> 
> >
> > 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?
> 
> 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().

_require_scratch_delalloc() ?

--D

> Thanks.
> 
> 
> 
> >
> >                                                                 Honza
> > --
> > Jan Kara <jack@suse.com>
> > SUSE Labs, CR

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Test generic/614
  2022-11-21 16:51   ` Darrick J. Wong
@ 2022-11-22 12:52     ` Jan Kara
  2022-11-22 14:10       ` Jan Kara
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Kara @ 2022-11-22 12:52 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Filipe Manana, Jan Kara, fstests

On Mon 21-11-22 08:51:43, Darrick J. Wong wrote:
> On Mon, Nov 21, 2022 at 01:32:22PM +0000, Filipe Manana wrote:
> > On Mon, Nov 21, 2022 at 12:37 PM Jan Kara <jack@suse.cz> wrote:
> > >
> > > Hello Filipe!
> > 
> > Hi Jan!
> > 
> > >
> > > 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?
> > 
> > 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().
> 
> _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
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Test generic/614
  2022-11-22 12:52     ` Jan Kara
@ 2022-11-22 14:10       ` Jan Kara
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Kara @ 2022-11-22 14:10 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Filipe Manana, Jan Kara, fstests

On Tue 22-11-22 13:52:41, Jan Kara wrote:
> On Mon 21-11-22 08:51:43, Darrick J. Wong wrote:
> > On Mon, Nov 21, 2022 at 01:32:22PM +0000, Filipe Manana wrote:
> > > On Mon, Nov 21, 2022 at 12:37 PM Jan Kara <jack@suse.cz> wrote:
> > > >
> > > > Hello Filipe!
> > > 
> > > Hi Jan!
> > > 
> > > >
> > > > 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?
> > > 
> > > 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().
> > 
> > _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
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-11-22 14:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-21 12:36 Test generic/614 Jan Kara
2022-11-21 13:32 ` Filipe Manana
2022-11-21 16:18   ` Jan Kara
2022-11-21 16:51   ` Darrick J. Wong
2022-11-22 12:52     ` Jan Kara
2022-11-22 14:10       ` Jan Kara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.