#1093225 xfsprogs: xfs_repair coredumps on disk with bad sectors

Package:
xfsprogs
Source:
xfsprogs
Description:
Utilities for managing the XFS filesystem
Submitter:
Moritz Kuettel
Date:
2025-01-16 18:18:02 UTC
Severity:
normal
Tags:
#1093225#5
Date:
2025-01-16 17:45:55 UTC
From:
To:
Dear Maintainer,

Today I noticed that on an old external harddisk (using LUKS over the whole volume with an xfs directly inside (no partition table)),
when running ls -l that that all attributes (permissions, etc) where listed as question marks on a directory at the root of the XFS filesystem.

I got some warnings about bad sectors on the disk (to be expected, it's old and the data is safe anyway, I created the setup like a month ago).

So I thought I'd run a file system check and installed xfsprogs and ran xfs_repair as root on it:

	# xfs_repair /dev/mapper/mkbkp_crypt
	Phase 1 - find and verify superblock...
	Phase 2 - using internal log
		- zero log...
		- scan filesystem freespace and inode maps...
		- found root inode chunk
	Phase 3 - for each AG...
		- scan and clear agi unlinked lists...
		- process known inodes and perform inode discovery...
		- agno = 0
		- agno = 1
	Aborted (core dumped)

These are the dmesg console log of the execution:

	[166014.329819] sd 6:0:0:0: [sdd] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=3s
	[166014.329834] sd 6:0:0:0: [sdd] tag#0 Sense Key : Medium Error [current]
	[166014.329840] sd 6:0:0:0: [sdd] tag#0 Add. Sense: Unrecovered read error
	[166014.329847] sd 6:0:0:0: [sdd] tag#0 CDB: Read(10) 28 00 12 a7 b0 70 00 00 f0 00
	[166014.329851] critical medium error, dev sdd, sector 312979568 op 0x0:(READ) flags 0x4800 phys_seg 9 prio class 0
	[166017.785629] sd 6:0:0:0: [sdd] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=3s
	[166017.785644] sd 6:0:0:0: [sdd] tag#0 Sense Key : Medium Error [current]
	[166017.785650] sd 6:0:0:0: [sdd] tag#0 Add. Sense: Unrecovered read error
	[166017.785657] sd 6:0:0:0: [sdd] tag#0 CDB: Read(10) 28 00 12 bf c9 70 00 00 40 00
	[166017.785661] critical medium error, dev sdd, sector 314558832 op 0x0:(READ) flags 0x800 phys_seg 4 prio class 0
	[166020.963560] sd 6:0:0:0: [sdd] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=3s
	[166020.963575] sd 6:0:0:0: [sdd] tag#0 Sense Key : Medium Error [current]
	[166020.963582] sd 6:0:0:0: [sdd] tag#0 Add. Sense: Unrecovered read error
	[166020.963589] sd 6:0:0:0: [sdd] tag#0 CDB: Read(10) 28 00 12 d5 08 30 00 00 80 00
	[166020.963593] critical medium error, dev sdd, sector 315951152 op 0x0:(READ) flags 0x800 phys_seg 9 prio class 0
	[166024.530400] sd 6:0:0:0: [sdd] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=3s
	[166024.530415] sd 6:0:0:0: [sdd] tag#0 Sense Key : Medium Error [current]
	[166024.530422] sd 6:0:0:0: [sdd] tag#0 Add. Sense: Unrecovered read error
	[166024.530428] sd 6:0:0:0: [sdd] tag#0 CDB: Read(10) 28 00 12 f9 cb b0 00 00 c0 00
	[166024.530432] critical medium error, dev sdd, sector 318360496 op 0x0:(READ) flags 0x800 phys_seg 25 prio class 0
	[166034.920085] sd 6:0:0:0: [sdd] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=3s
	[166034.920099] sd 6:0:0:0: [sdd] tag#0 Sense Key : Medium Error [current]
	[166034.920106] sd 6:0:0:0: [sdd] tag#0 Add. Sense: Unrecovered read error
	[166034.920112] sd 6:0:0:0: [sdd] tag#0 CDB: Read(10) 28 00 12 f9 df b0 00 00 f0 00
	[166034.920116] critical medium error, dev sdd, sector 318365616 op 0x0:(READ) flags 0x4800 phys_seg 16 prio class 0
	[166038.442690] sd 6:0:0:0: [sdd] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=3s
	[166038.442705] sd 6:0:0:0: [sdd] tag#0 Sense Key : Medium Error [current]
	[166038.442712] sd 6:0:0:0: [sdd] tag#0 Add. Sense: Unrecovered read error
	[166038.442718] sd 6:0:0:0: [sdd] tag#0 CDB: Read(10) 28 00 12 f9 e2 f0 00 00 40 00
	[166038.442722] critical medium error, dev sdd, sector 318366448 op 0x0:(READ) flags 0x800 phys_seg 9 prio class 0
	[166041.531735] sd 6:0:0:0: [sdd] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=3s
	[166041.531750] sd 6:0:0:0: [sdd] tag#0 Sense Key : Medium Error [current]
	[166041.531756] sd 6:0:0:0: [sdd] tag#0 Add. Sense: Unrecovered read error
	[166041.531763] sd 6:0:0:0: [sdd] tag#0 CDB: Read(10) 28 00 12 f9 e0 a0 00 00 90 00
	[166041.531767] critical medium error, dev sdd, sector 318365856 op 0x0:(READ) flags 0x800 phys_seg 11 prio class 0
	[166044.987650] sd 6:0:0:0: [sdd] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=3s
	[166044.987665] sd 6:0:0:0: [sdd] tag#0 Sense Key : Medium Error [current]
	[166044.987671] sd 6:0:0:0: [sdd] tag#0 Add. Sense: Unrecovered read error
	[166044.987678] sd 6:0:0:0: [sdd] tag#0 CDB: Read(10) 28 00 12 a7 b0 70 00 00 20 00

Now while I certainly don't expect xfs_repair to magically fix the issue (or my disk),
I assume that xfs_repair probably just shouldn't coredump.

I have the coredump on hands but running strings on it reveals file contents and file names used on said disk,
so I'm not willing to share that publicly.

I might be able to further pin-point and even fix the issue (as I'm a programmer),
but I'll need some guidance on how to handle my coredump. Any help is appreciated,
feel free to contact me at moritz@kuettel.net.

Thanks!

*** End of the template - remove these template lines ***