26.04.2020 10:36, Chris Murphy пишет:
superblock: bytenr=274877906944, device=/dev/nvme0n1p3
---------------------------------------------------------
ERROR: bad magic on superblock on /dev/nvme0n1p3 at 274877906944
? OK but why does it even go looking for this 3rd super? A file system
of this size doesn't have a 3rd super, which appears at 256G.
There's no dmesg for the resize? This should report the block group
changes that happen as part of the resize; and also the fs size
change; and also the partition map change. And if it is rebooted, then
dump-super shouldn't be looking for a 3rd super.
Most likely it is code bug. The condition is
if (ret == 0 && errno == 0)
but errno is not guaranteed to be reset to zero after previous errors.
Linux errno(3):
The value in errno is significant only when the return value of
the call indicated an
error (i.e., -1 from most system calls; -1 or NULL from most
library functions); a
function that succeeds is allowed to change errno. The value
of errno is never set
to zero by any system call or library function.
And pread64(2)
Note that is not an error for a successful call to
transfer fewer bytes than
requested (see read(2) and write(2)).
On error, -1 is returned and errno is set to indicate the cause
of the error.
So errno check here is entirely redundant, the only case when pread64
returns 0 is reading past EOF.