Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Jul 2025 22:46:57 +0900
From:      Olivier Certner <olce@freebsd.org>
To:        Charlie Li <vishwin@freebsd.org>
Cc:        Mark Johnston <markj@freebsd.org>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org
Subject:   Re: git: f1f230439fa4 - main - vfs: Initial revision of inotify
Message-ID:  <2937929.UcPf6a0QyJ@francois>
In-Reply-To: <cc4b2cfb-3405-450a-855a-d1c157920404@freebsd.org>
References:  <202507041455.564EtqwS073424@gitrepo.freebsd.org> <cc4b2cfb-3405-450a-855a-d1c157920404@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart5090732.Cjmsv3J8Qz
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="utf-8"; protected-headers="v1"
From: Olivier Certner <olce@freebsd.org>
To: Charlie Li <vishwin@freebsd.org>
Date: Sun, 13 Jul 2025 22:46:57 +0900
Message-ID: <2937929.UcPf6a0QyJ@francois>
Organization: FreeBSD
In-Reply-To: <cc4b2cfb-3405-450a-855a-d1c157920404@freebsd.org>
MIME-Version: 1.0

Hi Charlie,

The panic you're seeing is caused by 'MPASS(*eofflag != 0);' in vn_dir_next_dirent().  This test is here to check that VOP_READDIR() works properly.  In particular, if VOP_READDIR() returned 0 (no error), and the length it filled is 0 (nothing was added), then we must be at EOF, and VOP_READDIR() must have set '*eofflag' to something non-zero.  UFS has been verified to abide by this rule (unless the directory being read is malformed).  Which filesystem are you using?

Shot in the dark & educated guess: You're using ZFS, and you've just stumbled on the following case (lines from 'zfs_vnops_os.c'):

        /*                                                                                                                                                
         * Quit if directory has been removed (posix)                                                                                                     
         */
        if ((*eofp = zp->z_unlinked) != 0) {
                zfs_exit(zfsvfs, FTAG);
                return (0);
        }

which is a corner case that apparently has been missed.  Just add some 'if (eofflag != NULL) *eofflag = 1;' inside the "then" block there and retry.  It looks like all other cases in this function are handled correctly (but I have not thoroughly verified).

I'll be mostly AFK for the next 10 days, so probably won't be able to follow-up, but hope that will help.

Thanks and regards.

-- 
Olivier Certner
--nextPart5090732.Cjmsv3J8Qz
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit

-----BEGIN PGP SIGNATURE-----

iQIzBAABCQAdFiEEmNCxHjkosai0LYIujKEwQJceJicFAmhzuNEACgkQjKEwQJce
Jicmvw/9ESjkkrFQMefCpoBllHcvrouHPUVDbqBtUvTnCfxoB7vfJyR7EC2iyAKR
EbUAZaEGRl7EH37/4859qIFh9NIkTJ6if/KV4rvHkbi7V0h0EHA1oEWA7mjNzAyt
aaXodxKb8/t2+hL7zJg+9wi6ELmmJbNZPROgGN5XOCiGhO7Inb/gCruLniJ0pqZq
9/HfXp/u66pk1We3s2J/9fSjGBDn15+OWk667862HoShU18rqNaE3dAg9GMZ/2Ab
Gap/EsPN2mA6Xv/sdB3TosNtXrWCS9dk2W7LHxTPLSOlEucGp06ICNDoQ3Gj/V1i
ha6PvPEmlxaXBvmH2W9KYOVlF3M90WaallX01oLO5PwRK/bURnmYxoZzNQQeFME6
AbqRXVZlRD7fBw0CyFRMUPWFva4O3pxuTwVjjnrT3y6cxGQ/Bg451kD2d92W0L1t
8wTLKAYRP0RsD+THTpjVtfe00TzIgjYFXnMUuAvU8iihlDaACbIRMaObtVq5LJKj
tGCdQ7+qqrUeCIKMCrx+eeRPxmMeZ0bLIaR+SIzQ3TahBdgbEgkJs62vStymXVtz
ZlyaZ5CzbzXfqhqEzeSKZ2vALeC02ct4kDw47pFWrPXvKpdFM1Pf5Y4Fq3fDPVEd
kU4h1ShThWU4gwrC6VNzbQEj+xY23/vxcSHnHvHYfofaOI7y57g=
=g38I
-----END PGP SIGNATURE-----

--nextPart5090732.Cjmsv3J8Qz--






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2937929.UcPf6a0QyJ>