ltp.lists.linux.it archive mirror
 help / color / mirror / Atom feed
  • * Re: [LTP] LTP test df01.sh detected different size of loop device in v5.19
           [not found] <YvZTpQFinpkB06p9@pevik>
           [not found] ` <YvZUfq+3HYwXEncw@pevik>
    @ 2022-08-14 22:44 ` Dave Chinner
      2022-08-15  9:31   ` Petr Vorel
      1 sibling, 1 reply; 13+ messages in thread
    From: Dave Chinner @ 2022-08-14 22:44 UTC (permalink / raw)
      To: Petr Vorel
      Cc: Jens Axboe, linux-xfs, Jan Kara, linux-block, Hannes Reinecke, ltp
    
    On Fri, Aug 12, 2022 at 03:20:37PM +0200, Petr Vorel wrote:
    > Hi all,
    > 
    > LTP test df01.sh found different size of loop device in v5.19.
    > Test uses loop device formatted on various file systems, only XFS fails.
    > It randomly fails during verifying that loop size usage changes:
    > 
    > grep ${TST_DEVICE} output | grep -q "${total}.*${used}" [1]
    > 
    > How to reproduce:
    > # PATH="/opt/ltp/testcases/bin:$PATH" df01.sh -f xfs # it needs several tries to hit
    > 
    > df saved output:
    > Filesystem     1024-blocks    Used Available Capacity Mounted on
    > ...
    > /dev/loop0          256672   16208    240464       7% /tmp/LTP_df01.1kRwoUCCR7/mntpoint
    > df output:
    > Filesystem     1024-blocks    Used Available Capacity Mounted on
    > ...
    > tmpfs               201780       0    201780       0% /run/user/0
    > /dev/loop0          256672   15160    241512       6% /tmp/LTP_df01.1kRwoUCCR7/mntpoint
    > => different size
    > df01 4 TFAIL: 'df -k -P' failed, not expected.
    
    Yup, most likely because we changed something in XFS related to
    internal block reservation spaces. That is, the test is making
    fundamentally flawed assumptions about filesystem used space
    accounting.
    
    It is wrong to assuming that the available capacity of a given empty
    filesystem will never change.  Assumptions like this have been
    invalid for decades because the available space can change based on
    the underlying configuration or the filesystem. e.g. different
    versions of mkfs.xfs set different default parameters and so simply
    changing the version of xfsprogs you use between the two comparision
    tests will make it fail....
    
    And, well, XFS also has XFS_IOC_{GS}ET_RESBLKS ioctls that allow
    userspace to change the amount of reserved blocks. They were
    introduced in 1997, and since then we've changed the default
    reservation the filesystem takes at least a dozen times.
    
    > > It might be a false positive / bug in the test, but it's at least a changed behavior.
    
    Yup, any test that assumes "available space" does not change from
    kernel version to kernel version is flawed. There is no guarantee
    that this ever stays the same, nor that it needs to stay the same.
    
    > > I was able to reproduce it on v5.19 distro kernels (openSUSE, Debian).
    > > I haven't bisected (yet), nor checked Jens' git tree (maybe it has been fixed).
    > 
    > Forget to note dmesg "operation not supported error" warning on *each* run (even
    > successful) on affected v5.19:
    > [ 5097.594021] loop0: detected capacity change from 0 to 524288
    > [ 5097.658201] operation not supported error, dev loop0, sector 262192 op 0x9:(WRITE_ZEROES) flags 0x8000800 phys_seg 0 prio class 0
    > [ 5097.675670] XFS (loop0): Mounting V5 Filesystem
    > [ 5097.681668] XFS (loop0): Ending clean mount
    > [ 5097.956445] XFS (loop0): Unmounting Filesystem
    
    That warning is from mkfs attempting to use fallocate(ZERO_RANGE) to
    offload the zeroing of the journal to the block device. It would
    seem that the loop device image file is being hosted on a filesystem
    that does not support the fallocate() ZERO_RANGE (or maybe
    PUNCH_HOLE) operation. That warning should simply be removed - it
    serves no useful purpose to a user...
    
    CHeers,
    
    Dave.
    
    -- 
    Dave Chinner
    david@fromorbit.com
    
    -- 
    Mailing list info: https://lists.linux.it/listinfo/ltp
    
    ^ permalink raw reply	[flat|nested] 13+ messages in thread

  • end of thread, other threads:[~2022-08-19 19:31 UTC | newest]
    
    Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
    -- links below jump to the message on this page --
         [not found] <YvZTpQFinpkB06p9@pevik>
         [not found] ` <YvZUfq+3HYwXEncw@pevik>
    2022-08-12 14:00   ` [LTP] LTP test df01.sh detected different size of loop device in v5.19 Petr Vorel
    2022-08-14 22:44 ` Dave Chinner
    2022-08-15  9:31   ` Petr Vorel
    2022-08-15 20:09     ` Eric Sandeen
    2022-08-18 15:25       ` Petr Vorel
    2022-08-18 16:05         ` Eric Sandeen
    2022-08-18 16:27           ` Darrick J. Wong
    2022-08-18 17:01             ` Petr Vorel
    2022-08-18 21:19               ` Eric Sandeen
    2022-08-19 16:00                 ` Petr Vorel
    2022-08-19 16:06                   ` Bird, Tim
    2022-08-19 19:30                     ` Petr Vorel
    2022-08-18 21:02           ` Dave Chinner
    

    This is a public inbox, see mirroring instructions
    for how to clone and mirror all data and code used for this inbox;
    as well as URLs for NNTP newsgroup(s).