Date: Mon, 22 Aug 2011 10:11:30 +0900 (JST) From: Hiroki Sato <hrs@FreeBSD.org> To: rmacklem@uoguelph.ca Cc: pjd@FreeBSD.org, current@FreeBSD.org Subject: Re: fsid change of ZFS? Message-ID: <20110822.101130.49645857563136267.hrs@allbsd.org> In-Reply-To: <59520805.118597.1313885734529.JavaMail.root@erie.cs.uoguelph.ca> References: <20110820.142859.319295417241413417.hrs@allbsd.org> <59520805.118597.1313885734529.JavaMail.root@erie.cs.uoguelph.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
----Security_Multipart0(Mon_Aug_22_10_11_30_2011_622)-- Content-Type: Multipart/Mixed; boundary="--Next_Part(Mon_Aug_22_10_11_30_2011_156)--" Content-Transfer-Encoding: 7bit ----Next_Part(Mon_Aug_22_10_11_30_2011_156)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi Rick, Rick Macklem <rmacklem@uoguelph.ca> wrote in <59520805.118597.1313885734529.JavaMail.root@erie.cs.uoguelph.ca>: rm> Hiroki, could you please test the attached patch. rm> rm> One problem with this patch is that I don't know how to create a fixed rm> table that matches what systems would already have been getting. rm> (I got the first 6 entries by booting a GENERIC i386 kernel with a rm> printf in vfs_init(), so I suspect those don't change much, although rm> I'm not sure if ZFS will usually end up before or after them?) rm> rm> Do you guys know what ZFS gets assigned typically? (I realize that rm> changes w.r.t. when it gets loaded, so the question also becomes rm> "do you know how it typically gets loaded" so the table can have rm> that vfc_typenum value assigned to it?) rm> Maybe you could boot a system with a printf like: rm> rm> printf("%s, %d\n", vfc->vfc_name, vfc->vfc_typenum); rm> rm> just after vfc->vfc_typenum = maxvfsconf++; in vfs_init() and rm> then look in dmesg after booting, to see what your tables look like? rm> (Without the attached patch installed.) rm> rm> Thanks, rick rm> ps: The patch is also at rm> http://people.freebsd.org/~rmacklem/fsid.patch for anyone on rm> the list interested (if the attachment doesn't make it through. rm> rm> rm> rick Yes, we can think the typical number of zfs is 7 on GENERIC. However, I checked vfc_typenum in three boxes around me by using the attached patch for lsvfs(1), but the results were not consistent: Machine A (8-STABLE) | |Filesystem Num Refs Flags |-------------------------------- --- ----- --------------- |msdosfs 1 0 |procfs 2 0 synthetic |devfs 3 4 synthetic |cd9660 4 0 read-only |nfs 5 2 network |ufs 6 6 Machine B (HEAD with newnfs complied) | |Filesystem Num Refs Flags |-------------------------------- --- ----- --------------- |msdosfs 1 0 |ufs 2 5 |nfs 3 0 network |cd9660 4 0 read-only |procfs 5 0 synthetic |devfs 6 1 synthetic |zfs 7 1 jail, delegated-administration | Machine C (HEAD with oldnfs compiled) | |Filesystem Num Refs Flags |-------------------------------- --- ----- --------------- |ufs 1 3 |msdosfs 3 0 |procfs 4 0 synthetic |devfs 5 1 synthetic |oldnfs 6 0 network |cd9660 7 0 read-only |zfs 8 4 jail, delegated-administration |nfs 9 1 network I guess the ordering is timing-dependent and consistent only in the same box. The result of the Machine C was changed like the following after applying the patch. It worked as expected: |Filesystem Num Refs Flags |-------------------------------- --- ----- --------------- |ufs 2 3 |oldnfs 15 0 network |zfs 7 4 jail, delegated-administration |devfs 4 1 synthetic |msdosfs 5 0 |nfs 6 0 network |cd9660 1 0 read-only |procfs 3 0 synthetic Hmm, based on these results it looks difficult to assign the same number to each file system. Anyway, not fixing them is worse, so we may have to accept this as a small upgrade bump in 9.0R. -- Hiroki ----Next_Part(Mon_Aug_22_10_11_30_2011_156)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="lsvfs-20110822-1.diff" Index: usr.bin/lsvfs/lsvfs.1 =================================================================== --- usr.bin/lsvfs/lsvfs.1 (revision 225066) +++ usr.bin/lsvfs/lsvfs.1 (working copy) @@ -2,7 +2,7 @@ .\" Garrett A. Wollman, September 1994 .\" This file is in the public domain. .\" -.Dd March 16, 1995 +.Dd August 22, 2011 .Dt LSVFS 1 .Os .Sh NAME @@ -36,6 +36,8 @@ .Fl t option to .Xr mount 8 +.It Num +the filesystem type number. .It Refs the number of references to this VFS; i.e., the number of currently mounted file systems of this type Index: usr.bin/lsvfs/lsvfs.c =================================================================== --- usr.bin/lsvfs/lsvfs.c (revision 225066) +++ usr.bin/lsvfs/lsvfs.c (working copy) @@ -17,9 +17,9 @@ #include <stdlib.h> #include <string.h> -#define FMT "%-32.32s %5d %s\n" -#define HDRFMT "%-32.32s %5.5s %s\n" -#define DASHES "-------------------------------- ----- ---------------\n" +#define FMT "%-32.32s %3d %5d %s\n" +#define HDRFMT "%-32.32s %3s %5.5s %s\n" +#define DASHES "-------------------------------- --- ----- ---------------\n" static const char *fmt_flags(int); @@ -31,13 +31,14 @@ size_t buflen; argc--, argv++; - printf(HDRFMT, "Filesystem", "Refs", "Flags"); + printf(HDRFMT, "Filesystem", "Num", "Refs", "Flags"); fputs(DASHES, stdout); if(argc) { for(; argc; argc--, argv++) { if (getvfsbyname(*argv, &vfc) == 0) { - printf(FMT, vfc.vfc_name, vfc.vfc_refcount, fmt_flags(vfc.vfc_flags)); + printf(FMT, vfc.vfc_name, vfc.vfc_refcount, vfc.vfc_typenum, + fmt_flags(vfc.vfc_flags)); } else { warnx("VFS %s unknown or not loaded", *argv); rv++; @@ -54,8 +55,8 @@ cnt = buflen / sizeof(struct xvfsconf); for (i = 0; i < cnt; i++) { - printf(FMT, xvfsp[i].vfc_name, xvfsp[i].vfc_refcount, - fmt_flags(xvfsp[i].vfc_flags)); + printf(FMT, xvfsp[i].vfc_name, xvfsp[i].vfc_typenum, + xvfsp[i].vfc_refcount, fmt_flags(xvfsp[i].vfc_flags)); } free(xvfsp); } ----Next_Part(Mon_Aug_22_10_11_30_2011_156)---- ----Security_Multipart0(Mon_Aug_22_10_11_30_2011_622)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk5RrMIACgkQTyzT2CeTzy2WYwCfXknnBZRAFm9Hzu4qUsklr01N ajEAn2LOzAbNni8wQ/s0RCkZTnpSzJus =/TXR -----END PGP SIGNATURE----- ----Security_Multipart0(Mon_Aug_22_10_11_30_2011_622)----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110822.101130.49645857563136267.hrs>