Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Dec 2002 18:25:20 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Maxime Henrion <mux@freebsd.org>
Cc:        Emiel Kollof <coolvibe@hackerheaven.org>, Juli Mallett <jmallett@freebsd.org>, <bde@freebsd.org>, <current@freebsd.org>
Subject:   Re: ext2fs and NFS exporting wackyness
Message-ID:  <20021201181436.G8100-100000@gamplex.bde.org>
In-Reply-To: <20021128180554.GJ4067@elvis.mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 28 Nov 2002, Maxime Henrion wrote:

> Maxime Henrion wrote:
> > Emiel Kollof wrote:
> > > Can this be patched by doing some subtitutions in the files that use the
> > > "old" mount syscall? Or is it more hairy than that?
> >
> > Can you try the attached patch and tell me if it works ?
>
> There were stupid mistakes in this patch.  Can you try this one instead ?

Urk.  The patch demonstrates the full awfulness of the nmount(2) interface.
nmount() requires constructing a huge iov instead of using some simple
pointers and flags.  E.g.:

% @@ -1812,8 +1854,26 @@ do_mount(ep, grp, exflags, anoncrp, dirp
%  		 * Also, needs to know how to export all types of local
%  		 * exportable filesystems and not just "ufs".
%  		 */
% -		while (mount(fsb->f_fstypename, dirp,
% -		    fsb->f_flags | MNT_UPDATE, (caddr_t)&args) < 0) {
% +retry:
% +		if (do_nmount) {
% +			iov[0].iov_base = "fstype";
% +			iov[0].iov_len = strlen(iov[0].iov_base) + 1;
% +			iov[1].iov_base = fsb->f_fstypename;
% +			iov[1].iov_len = strlen(iov[1].iov_base) + 1;
% +			iov[2].iov_base = "fspath";
% +			iov[2].iov_len = strlen(iov[2].iov_base) + 1;
% +			iov[3].iov_base = dirp;
% +			iov[3].iov_len = strlen(iov[3].iov_base) + 1;
% +			iov[4].iov_base = "export";
% +			iov[4].iov_len = strlen(iov[4].iov_base) + 1;
% +			iov[5].iov_base = eap;
% +			iov[5].iov_len = sizeof(*eap);
% +			error = nmount(iov, 6, fsb->f_flags | MNT_UPDATE);
% +		} else {
% +			error = mount(fsb->f_fstypename, dirp,
% +				    fsb->f_flags | MNT_UPDATE, &args);
% +		}
% +		if (error) {
%  			if (cp)
%  				*cp-- = savedc;
%  			else

This change breaks mounting of ext2fs using old kernels and a current mountd
in mountd like it has already been broken in mount_ext2fs, since there is
no fallback to using the old mount.

This patch also introduces a style bug: a weird continuation indent of 12
instead of the KNF continuation indent of 4 for the mount() lines.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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