DragonFly BSD
DragonFly kernel List (threaded) for 2013-05
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

getnewvnode() return code


From: Antonio Huete Jimenez <ahuete.devel@xxxxxxxxx>
Date: Mon, 27 May 2013 18:32:18 +0200

--e89a8ffbad3d338efb04ddb5b19a
Content-Type: text/plain; charset=ISO-8859-1

Hi,

As far as I can see, getnewvnode() always returns 0. However the path to
get a new vnode, which is:

objcache_get() <- sysref_alloc() <- allovnode() <- getnewvnode()

may return NULL via objcache_get.

Filesystems like NFS for example use vx_put() on the vnode obtained via
getnewvnode() in its nfsnode allocation path. In the case the returned
vnode pointer was NULL that would cause a kernel panic.

All filesystems check the return code from getnewvnode() but they don't
check whether the returned vnode is NULL.

In any case, I could be missing something; thoughts are appreciated.

Cheers,
Antonio Huete

--e89a8ffbad3d338efb04ddb5b19a
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div><div><div>Hi,<br><br></div>As far as I can see, =
getnewvnode() always returns 0. However the path to get a new vnode, which =
is:<br><br>objcache_get() &lt;- sysref_alloc() &lt;- allovnode() &lt;- getn=
ewvnode()<br>
<br></div>may return NULL via objcache_get.<br><br></div>Filesystems like N=
FS for example use vx_put() on the vnode obtained via getnewvnode() in its =
nfsnode allocation path. In the case the returned vnode pointer was NULL th=
at would cause a kernel panic.<br>
<br></div>All filesystems check the return code from getnewvnode() but they=
 don&#39;t check whether the returned vnode is NULL.<br><br>In any case, I =
could be missing something; thoughts are appreciated.<br><br>Cheers,<br>
Antonio Huete<br></div>

--e89a8ffbad3d338efb04ddb5b19a--



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