'#ifndef DIAGNOSTIC' in nfsclient code looks like a typo

Kostik Belousov kostikbel at gmail.com
Sat Jun 12 19:40:27 UTC 2010


On Sat, Jun 12, 2010 at 10:15:52PM +0300, Mikolaj Golub wrote:
> 
> On Fri, 11 Jun 2010 22:10:59 +0300 Kostik Belousov wrote:
> 
>  KB> All the changes should be converted to the KASSERTs. There is no point
>  KB> in doing
>  KB>         if (something)
>  KB>                 panic();
>  KB> for diagnostic; use
>  KB>         KASSERT(something, (panic message));
> 
> Please look at the attached patch.

Almost there. According to style(9), the values should be explicitely
compared with 0, unless the value is of the boolean type. I suggest
you to change e.g.
+	KASSERT(uiop->uio_iovcnt == 1 &&
+		!(uio_uio_resid(uiop) & (DIRBLKSIZ - 1)),
to
+	KASSERT(uiop->uio_iovcnt == 1 &&
+		(uio_uio_resid(uiop) & (DIRBLKSIZ - 1)) == 0,

and change
+	KASSERT((tcnp->cn_flags & HASBUF) && (fcnp->cn_flags & HASBUF),
+		("nfs_rename: no name"));
to
+	KASSERT((tcnp->cn_flags & HASBUF) != 0 && (fcnp->cn_flags & HASBUF) != 0,
+		("nfs_rename: no name"));

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20100612/4d771a97/attachment.pgp


More information about the freebsd-fs mailing list