Re: ext2fs and NFS exporting wackyness
On Sunday 01 December 2002 08:28, Bruce Evans wrote: On Thu, 28 Nov 2002, Maxime Henrion wrote: Emiel Kollof wrote: [root@tiamat]:/root mount 10.0.0.11:/storage /mnt/azazel [root@tiamat]:/root cd /mnt/azazel /mnt/azazel: Input/output error. This looks like a totally different problem. I'm not sure if NFS exported ext2fs partitions actually ever work. Bruce, any input on this one ? ISTR them working. There were a lot of problems with getdirentries() but I thought that they were fixed. So, any updates on this? Is it solved? Or do I need to do any more tests? I haven't seen any updates in my cvsup logs wrt mountd. Cheers, Emiel -- Geef je kat een miauwbeest subdomain voor kerst: http://www.miauwbeest.net/ To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: ext2fs and NFS exporting wackyness
On Sunday 01 December 2002 08:28, Bruce Evans wrote: From a remote host (A FreeBSD STABLE one): [root@tiamat]:/root mount 10.0.0.11:/storage /mnt/azazel [root@tiamat]:/root cd /mnt/azazel /mnt/azazel: Input/output error. This looks like a totally different problem. I'm not sure if NFS exported ext2fs partitions actually ever work. Bruce, any input on this one ? ISTR them working. There were a lot of problems with getdirentries() but I thought that they were fixed. Well, I seem to only be able to export FFS/UFS filesystems and remotely mount them. I will do some more testing (including some loopback stuff) and try out what works and what doesn't. Should I keep using Maxime's latest patch (to solve the remount issues)? Or should I bin it? Cheers, Emiel -- There is a green, multi-legged creature crawling on your shoulder. To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: ext2fs and NFS exporting wackyness
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 [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: ext2fs and NFS exporting wackyness
On Thu, 28 Nov 2002, Maxime Henrion wrote: Emiel Kollof wrote: * Emiel Kollof ([EMAIL PROTECTED]) wrote: There were stupid mistakes in this patch. Can you try this one instead ? Yes, this one seems to work. Hold on.. now remote hosts _see_ the ext2fs share, but mounting will not work. Yes it will mount without failing, but accessing won't work. From a remote host (A FreeBSD STABLE one): [root@tiamat]:/root mount 10.0.0.11:/storage /mnt/azazel [root@tiamat]:/root cd /mnt/azazel /mnt/azazel: Input/output error. This looks like a totally different problem. I'm not sure if NFS exported ext2fs partitions actually ever work. Bruce, any input on this one ? ISTR them working. There were a lot of problems with getdirentries() but I thought that they were fixed. Bruce To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: ext2fs and NFS exporting wackyness
On Thu, 28 Nov 2002, Emiel Kollof wrote: I'm having some odd trouble with exporting a ext2fs with NFS. ... Seems allright, no? Well, when I invoke or HUP mountd, the following happens: kernel: ext2fs doesn't support the old mount syscall mountd[344]: could not remount /storage: Operation not supported mountd[344]: bad exports list line /home -alldirs -network 10.0.0.0 -mask 255.255.255.0 It _should_ export fine, but the remounting does not work, causing mountd to think something's amiss and abort my cunning plan to share data across my network. mountd(8) only uses the old mount syscall (mount(2)), but support for mount(2) in ext2fs was axed in rev.1.97 of ext2_vfsops.c. Bruce To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: ext2fs and NFS exporting wackyness
Emiel Kollof wrote: * Juli Mallett ([EMAIL PROTECTED]) wrote: kernel: ext2fs doesn't support the old mount syscall mountd[344]: could not remount /storage: Operation not supported I have the same problem, more or less, with UFS :( I can no longer set up an NFS server, but only started investigating/doing-this tonight. Hmm, that _is_ kinda shitty, Now I must unplug that disk and share it from somewhere else, because I kinda need that data on the network here. 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 ? Cheers, Maxime Index: mountd.c === RCS file: /space2/ncvs/src/usr.sbin/mountd/mountd.c,v retrieving revision 1.70 diff -u -p -r1.70 mountd.c --- mountd.c16 Oct 2002 16:04:50 - 1.70 +++ mountd.c28 Nov 2002 17:35:24 - @@ -211,6 +211,11 @@ intxdr_fhs(XDR *, caddr_t); intxdr_mlist(XDR *, caddr_t); void terminate(int); +static char *nmount_fs[] = { + ext2fs, + NULL +}; + struct exportlist *exphead; struct mountlist *mlhead; struct grouplist *grphead; @@ -919,6 +924,8 @@ get_exportlist() struct dirlist *dirhead; struct statfs fsb, *fsp; struct xucred anon; + struct iovec iov[6]; + struct export_args ea; char *cp, *endcp, *dirp, *hst, *usr, *dom, savedc; int len, has_host, exflags, got_nondir, dirplen, num, i, netgrp; @@ -958,6 +965,31 @@ get_exportlist() struct msdosfs_args da; struct ntfs_args na; } targs; + for (cp = *nmount_fs; cp != NULL; cp++) { + if (strcmp(cp, fsp-f_fstypename) == 0) { + ea.ex_flags = MNT_DELEXPORT; + iov[0].iov_base = fstype; + iov[0].iov_len = strlen(iov[0].iov_base) + 1; + iov[1].iov_base = fsp-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 = fsp-f_mntonname; + 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 = ea; + iov[5].iov_len = strlen(iov[5].iov_base) + 1; + if ((nmount(iov, 6, + fsp-f_flags | MNT_UPDATE) 0) + errno != ENOENT) + syslog(LOG_ERR, + can't delete exports for %s: %m, + fsp-f_mntonname); + fsp++; + continue; + } + } if (!strcmp(fsp-f_fstypename, ufs) || !strcmp(fsp-f_fstypename, msdosfs) || @@ -1745,9 +1777,10 @@ do_mount(ep, grp, exflags, anoncrp, dirp { struct statfs fsb1; struct addrinfo *ai; - struct export_args *eap; + struct export_args *eap, ea; + struct iovec iov[6]; char *cp = NULL; - int done; + int done, do_nmount, error; char savedc = '\0'; union { struct ufs_args ua; @@ -1760,6 +1793,15 @@ do_mount(ep, grp, exflags, anoncrp, dirp /* XXX, we assume that all xx_args look like ufs_args. */ args.ua.fspec = 0; eap = args.ua.export; + do_nmount = 0; + + for (cp = *nmount_fs; cp != NULL; cp++) { + if (strcmp(cp, fsb-f_fstypename) == 0) { + bzero(ea, sizeof(ea)); + eap = ea; + do_nmount = 1; + } + } eap-ex_flags = exflags; eap-ex_anon = *anoncrp; @@ -1784,10 +1826,10 @@ do_mount(ep, grp, exflags, anoncrp, dirp goto skip; eap-ex_addr = (struct sockaddr *)grp-gr_ptr.gt_net.nt_net; - eap-ex_addrlen = args.ua.export.ex_addr-sa_len; + eap-ex_addrlen = eap-ex_addr-sa_len; eap-ex_mask = (struct sockaddr *)grp-gr_ptr.gt_net.nt_mask; - eap-ex_masklen = args.ua.export.ex_mask-sa_len; + eap-ex_masklen = eap-ex_mask-sa_len; break; case GT_DEFAULT: eap-ex_addr = NULL; @@ -1812,8 +1854,26 @@ do_mount(ep,
Re: ext2fs and NFS exporting wackyness
Maxime Henrion wrote: Emiel Kollof wrote: * Juli Mallett ([EMAIL PROTECTED]) wrote: kernel: ext2fs doesn't support the old mount syscall mountd[344]: could not remount /storage: Operation not supported I have the same problem, more or less, with UFS :( I can no longer set up an NFS server, but only started investigating/doing-this tonight. Hmm, that _is_ kinda shitty, Now I must unplug that disk and share it from somewhere else, because I kinda need that data on the network here. 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 ? Cheers, Maxime Index: mountd.c === RCS file: /space2/ncvs/src/usr.sbin/mountd/mountd.c,v retrieving revision 1.70 diff -u -p -r1.70 mountd.c --- mountd.c16 Oct 2002 16:04:50 - 1.70 +++ mountd.c28 Nov 2002 18:03:48 - @@ -211,6 +211,11 @@ intxdr_fhs(XDR *, caddr_t); intxdr_mlist(XDR *, caddr_t); void terminate(int); +static char *nmount_fs[] = { + ext2fs, + NULL +}; + struct exportlist *exphead; struct mountlist *mlhead; struct grouplist *grphead; @@ -919,7 +924,9 @@ get_exportlist() struct dirlist *dirhead; struct statfs fsb, *fsp; struct xucred anon; - char *cp, *endcp, *dirp, *hst, *usr, *dom, savedc; + struct iovec iov[6]; + struct export_args ea; + char **fs, *cp, *endcp, *dirp, *hst, *usr, *dom, savedc; int len, has_host, exflags, got_nondir, dirplen, num, i, netgrp; dirp = NULL; @@ -958,6 +965,31 @@ get_exportlist() struct msdosfs_args da; struct ntfs_args na; } targs; + for (fs = nmount_fs; *fs != NULL; fs++) { + if (strcmp(*fs, fsp-f_fstypename) == 0) { + ea.ex_flags = MNT_DELEXPORT; + iov[0].iov_base = fstype; + iov[0].iov_len = strlen(iov[0].iov_base) + 1; + iov[1].iov_base = fsp-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 = fsp-f_mntonname; + 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 = ea; + iov[5].iov_len = sizeof(ea); + if ((nmount(iov, 6, + fsp-f_flags | MNT_UPDATE) 0) + errno != ENOENT) + syslog(LOG_ERR, + can't delete exports for %s: %m, + fsp-f_mntonname); + fsp++; + continue; + } + } if (!strcmp(fsp-f_fstypename, ufs) || !strcmp(fsp-f_fstypename, msdosfs) || @@ -1745,9 +1777,10 @@ do_mount(ep, grp, exflags, anoncrp, dirp { struct statfs fsb1; struct addrinfo *ai; - struct export_args *eap; - char *cp = NULL; - int done; + struct export_args *eap, ea; + struct iovec iov[6]; + char **fs, *cp = NULL; + int done, do_nmount, error; char savedc = '\0'; union { struct ufs_args ua; @@ -1760,6 +1793,15 @@ do_mount(ep, grp, exflags, anoncrp, dirp /* XXX, we assume that all xx_args look like ufs_args. */ args.ua.fspec = 0; eap = args.ua.export; + do_nmount = 0; + + for (fs = nmount_fs; *fs != NULL; fs++) { + if (strcmp(*fs, fsb-f_fstypename) == 0) { + bzero(ea, sizeof(ea)); + eap = ea; + do_nmount = 1; + } + } eap-ex_flags = exflags; eap-ex_anon = *anoncrp; @@ -1784,10 +1826,10 @@ do_mount(ep, grp, exflags, anoncrp, dirp goto skip; eap-ex_addr = (struct sockaddr *)grp-gr_ptr.gt_net.nt_net; - eap-ex_addrlen = args.ua.export.ex_addr-sa_len; + eap-ex_addrlen = eap-ex_addr-sa_len; eap-ex_mask = (struct sockaddr *)grp-gr_ptr.gt_net.nt_mask; - eap-ex_masklen =
Re: ext2fs and NFS exporting wackyness
* Maxime Henrion ([EMAIL PROTECTED]) wrote: Can you try the attached patch and tell me if it works ? Tried it, and no, it doesn't work. Also, when I kill mountd and restart it, I get a kernel panic. HUPping mountd just gives the same error. Cheers, Emiel -- A diplomat is a man who can convince his wife she'd look stout in a fur coat. To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: ext2fs and NFS exporting wackyness
* Maxime Henrion ([EMAIL PROTECTED]) wrote: There were stupid mistakes in this patch. Can you try this one instead ? *grin* NOW you tell me... geez :) Well, disregard that previous report then, is was based on your old patch. Cheers, Emiel To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: ext2fs and NFS exporting wackyness
* Maxime Henrion ([EMAIL PROTECTED]) wrote: There were stupid mistakes in this patch. Can you try this one instead ? Yes, this one seems to work. Cheers, Emiel -- Good day to avoid cops. Crawl to school. To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: ext2fs and NFS exporting wackyness
Emiel Kollof wrote: * Maxime Henrion ([EMAIL PROTECTED]) wrote: There were stupid mistakes in this patch. Can you try this one instead ? Yes, this one seems to work. I'm also interested in the panic you got with the previous broken patch. What was the panic message ? Can you get a stacktrace ? Thanks, Maxime To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: ext2fs and NFS exporting wackyness
* Emiel Kollof ([EMAIL PROTECTED]) wrote: There were stupid mistakes in this patch. Can you try this one instead ? Yes, this one seems to work. Hold on.. now remote hosts _see_ the ext2fs share, but mounting will not work. Yes it will mount without failing, but accessing won't work. From a remote host (A FreeBSD STABLE one): [root@tiamat]:/root mount 10.0.0.11:/storage /mnt/azazel [root@tiamat]:/root cd /mnt/azazel /mnt/azazel: Input/output error. Help? Cheers, Emiel -- I've seen, I SAY, I've seen better heads on a mug of beer -- Senator Claghorn To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: ext2fs and NFS exporting wackyness
Emiel Kollof wrote: * Emiel Kollof ([EMAIL PROTECTED]) wrote: There were stupid mistakes in this patch. Can you try this one instead ? Yes, this one seems to work. Hold on.. now remote hosts _see_ the ext2fs share, but mounting will not work. Yes it will mount without failing, but accessing won't work. From a remote host (A FreeBSD STABLE one): [root@tiamat]:/root mount 10.0.0.11:/storage /mnt/azazel [root@tiamat]:/root cd /mnt/azazel /mnt/azazel: Input/output error. This looks like a totally different problem. I'm not sure if NFS exported ext2fs partitions actually ever work. Bruce, any input on this one ? Cheers, Maxime To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
ext2fs and NFS exporting wackyness
Hey folks, I'm having some odd trouble with exporting a ext2fs with NFS. First of, some info: uname: FreeBSD azazel.ipv6.hackerheaven.org 5.0-CURRENT FreeBSD 5.0-CURRENT #1: Wed Nov 27 19:59:24 CET 2002 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/AZAZEL i386 mount_ext2fs.c: $FreeBSD: src/sbin/mount_ext2fs/mount_ext2fs.c,v 1.15 2002/08/13 16:06:14 m ux Exp $ fstab snippet: /dev/ad2s1 /storage ext2fs rw,noatime 0 0 Note that the ext2 slice mounts fine and reading/writing data to/from it works like a charm. exports snippet: /storage -alldirs -network 10.0.0.0 -mask 255.255.255.0 Seems allright, no? Well, when I invoke or HUP mountd, the following happens: kernel: ext2fs doesn't support the old mount syscall mountd[344]: could not remount /storage: Operation not supported mountd[344]: bad exports list line /home -alldirs -network 10.0.0.0 -mask 255.255.255.0 It _should_ export fine, but the remounting does not work, causing mountd to think something's amiss and abort my cunning plan to share data across my network. Is this a known issue? Or have I just stumbled onto something? Is this something in mount_ext2fs that's gone haywire? Cheers, Emiel -- In Dr. Johnson's famous dictionary patriotism is defined as the last resort of the scoundrel. With all due respect to an enlightened but inferior lexicographer I beg to submit that it is the first. -- Ambrose Bierce, The Devil's Dictionary To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: ext2fs and NFS exporting wackyness
* De: Emiel Kollof [EMAIL PROTECTED] [ Data: 2002-11-27 ] [ Subjecte: ext2fs and NFS exporting wackyness ] kernel: ext2fs doesn't support the old mount syscall mountd[344]: could not remount /storage: Operation not supported mountd[344]: bad exports list line /home -alldirs -network 10.0.0.0 -mask 255.255.255.0 I have the same problem, more or less, with UFS :( I can no longer set up an NFS server, but only started investigating/doing-this tonight. juli. -- Juli Mallett [EMAIL PROTECTED] OpenDarwin, Mono, FreeBSD Developer. ircd-hybrid Developer, EFnet addict. FreeBSD on MIPS-Anything on FreeBSD. To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: ext2fs and NFS exporting wackyness
* Emiel Kollof ([EMAIL PROTECTED]) wrote: Sorry for the reply to self, this needs some clarifying before people jump to all the wrong conclusions: kernel: ext2fs doesn't support the old mount syscall mountd[344]: could not remount /storage: Operation not supported mountd[344]: bad exports list line /home -alldirs -network 10.0.0.0 -mask 255.255.255.0 That's when you get when you forget from which xterm you paste :) This slice was indeed first mounted at /home and later /storage. I assure you that the error is the same, wven while the paths show different here,. Oh, the pid being the same is just sheer coincidence because there was a reboot between the two. Don't be alarmed :) Cheers, Emiel -- /usr/games/fortune: Segmentation Fault (core dumped) (just kidding!) To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: ext2fs and NFS exporting wackyness
* Juli Mallett ([EMAIL PROTECTED]) wrote: kernel: ext2fs doesn't support the old mount syscall mountd[344]: could not remount /storage: Operation not supported I have the same problem, more or less, with UFS :( I can no longer set up an NFS server, but only started investigating/doing-this tonight. Hmm, that _is_ kinda shitty, Now I must unplug that disk and share it from somewhere else, because I kinda need that data on the network here. Can this be patched by doing some subtitutions in the files that use the old mount syscall? Or is it more hairy than that? Cheers, Emiel -- Why be a man when you can be a success? -- Bertold Brecht To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message