Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Jun 2010 22:40:22 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Mikolaj Golub <to.my.trociny@gmail.com>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: '#ifndef DIAGNOSTIC' in nfsclient code looks like a typo
Message-ID:  <20100612194022.GP13238@deviant.kiev.zoral.com.ua>
In-Reply-To: <86mxv0cb9z.fsf@kopusha.home.net>
References:  <86mxv22ji7.fsf@zhuzha.ua1> <20100611191059.GF13238@deviant.kiev.zoral.com.ua> <86mxv0cb9z.fsf@kopusha.home.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--hHiQ9nAwW5IGN2dL
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Jun 12, 2010 at 10:15:52PM +0300, Mikolaj Golub wrote:
>=20
> On Fri, 11 Jun 2010 22:10:59 +0300 Kostik Belousov wrote:
>=20
>  KB> All the changes should be converted to the KASSERTs. There is no poi=
nt
>  KB> in doing
>  KB>         if (something)
>  KB>                 panic();
>  KB> for diagnostic; use
>  KB>         KASSERT(something, (panic message));
>=20
> 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 =3D=3D 1 &&
+		!(uio_uio_resid(uiop) & (DIRBLKSIZ - 1)),
to
+	KASSERT(uiop->uio_iovcnt =3D=3D 1 &&
+		(uio_uio_resid(uiop) & (DIRBLKSIZ - 1)) =3D=3D 0,

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


--hHiQ9nAwW5IGN2dL
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkwT4qUACgkQC3+MBN1Mb4gAiwCfW3Cm3vzXSk2wnlnbg5pjlpv4
rNEAoIoNtjZAiTBUTch547aZn+DZruqP
=EUq2
-----END PGP SIGNATURE-----

--hHiQ9nAwW5IGN2dL--



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