Re: xfs_repair reports filesystem as in consistent even on ensuring consistency

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 05, 2024 at 01:13:02PM +0000, Abhinandan Purkait wrote:
> Hi xfs folks,
> I have been trying xfs filesystem consistency for a snapshot use case. I tried using xfs_freeze before taking snapshot, but xfs_repair shows the filesystem as in consistent.
> 
> I will write the steps below:
> 
> 1. I have a block volume provisioned by OpenEBS Mayastor as backend. Let's say the blockdevice is nvme0n1
> 2. I created a filesystem mkfs.xfs -f nvme0n1.
> 3. I mounted the filesystem on mydir.
> 4. I ran fio --verify_dump=1 --bs=4096  --random_generator=tausworthe64 --rw=randrw --ioengine=libaio --iodepth=16 --verify_fatal=1 --verify=crc32 --verify_async=2 --name=benchtest0 --filename=mydir/test --time_based --runtime=60 --size=120M
> 5. Now while fio is in progress I issued xfs_freeze -f mydir
> 6. Took the block level snapshot.
> 7. I unfroze the filesystem xfs_freeze -u mydir
> 8. I let the fio application complete.
> 9. Now while checking the filesystem consistency on the snapshot, using xfs_repair. I issue xfs_repair -n loop8, where loop8 is my snapshot filesystem
> 10. I get the below
> 
> The filesystem has valuable metadata changes in a log which is being
> ignored because the -n option was used.  Expect spurious inconsistencies
> which may be resolved by first mounting the filesystem to replay the log.
> 
> What am I doing wrong here? Is this way of checking filesystem consistency incorrect?

xfs_repair is not telling you the filesystem is inconsistent.
It is telling you there is metadata in the journal to be replayed, so the
filesystem should be mounted so metadata can be replayed.

> I have noticed that even without any operation the filesystem gets reported as inconsistent, for example issuing a simple xfs_freeze on a newly created  xfs filesystem volume and then unmounting and running xfs_repair -n somedevice also shows up as inconsistent.

I don't know what kernel you are using, and the behavior differs slightly from
kernel to kernel.
In simple words, even after you freeze the filesystem, it might still need to do
some work when you unfreeze it, and this will be done at the next mount.

So, what you are seeing is not an inconsistent filesystem, but the journal
working the way it is supposed to work.

Carlos




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux