NetBSD-Bugs archive

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

Re: kern/59152: Panic in genfs(?) onn HEAD amd64



The following reply was made to PR kern/59152; it has been noted by GNATS.

From: RVP <rvp%SDF.ORG@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/59152: Panic in genfs(?) onn HEAD amd64
Date: Mon, 10 Mar 2025 07:54:37 +0000 (UTC)

 Looks like bit-rot in genfs_compat_getpages(): NTFS seems to be the
 only user of that function (prolly because NTFS can't use genfs_getpages()
 as it doesn't implement a proper ntfs_bmap() for it...).
 
 Anyway, the patch below seems to kinda work for me: at least, no panics; but
 some of the files on my Windows 11 NTFS have all '\0' in 'em instead of actual
 contents. But, NTFS-3g from pkgsrc which is pretty old has issues too:
 
 
 // NTFS-3g run:
 # ls -l /mnt/Windows/Media/*.wav
 lrwxrwxrwx  3 root  wheel  34 May  7  2022 /mnt/Windows/Media/Alarm01.wav -> unsupported reparse tag 0x80000017
 lrwxrwxrwx  3 root  wheel  34 May  7  2022 /mnt/Windows/Media/Alarm02.wav -> unsupported reparse tag 0x80000017
 lrwxrwxrwx  3 root  wheel  34 May  7  2022 /mnt/Windows/Media/Alarm03.wav -> unsupported reparse tag 0x80000017
 lrwxrwxrwx  3 root  wheel  34 May  7  2022 /mnt/Windows/Media/Alarm04.wav -> unsupported reparse tag 0x80000017
 
 // mount_ntfs run:
 # ls -l /mnt/Windows/Media/*.wav
 -rwxr-xr-x  3 root  wheel   491516 May  7  2022 /mnt/Windows/Media/Alarm01.wav
 -rwxr-xr-x  3 root  wheel   331108 May  7  2022 /mnt/Windows/Media/Alarm02.wav
 -rwxr-xr-x  3 root  wheel   355588 May  7  2022 /mnt/Windows/Media/Alarm03.wav
 # file /mnt/Windows/Media/Alarm01.wav
 /mnt/Windows/Media/Alarm01.wav: data
 # hexdump -C /mnt/Windows/Media/Alarm01.wav
 00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 *
 00077ff0  00 00 00 00 00 00 00 00  00 00 00 00              |............|
 00077ffc
 #
 
 Might just be that Win 11 NTFS has features not supported by current code. Or,
 it's a sign that I have to CHKDSK.exe that filesystem :).
 
 -RVP
 
 ---START patch---
 diff -urN a/sys/miscfs/genfs/genfs_io.c b/sys/miscfs/genfs/genfs_io.c
 --- a/sys/miscfs/genfs/genfs_io.c	2024-04-06 01:44:11.101347998 +0000
 +++ b/sys/miscfs/genfs/genfs_io.c	2025-03-10 07:40:37.639359388 +0000
 @@ -1624,7 +1624,7 @@
 
   	if (ap->a_flags & PGO_LOCKED) {
   		uvn_findpages(uobj, origoffset, ap->a_count, ap->a_m, NULL,
 -		    UFP_NOWAIT|UFP_NOALLOC| (memwrite ? UFP_NORDONLY : 0));
 +		    UFP_NOWAIT|UFP_NOALLOC|UFP_NOBUSY| (memwrite ? UFP_NORDONLY : 0));
 
   		error = ap->a_m[ap->a_centeridx] == NULL ? EBUSY : 0;
   		return error;
 ---END patch---
 


Home | Main Index | Thread Index | Old Index