From owner-freebsd-current Sat Nov 30 23:11:42 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 61B2437B401; Sat, 30 Nov 2002 23:11:40 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id ADD4443E4A; Sat, 30 Nov 2002 23:11:38 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id SAA05107; Sun, 1 Dec 2002 18:11:28 +1100 Date: Sun, 1 Dec 2002 18:25:20 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Maxime Henrion Cc: Emiel Kollof , Juli Mallett , , Subject: Re: ext2fs and NFS exporting wackyness In-Reply-To: <20021128180554.GJ4067@elvis.mu.org> Message-ID: <20021201181436.G8100-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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