Re: [PATCH] xfs_repair: handling a block with bad crc, bad uuid, and bad magic number needs fixing

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

 



On Thu, Mar 20, 2025 at 06:28:19PM -0500, Eric Sandeen wrote:
> > -		    be32_to_cpu(d->magic) == XFS_DIR3_DATA_MAGIC) {
> > +		if (xfs_has_crc(mp))
> > +			wantmagic = XFS_DIR3_BLOCK_MAGIC;
> > +		else
> > +			wantmagic = XFS_DIR2_BLOCK_MAGIC;
> > +		if (wantmagic == XFS_DIR3_BLOCK_MAGIC) {
> 
> So I guess the prior 5 lines are equivalent to:
> 
> 		/* check v5 metadata */
> 		if (xfs_has_crc(mp)) {
> ...
> 
> and that will force it to check the header, below. And then I think we hit
> the goto out_fix; line, and it moves the contents of this directory to
> lost+found (at least on my custom repro image.)
> 
> Curious to see what others think is the right path through all this.

I'll need some time to actually understand the code, but replacing the
wantmagic logic with just doign the xfs_has_crc check looks right and
muche easier to follow.





[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