Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Feb 2017 19:24:04 +0100
From:      "O. Hartmann" <ohartmann@walstatt.org>
To:        "Stephen J. Kiernan" <stevek@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r313701 - in head: sbin/mdconfig sys/dev/md
Message-ID:  <20170213192404.01c6072b@thor.intern.walstatt.dynvpn.de>
In-Reply-To: <201702131744.v1DHi7NO064008@repo.freebsd.org>
References:  <201702131744.v1DHi7NO064008@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--Sig_/FiJcbUNJfGiAp4FoX5w5yxA
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Am Mon, 13 Feb 2017 17:44:07 +0000 (UTC)
"Stephen J. Kiernan" <stevek@FreeBSD.org> schrieb:

> Author: stevek
> Date: Mon Feb 13 17:44:07 2017
> New Revision: 313701
> URL: https://svnweb.freebsd.org/changeset/base/313701
>=20
> Log:
>   For MD_PRELOAD type md(4) devices, if there is a file name in the prelo=
aded
>   meta-data, copy it into the softc structure.
>  =20
>   When returning md(4) device details to the caller, include the file nam=
e in
>   any MD_PRELOAD type devices if it is set (first character is not NUL.)
>  =20
>   In mdconfig, for "preload" type md(4) devices, if there is file config
>   available, print it in the file column of the output.
>  =20
>   Reviewed by:	brooks
>   Approved by:	sjg (mentor)
>   MFC after:	1 month
>   Sponsored by:	Juniper Networks, Inc.
>   Differential Revision:	https://reviews.freebsd.org/D9529
>=20
> Modified:
>   head/sbin/mdconfig/mdconfig.c
>   head/sys/dev/md/md.c
>=20
> Modified: head/sbin/mdconfig/mdconfig.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sbin/mdconfig/mdconfig.c	Mon Feb 13 16:11:37 2017	(r313700)
> +++ head/sbin/mdconfig/mdconfig.c	Mon Feb 13 17:44:07 2017	(r313701)
> @@ -452,7 +452,8 @@ md_list(const char *units, int opt, cons
>  			}
>  			gc =3D &pp->lg_config;
>  			type =3D geom_config_get(gc, "type");
> -			if (strcmp(type, "vnode") =3D=3D 0) {
> +			if (strcmp(type, "vnode") =3D=3D 0 ||
> +			    strcmp(type, "preload") =3D=3D 0) {
>  				file =3D geom_config_get(gc, "file");
>  				if (fflag !=3D NULL &&
>  				    strcmp(fflag, file) !=3D 0)
>=20
> Modified: head/sys/dev/md/md.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/dev/md/md.c	Mon Feb 13 16:11:37 2017	(r313700)
> +++ head/sys/dev/md/md.c	Mon Feb 13 17:44:07 2017	(r313701)
> @@ -1689,7 +1689,8 @@ xmdctlioctl(struct cdev *dev, u_long cmd
>  		mdio->md_options =3D sc->flags;
>  		mdio->md_mediasize =3D sc->mediasize;
>  		mdio->md_sectorsize =3D sc->sectorsize;
> -		if (sc->type =3D=3D MD_VNODE)
> +		if (sc->type =3D=3D MD_VNODE ||
> +		    (sc->type =3D=3D MD_PRELOAD && mdio->md_file !=3D NULL))
>  			error =3D copyout(sc->file, mdio->md_file,
>  			    strlen(sc->file) + 1);
>  		return (error);
> @@ -1733,6 +1734,8 @@ md_preloaded(u_char *image, size_t lengt
>  	sc->pl_ptr =3D image;
>  	sc->pl_len =3D length;
>  	sc->start =3D mdstart_preload;
> +	if (name !=3D NULL)
> +		strlcpy(sc->file, name, sizeof(sc->file));
>  #if defined(MD_ROOT) && !defined(ROOTDEVNAME)
>  	if (sc->unit =3D=3D 0)
>  		rootdevnames[0] =3D MD_ROOT_FSTYPE ":/dev/md0";
> @@ -1835,7 +1838,8 @@ g_md_dumpconf(struct sbuf *sb, const cha
>  			sbuf_printf(sb, " fs %ju", (uintmax_t) mp->fwsectors);
>  			sbuf_printf(sb, " l %ju", (uintmax_t) mp->mediasize);
>  			sbuf_printf(sb, " t %s", type);
> -			if (mp->type =3D=3D MD_VNODE && mp->vnode !=3D NULL)
> +			if ((mp->type =3D=3D MD_VNODE && mp->vnode !=3D NULL) ||
> +			    (mp->type =3D=3D MD_PRELOAD && mp->file[0] !=3D '\0'))
>  				sbuf_printf(sb, " file %s", mp->file);
>  		} else {
>  			sbuf_printf(sb, "%s<unit>%d</unit>\n", indent,
> @@ -1855,7 +1859,8 @@ g_md_dumpconf(struct sbuf *sb, const cha
>  			    "read-only");
>  			sbuf_printf(sb, "%s<type>%s</type>\n", indent,
>  			    type);
> -			if (mp->type =3D=3D MD_VNODE && mp->vnode !=3D NULL) {
> +			if ((mp->type =3D=3D MD_VNODE && mp->vnode !=3D NULL) ||
> +			    (mp->type =3D=3D MD_PRELOAD && mp->file[0] !=3D '\0'))
>  				sbuf_printf(sb, "%s<file>", indent);
>  				g_conf_printf_escaped(sb, "%s", mp->file);
>  				sbuf_printf(sb, "</file>\n");
> _______________________________________________
> svn-src-head@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org"

This broke kernel build on recent CURRENT:

[...]
=3D=3D=3D> mdio (all)
--- all_subdir_md ---
--- md.o ---
/usr/src/sys/modules/md/../../dev/md/md.c:1870:1: error: extraneous closing=
 brace ('}')
}
^
1 error generated.
*** [md.o] Error code 1

make[4]: stopped in /usr/src/sys/modules/md


Kind regards,

Oliver

--Sig_/FiJcbUNJfGiAp4FoX5w5yxA
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

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

iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWKH5xAAKCRDS528fyFhY
lHPOAf9NZ0KCflGWxC/OdJk2So2EGrWxFHaEuMkwCB4bI3HyvqplMEKckWOkzQBQ
d1zlpw6TLSs0hjOZIa8Wo0g5OvR7Af9vZygPRiXTUHZrPFocpFXpQbAbxe/jNsEY
+OwBKgsJxz5NtoWPjzPd+Ch5QQjFP8ChJoJGDRyTuQQ2X2FI66LN
=JTfk
-----END PGP SIGNATURE-----

--Sig_/FiJcbUNJfGiAp4FoX5w5yxA--



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