Message ID | 20220527121115.34358-1-zlang@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2] common/filter: filter out extra mount error output | expand |
On Fri, May 27, 2022 at 08:11:15PM +0800, Zorro Lang wrote: > The lastest mount command (from util-linux) merged below commit: > 79534c0d7e0f ("mount: add hint about dmesg(8) to error messages") > which brought in a new error output when mount fails, no matter > ro/rw/busy mount fails. > > That cause some cases (e.g. xfs/005) fail as: > mount: Structure needs cleaning > dmesg(1) may have more information after failed mount system call > > More failed cases like generic/050, ext4/002, xfs/154, xfs/158 etc. > Especially xfs/154 and xfs/158, need to change their _filter_scratch > to _filter_error_mount. > > Signed-off-by: Zorro Lang <zlang@kernel.org> > --- > > Thanks the review points from Dave. This V2 turn to filter out the error in > _filter_error/ro/busy_mount. And change xfs/154 and xfs/158 to use > _filter_error_mount. Ping, hope to get review :) > > Thanks, > Zorro > > common/filter | 13 +++++++++++-- > tests/xfs/154 | 2 +- > tests/xfs/154.out | 2 +- > tests/xfs/158 | 2 +- > tests/xfs/158.out | 2 +- > 5 files changed, 15 insertions(+), 6 deletions(-) > > diff --git a/common/filter b/common/filter > index a6a42b7a..14f6a027 100644 > --- a/common/filter > +++ b/common/filter > @@ -380,6 +380,8 @@ _filter_ending_dot() > # ancient: mount: cannot remount block device <device> read-write, is write-protected > # prior to v2.30: mount: cannot remount <device> read-write, is write-protected > # v2.30 and later: mount: <mountpoint>: cannot remount <device> read-write, is write-protected. > +# v2.38 and later: > +# dmesg(1) may have more information after failed mount mount system call > # > # Now use _filter_ro_mount to unify all these differences across old & new > # util-linux versions. So the filtered format would be: > @@ -412,7 +414,8 @@ _filter_ro_mount() { > print "mount: cannot remount device read-write, is write-protected\n"; > } else { > print "$_"; > - }' | _filter_ending_dot > + }' | grep -v "dmesg(1) may have more information after failed mount" | \ > + _filter_ending_dot > } > > # Filter a failed mount output due to EUCLEAN and USTALE, util-linux changed > @@ -424,6 +427,8 @@ _filter_ro_mount() { > # mount: mount <device> on <mountpoint> failed: Structure needs cleaning > # v2.30 and later: > # mount: <mountpoint>: mount(2) system call failed: Structure needs cleaning. > +# v2.38 and later: > +# dmesg(1) may have more information after failed mount mount system call > # > # This is also true for ESTALE error. So let's remove all the changing parts > # and keep the 'prior to v2.21' format: > @@ -431,7 +436,8 @@ _filter_ro_mount() { > # mount: Stale file handle > _filter_error_mount() > { > - sed -e "s/mount:\(.*failed:\)/mount:/" | _filter_ending_dot > + grep -v "dmesg(1) may have more information after failed mount" | \ > + sed -e "s/mount:\(.*failed:\)/mount:/" | _filter_ending_dot > } > > # Similar to _filter_error_mount, filter a busy mount output. > @@ -440,8 +446,11 @@ _filter_error_mount() > # old: mount: <device> is already mounted or <mountpoint> busy > # new: mount: <mountpoint>: <device> already mounted or mount point busy. > # filtered: mount: device already mounted or mount point busy > +# v2.38 and later, filter out: > +# dmesg(1) may have more information after failed mount mount system call > _filter_busy_mount() > { > + grep -v "dmesg(1) may have more information after failed mount" | \ > sed -e "s/.*: .* already mounted or .* busy/mount: device already mounted or mount point busy/" | \ > _filter_ending_dot > } > diff --git a/tests/xfs/154 b/tests/xfs/154 > index 3f90a397..548c9490 100755 > --- a/tests/xfs/154 > +++ b/tests/xfs/154 > @@ -48,7 +48,7 @@ test $? -eq 137 || echo "repair should have been killed??" > _check_scratch_xfs_features NEEDSREPAIR > _try_scratch_mount &> $tmp.mount > res=$? > -_filter_scratch < $tmp.mount > +_filter_error_mount < $tmp.mount > if [ $res -eq 0 ]; then > echo "Should not be able to mount after needsrepair crash" > _scratch_unmount > diff --git a/tests/xfs/154.out b/tests/xfs/154.out > index 12f154ab..1263f091 100644 > --- a/tests/xfs/154.out > +++ b/tests/xfs/154.out > @@ -1,4 +1,4 @@ > QA output created by 154 > FEATURES: NEEDSREPAIR:YES > -mount: SCRATCH_MNT: mount(2) system call failed: Structure needs cleaning. > +mount: Structure needs cleaning > FEATURES: NEEDSREPAIR:NO > diff --git a/tests/xfs/158 b/tests/xfs/158 > index 505a9c73..4440adf6 100755 > --- a/tests/xfs/158 > +++ b/tests/xfs/158 > @@ -51,7 +51,7 @@ test $? -eq 137 || echo "repair should have been killed??" > _check_scratch_xfs_features NEEDSREPAIR INOBTCNT > _try_scratch_mount &> $tmp.mount > res=$? > -_filter_scratch < $tmp.mount > +_filter_error_mount < $tmp.mount > if [ $res -eq 0 ]; then > echo "needsrepair should have prevented mount" > _scratch_unmount > diff --git a/tests/xfs/158.out b/tests/xfs/158.out > index 4f9dfd08..5461031a 100644 > --- a/tests/xfs/158.out > +++ b/tests/xfs/158.out > @@ -8,7 +8,7 @@ FEATURES: INOBTCNT:NO > Fail partway through upgrading > Adding inode btree counts to filesystem. > FEATURES: NEEDSREPAIR:YES INOBTCNT:YES > -mount: SCRATCH_MNT: mount(2) system call failed: Structure needs cleaning. > +mount: Structure needs cleaning > Re-run repair to finish upgrade > FEATURES: NEEDSREPAIR:NO INOBTCNT:YES > Filesystem should be usable again > -- > 2.31.1 >
On Fri, May 27, 2022 at 08:11:15PM +0800, Zorro Lang wrote: > The lastest mount command (from util-linux) merged below commit: > 79534c0d7e0f ("mount: add hint about dmesg(8) to error messages") > which brought in a new error output when mount fails, no matter > ro/rw/busy mount fails. > > That cause some cases (e.g. xfs/005) fail as: > mount: Structure needs cleaning > dmesg(1) may have more information after failed mount system call > > More failed cases like generic/050, ext4/002, xfs/154, xfs/158 etc. > Especially xfs/154 and xfs/158, need to change their _filter_scratch > to _filter_error_mount. > > Signed-off-by: Zorro Lang <zlang@kernel.org> > --- > > Thanks the review points from Dave. This V2 turn to filter out the error in > _filter_error/ro/busy_mount. And change xfs/154 and xfs/158 to use > _filter_error_mount. > > Thanks, > Zorro > > common/filter | 13 +++++++++++-- > tests/xfs/154 | 2 +- > tests/xfs/154.out | 2 +- > tests/xfs/158 | 2 +- > tests/xfs/158.out | 2 +- > 5 files changed, 15 insertions(+), 6 deletions(-) > > diff --git a/common/filter b/common/filter > index a6a42b7a..14f6a027 100644 > --- a/common/filter > +++ b/common/filter > @@ -380,6 +380,8 @@ _filter_ending_dot() > # ancient: mount: cannot remount block device <device> read-write, is write-protected > # prior to v2.30: mount: cannot remount <device> read-write, is write-protected > # v2.30 and later: mount: <mountpoint>: cannot remount <device> read-write, is write-protected. > +# v2.38 and later: > +# dmesg(1) may have more information after failed mount mount system call > # > # Now use _filter_ro_mount to unify all these differences across old & new > # util-linux versions. So the filtered format would be: > @@ -412,7 +414,8 @@ _filter_ro_mount() { > print "mount: cannot remount device read-write, is write-protected\n"; > } else { > print "$_"; > - }' | _filter_ending_dot > + }' | grep -v "dmesg(1) may have more information after failed mount" | \ > + _filter_ending_dot > } > > # Filter a failed mount output due to EUCLEAN and USTALE, util-linux changed > @@ -424,6 +427,8 @@ _filter_ro_mount() { > # mount: mount <device> on <mountpoint> failed: Structure needs cleaning > # v2.30 and later: > # mount: <mountpoint>: mount(2) system call failed: Structure needs cleaning. > +# v2.38 and later: > +# dmesg(1) may have more information after failed mount mount system call > # > # This is also true for ESTALE error. So let's remove all the changing parts > # and keep the 'prior to v2.21' format: > @@ -431,7 +436,8 @@ _filter_ro_mount() { > # mount: Stale file handle > _filter_error_mount() > { > - sed -e "s/mount:\(.*failed:\)/mount:/" | _filter_ending_dot > + grep -v "dmesg(1) may have more information after failed mount" | \ > + sed -e "s/mount:\(.*failed:\)/mount:/" | _filter_ending_dot > } > > # Similar to _filter_error_mount, filter a busy mount output. > @@ -440,8 +446,11 @@ _filter_error_mount() > # old: mount: <device> is already mounted or <mountpoint> busy > # new: mount: <mountpoint>: <device> already mounted or mount point busy. > # filtered: mount: device already mounted or mount point busy > +# v2.38 and later, filter out: > +# dmesg(1) may have more information after failed mount mount system call > _filter_busy_mount() > { > + grep -v "dmesg(1) may have more information after failed mount" | \ > sed -e "s/.*: .* already mounted or .* busy/mount: device already mounted or mount point busy/" | \ > _filter_ending_dot > } > diff --git a/tests/xfs/154 b/tests/xfs/154 > index 3f90a397..548c9490 100755 > --- a/tests/xfs/154 > +++ b/tests/xfs/154 > @@ -48,7 +48,7 @@ test $? -eq 137 || echo "repair should have been killed??" > _check_scratch_xfs_features NEEDSREPAIR > _try_scratch_mount &> $tmp.mount > res=$? > -_filter_scratch < $tmp.mount > +_filter_error_mount < $tmp.mount > if [ $res -eq 0 ]; then > echo "Should not be able to mount after needsrepair crash" > _scratch_unmount > diff --git a/tests/xfs/154.out b/tests/xfs/154.out > index 12f154ab..1263f091 100644 > --- a/tests/xfs/154.out > +++ b/tests/xfs/154.out > @@ -1,4 +1,4 @@ > QA output created by 154 > FEATURES: NEEDSREPAIR:YES > -mount: SCRATCH_MNT: mount(2) system call failed: Structure needs cleaning. > +mount: Structure needs cleaning > FEATURES: NEEDSREPAIR:NO > diff --git a/tests/xfs/158 b/tests/xfs/158 > index 505a9c73..4440adf6 100755 > --- a/tests/xfs/158 > +++ b/tests/xfs/158 > @@ -51,7 +51,7 @@ test $? -eq 137 || echo "repair should have been killed??" > _check_scratch_xfs_features NEEDSREPAIR INOBTCNT > _try_scratch_mount &> $tmp.mount > res=$? > -_filter_scratch < $tmp.mount > +_filter_error_mount < $tmp.mount > if [ $res -eq 0 ]; then > echo "needsrepair should have prevented mount" > _scratch_unmount > diff --git a/tests/xfs/158.out b/tests/xfs/158.out > index 4f9dfd08..5461031a 100644 > --- a/tests/xfs/158.out > +++ b/tests/xfs/158.out > @@ -8,7 +8,7 @@ FEATURES: INOBTCNT:NO > Fail partway through upgrading > Adding inode btree counts to filesystem. > FEATURES: NEEDSREPAIR:YES INOBTCNT:YES > -mount: SCRATCH_MNT: mount(2) system call failed: Structure needs cleaning. > +mount: Structure needs cleaning > Re-run repair to finish upgrade > FEATURES: NEEDSREPAIR:NO INOBTCNT:YES > Filesystem should be usable again > -- > 2.31.1 > Looks good to me, Reviewed-by: Andrey Albershteyn <aalbersh@redhat.com>
diff --git a/common/filter b/common/filter index a6a42b7a..14f6a027 100644 --- a/common/filter +++ b/common/filter @@ -380,6 +380,8 @@ _filter_ending_dot() # ancient: mount: cannot remount block device <device> read-write, is write-protected # prior to v2.30: mount: cannot remount <device> read-write, is write-protected # v2.30 and later: mount: <mountpoint>: cannot remount <device> read-write, is write-protected. +# v2.38 and later: +# dmesg(1) may have more information after failed mount mount system call # # Now use _filter_ro_mount to unify all these differences across old & new # util-linux versions. So the filtered format would be: @@ -412,7 +414,8 @@ _filter_ro_mount() { print "mount: cannot remount device read-write, is write-protected\n"; } else { print "$_"; - }' | _filter_ending_dot + }' | grep -v "dmesg(1) may have more information after failed mount" | \ + _filter_ending_dot } # Filter a failed mount output due to EUCLEAN and USTALE, util-linux changed @@ -424,6 +427,8 @@ _filter_ro_mount() { # mount: mount <device> on <mountpoint> failed: Structure needs cleaning # v2.30 and later: # mount: <mountpoint>: mount(2) system call failed: Structure needs cleaning. +# v2.38 and later: +# dmesg(1) may have more information after failed mount mount system call # # This is also true for ESTALE error. So let's remove all the changing parts # and keep the 'prior to v2.21' format: @@ -431,7 +436,8 @@ _filter_ro_mount() { # mount: Stale file handle _filter_error_mount() { - sed -e "s/mount:\(.*failed:\)/mount:/" | _filter_ending_dot + grep -v "dmesg(1) may have more information after failed mount" | \ + sed -e "s/mount:\(.*failed:\)/mount:/" | _filter_ending_dot } # Similar to _filter_error_mount, filter a busy mount output. @@ -440,8 +446,11 @@ _filter_error_mount() # old: mount: <device> is already mounted or <mountpoint> busy # new: mount: <mountpoint>: <device> already mounted or mount point busy. # filtered: mount: device already mounted or mount point busy +# v2.38 and later, filter out: +# dmesg(1) may have more information after failed mount mount system call _filter_busy_mount() { + grep -v "dmesg(1) may have more information after failed mount" | \ sed -e "s/.*: .* already mounted or .* busy/mount: device already mounted or mount point busy/" | \ _filter_ending_dot } diff --git a/tests/xfs/154 b/tests/xfs/154 index 3f90a397..548c9490 100755 --- a/tests/xfs/154 +++ b/tests/xfs/154 @@ -48,7 +48,7 @@ test $? -eq 137 || echo "repair should have been killed??" _check_scratch_xfs_features NEEDSREPAIR _try_scratch_mount &> $tmp.mount res=$? -_filter_scratch < $tmp.mount +_filter_error_mount < $tmp.mount if [ $res -eq 0 ]; then echo "Should not be able to mount after needsrepair crash" _scratch_unmount diff --git a/tests/xfs/154.out b/tests/xfs/154.out index 12f154ab..1263f091 100644 --- a/tests/xfs/154.out +++ b/tests/xfs/154.out @@ -1,4 +1,4 @@ QA output created by 154 FEATURES: NEEDSREPAIR:YES -mount: SCRATCH_MNT: mount(2) system call failed: Structure needs cleaning. +mount: Structure needs cleaning FEATURES: NEEDSREPAIR:NO diff --git a/tests/xfs/158 b/tests/xfs/158 index 505a9c73..4440adf6 100755 --- a/tests/xfs/158 +++ b/tests/xfs/158 @@ -51,7 +51,7 @@ test $? -eq 137 || echo "repair should have been killed??" _check_scratch_xfs_features NEEDSREPAIR INOBTCNT _try_scratch_mount &> $tmp.mount res=$? -_filter_scratch < $tmp.mount +_filter_error_mount < $tmp.mount if [ $res -eq 0 ]; then echo "needsrepair should have prevented mount" _scratch_unmount diff --git a/tests/xfs/158.out b/tests/xfs/158.out index 4f9dfd08..5461031a 100644 --- a/tests/xfs/158.out +++ b/tests/xfs/158.out @@ -8,7 +8,7 @@ FEATURES: INOBTCNT:NO Fail partway through upgrading Adding inode btree counts to filesystem. FEATURES: NEEDSREPAIR:YES INOBTCNT:YES -mount: SCRATCH_MNT: mount(2) system call failed: Structure needs cleaning. +mount: Structure needs cleaning Re-run repair to finish upgrade FEATURES: NEEDSREPAIR:NO INOBTCNT:YES Filesystem should be usable again
The lastest mount command (from util-linux) merged below commit: 79534c0d7e0f ("mount: add hint about dmesg(8) to error messages") which brought in a new error output when mount fails, no matter ro/rw/busy mount fails. That cause some cases (e.g. xfs/005) fail as: mount: Structure needs cleaning dmesg(1) may have more information after failed mount system call More failed cases like generic/050, ext4/002, xfs/154, xfs/158 etc. Especially xfs/154 and xfs/158, need to change their _filter_scratch to _filter_error_mount. Signed-off-by: Zorro Lang <zlang@kernel.org> --- Thanks the review points from Dave. This V2 turn to filter out the error in _filter_error/ro/busy_mount. And change xfs/154 and xfs/158 to use _filter_error_mount. Thanks, Zorro common/filter | 13 +++++++++++-- tests/xfs/154 | 2 +- tests/xfs/154.out | 2 +- tests/xfs/158 | 2 +- tests/xfs/158.out | 2 +- 5 files changed, 15 insertions(+), 6 deletions(-)