Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Oct 2018 22:01:35 +0000
From:      Brooks Davis <brooks@freebsd.org>
To:        Rick Macklem <rmacklem@uoguelph.ca>
Cc:        Brooks Davis <brooks@freebsd.org>, FreeBSD Current <freebsd-current@FreeBSD.org>, Josh Paetzel <josh@tcbug.org>
Subject:   Re: which way to update export_args structure?
Message-ID:  <20181022220135.GA96662@spindle.one-eyed-alien.net>
In-Reply-To: <YTOPR0101MB11628EFAE330DB521970206EDDF40@YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM>
References:  <YTOPR0101MB182021549F8CF8277477A4C5DDE90@YTOPR0101MB1820.CANPRD01.PROD.OUTLOOK.COM> <20181003155133.GA57729@spindle.one-eyed-alien.net> <YTOPR0101MB18207FF98DED0232B9BB1B4FDDE50@YTOPR0101MB1820.CANPRD01.PROD.OUTLOOK.COM> <20181008170428.GB9766@spindle.one-eyed-alien.net> <YTOPR0101MB11626B32F73B520FBDA3C633DDFA0@YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM> <20181022160508.GB45769@spindle.one-eyed-alien.net> <YTOPR0101MB1162CABEA06CC78BB5D5DA63DDF40@YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM> <YTOPR0101MB11628EFAE330DB521970206EDDF40@YTOPR0101MB1162.CANPRD01.PROD.OUTLOOK.COM>

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

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

On Mon, Oct 22, 2018 at 09:59:52PM +0000, Rick Macklem wrote:
>=20
> ________________________________________
> From: owner-freebsd-current@freebsd.org <owner-freebsd-current@freebsd.or=
g> on behalf of Rick Macklem <rmacklem@uoguelph.ca>
> Sent: Monday, October 22, 2018 5:24 PM
> To: Brooks Davis
> Cc: FreeBSD Current; Josh Paetzel
> Subject: Re: which way to update export_args structure?
>=20
> Brooks Davis wrote:
> On Sat, Oct 20, 2018 at 01:17:37AM +0000, Rick Macklem wrote:
> [lots of stuff snipped]
> >> +             if (vfs_getopt(mp->mnt_optnew, "export", &bufp, &len) =
=3D=3D 0) {
> >> +                     /* Assume that there is only 1 ABI for each leng=
th. */
> >> +                     switch (len) {
> >> +                     case (sizeof(struct oexport_args)):
> >> +                     case (sizeof(struct o2export_args)):
> ...
> >> +                             memset(&o2export, 0, sizeof(o2export));
> >
> >This is certainly redundant given that you immediately copy over it.
> Actually, I just looked and this code is correct. The trick is that "len"=
 might
> equal sizeof(struct oexport_args) which is < sizeof(struct o2export_args).
> As such, the memcpy() may only replace the first fields of "struct o2expo=
rt_args".
> I've added a comment to the patch to clarify this.

Ah, that makes sense.

-- Brooks

--u3/rZRmxL6MmkK24
Content-Type: application/pgp-signature; name="signature.asc"

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

iQEcBAEBAgAGBQJbzki+AAoJEKzQXbSebgfAokIH/3YpNlWA/ssiR4NB/I7rbhOL
EGGSKuQSzxtqjwQL7vA65z2HK2dpJ9hFOogEj/zNBGpmp0FJuHWTX/dLY9Z5W/PD
yIANbLUkwKhhyGuEBoRl5d/X031Kl+CdOPkLBSGrDeC4f92wy7CtisT1Ss+pY85B
lBs2mOZ01tKucyHRHUOLT+T0STJHMff1ZTtdINFTi1Y4TUVFjrLHpX6pJs+SHkjK
6H46gUQUxrTn/Q0FGMb3OOxDTsNuwybaI84EEfxeC1Eimfdz14BsabPFqafQpmI2
nuo6RwNBPHNQGIoTAL3vOd89EfD5khtqpeiWqpm/M/XNA7p56K5yiRhdBIpt+mQ=
=/6MX
-----END PGP SIGNATURE-----

--u3/rZRmxL6MmkK24--



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