Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Sep 2008 21:29:48 +0200
From:      Jille Timmermans <jille@quis.cx>
To:        hackers@freebsd.org
Subject:   readdir(somefile) returing inconsistent errors
Message-ID:  <48C971AC.6080001@quis.cx>

next in thread | raw e-mail | index | archive | help
Hello,

I was looking through some vop_readdir()'s, and noticed an inconsistency
between (at least) xfs and unionfs.

sys/fs/unionfs/union_vnops.c:1410:
	if(ap->a_vp->v_type != VDIR)
		return (ENOTDIR);

sys/fs/xfs/FreeBSD/xfs_vnops.c:1001:
	if(vp->v_type != VDIR)
		return (EPERM);

A little userland script gave me a ENOTDIR when trying to
opendir(somefile) (userspace opendir() calling kernelspace readdir()).

So I assume the check is made earlier, but shouldn't the xfs code return
ENOTDIR in this case ?
due to the if-clause above it, you'd say ENOTDIR seems better than EPERM.


-- Jille



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