Re: df -l broken

2001-11-30 Thread Maxime Henrion

Joerg Wunsch wrote:
 Maxime Henrion [EMAIL PROTECTED] wrote:
 
  I looked at the code a bit more closely and you're entirely right.  I
  think I figured out why my patch caused a core dump.  Here is a more
  correct patch that should fix the problem without causing core dumps.
 
 Seems to work.  mount(8) has still the problem though:

Great, I'll file a PR for it.  Thanks for the feedback !

 uriah # mount -t local
 uriah # kldload nfs
 uriah # mount -t local
 uriah # mount -t nonfs
 /dev/da0a on / (ufs, local, soft-updates)
 devfs on /dev (devfs, local)
 /dev/vinum/var on /var (ufs, local, soft-updates)
 /dev/vinum/usr on /usr (ufs, local, soft-updates)
 /dev/vinum/home on /home (ufs, local, soft-updates)
 /dev/vinum/home_cvs on /home/cvs (ufs, NFS exported, local, soft-updates)
 /dev/vinum/src on /usr/src (ufs, local, soft-updates)
 /dev/vinum/othersrc on /usr/othersrc (ufs, local, soft-updates)
 /dev/vinum/obj on /usr/obj (ufs, local, soft-updates)
 /dev/vinum/ports on /usr/ports (ufs, local, soft-updates)
 /dev/vinum/distfiles on /usr/ports/distfiles (ufs, NFS exported, local, soft-updates)
 /dev/vinum/news on /var/spool/news (ufs, local, soft-updates)
 /dev/vinum/tmp on /tmp (ufs, NFS exported, local, soft-updates)
 /dev/vinum/release on /usr/release (ufs, NFS exported, local, soft-updates)
 /dev/vinum/junk on /junk (ufs, local, soft-updates)
 procfs on /proc (procfs, local, read-only)

I fail to see why should ``mount -t local'' work.  I don't see anything
related in the mount(8) manpage.  To my knowledge, -t is only used when
specifying a particular fs type (nfs, msdosfs, ...) optionally prepended
with a ``no''.  If you point me to the relevant documentation, I'll be
happy to fix this bug too.

Thanks,
Maxime Henrion
-- 
Don't be fooled by cheap finnish imitations ; BSD is the One True Code

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: df -l broken

2001-11-30 Thread Joerg Wunsch

As Maxime Henrion wrote:

  Seems to work.  mount(8) has still the problem though:
 
 Great, I'll file a PR for it.  Thanks for the feedback !

I can commit it if you want.

 I fail to see why should ``mount -t local'' work.

ISTR that it used to work, at least in the context of
mount -a -t local.

I can't seem to find any old system to verify this claim, however.

So maybe it's merely wishful thinking instead of something that
has actually once been there...
-- 
cheers, Jorg   .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: df -l broken

2001-11-29 Thread Mikko Tyolajarvi

In local.freebsd.current you write:

On Mon, Nov 26, 2001 at 12:07:22AM +0100, Maxime Henrion wrote:
 If my patch is exact, then the bug should manifest itself only if there
 are no network filesystems mounted.  Do you have any network fs mounted
 on your box ?

No networked filesystems here, and no problems:

They don't have to be mounted, just loaded.  E.g. if nfs
shows up with lsvfs, df -l  will work, if not, it won't.
(dunno about other network file systems).

Thus:

  gw% lsvfs
  FilesystemRefs Flags
   - ---
  ufs  5 
  procfs   1 synthetic
  gw% df -l
  gw% 
  gw% su -m
  Password:
  gw# kldload nfs
  gw# ^D
  gw% lsvfs
  FilesystemRefs Flags
   - ---
  ufs  5 
  procfs   1 synthetic
  nfs  0 network
  gw% df -l
  Filesystem  1K-blocks UsedAvail Capacity  Mounted on
  /dev/ad0s1a25406345332   18840619%/
  /dev/ad0s1g  34487716  1482012 30246688 5%/home
  /dev/ad0s1e   2032623   519974  135004028%/usr
  /dev/ad0s1f   2032623 2901  1867113 0%/var
  procfs  440   100%/proc
  /dev/vn0c  1300204   119616 0%/tmp

(This is on -STABLE, BTW)

  $.02,
  /Mikko

[341]nathan@bokonon:~% df -k
Filesystem  1K-blocks UsedAvail Capacity  Mounted on
/dev/da0s1a 99191529933826358%/
devfs   110   100%/dev
/dev/da0s1f   6450317  4945823   98846983%/usr
/dev/da0s1e 99191 781683440 9%/var
procfs  440   100%/proc
[342]nathan@bokonon:~% df -l
Filesystem  512-blocks UsedAvail Capacity  Mounted on
/dev/da0s1a 198382   1059867652658%/
devfs220   100%/dev
/dev/da0s1f   12900634  9891646  197693883%/usr
/dev/da0s1e 19838215632   166880 9%/var
procfs   880   100%/proc
[343]nathan@bokonon:~% uname -a
FreeBSD bokonon.rtfm.net 5.0-CURRENT FreeBSD 5.0-CURRENT #2: Sun Nov  4 23:28:25 EST 
2001 [EMAIL PROTECTED]:/usr/src/sys/i386/compile/SAN_LORENZO  i386

[...]
-- 
 Mikko Työläjä[EMAIL PROTECTED]
 RSA Security

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: df -l broken

2001-11-29 Thread Maxime Henrion

Mikko Tyolajarvi wrote:
 In local.freebsd.current you write:
 
 On Mon, Nov 26, 2001 at 12:07:22AM +0100, Maxime Henrion wrote:
  If my patch is exact, then the bug should manifest itself only if there
  are no network filesystems mounted.  Do you have any network fs mounted
  on your box ?
 
 No networked filesystems here, and no problems:
 
 They don't have to be mounted, just loaded.  E.g. if nfs
 shows up with lsvfs, df -l  will work, if not, it won't.
 (dunno about other network file systems).
[...]

I looked at the code a bit more closely and you're entirely right.  I
think I figured out why my patch caused a core dump.  Here is a more
correct patch that should fix the problem without causing core dumps.

--- df.c1 Aug 2001 02:09:09 -   1.32
+++ df.c30 Nov 2001 01:06:52 -
@@ -561,7 +561,9 @@
*strptr = ',';
free(listptr[i]);
}
-   *(--strptr) = NULL;
+   if (i  0)
+   strptr--;
+   *strptr = NULL;

free(listptr);
return (str);

I would be happy to get some feedback, especially from the person who
got a core dump. :-)

Thanks,
Maxime Henrion
-- 
Don't be fooled by cheap finnish imitations ; BSD is the One True Code

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: df -l broken

2001-11-29 Thread Mikko Työläjärvi

On Fri, 30 Nov 2001, Maxime Henrion wrote:

 Mikko Tyolajarvi wrote:
[...]
  They don't have to be mounted, just loaded.  E.g. if nfs
  shows up with lsvfs, df -l  will work, if not, it won't.
  (dunno about other network file systems).
 [...]

 I looked at the code a bit more closely and you're entirely right.  I
 think I figured out why my patch caused a core dump.  Here is a more
 correct patch that should fix the problem without causing core dumps.


FWIW: Seems to solve the problem on -STABLE.  Didn't try your earlier
attempt, so I don't have any core dump experiences ;-)

   $.02,
   /Mikko

 Mikko Työläjä[EMAIL PROTECTED]
 RSA Security


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: df -l broken

2001-11-29 Thread Joerg Wunsch

Maxime Henrion [EMAIL PROTECTED] wrote:

 I looked at the code a bit more closely and you're entirely right.  I
 think I figured out why my patch caused a core dump.  Here is a more
 correct patch that should fix the problem without causing core dumps.

Seems to work.  mount(8) has still the problem though:

uriah # mount -t local
uriah # kldload nfs
uriah # mount -t local
uriah # mount -t nonfs
/dev/da0a on / (ufs, local, soft-updates)
devfs on /dev (devfs, local)
/dev/vinum/var on /var (ufs, local, soft-updates)
/dev/vinum/usr on /usr (ufs, local, soft-updates)
/dev/vinum/home on /home (ufs, local, soft-updates)
/dev/vinum/home_cvs on /home/cvs (ufs, NFS exported, local, soft-updates)
/dev/vinum/src on /usr/src (ufs, local, soft-updates)
/dev/vinum/othersrc on /usr/othersrc (ufs, local, soft-updates)
/dev/vinum/obj on /usr/obj (ufs, local, soft-updates)
/dev/vinum/ports on /usr/ports (ufs, local, soft-updates)
/dev/vinum/distfiles on /usr/ports/distfiles (ufs, NFS exported, local, soft-updates)
/dev/vinum/news on /var/spool/news (ufs, local, soft-updates)
/dev/vinum/tmp on /tmp (ufs, NFS exported, local, soft-updates)
/dev/vinum/release on /usr/release (ufs, NFS exported, local, soft-updates)
/dev/vinum/junk on /junk (ufs, local, soft-updates)
procfs on /proc (procfs, local, read-only)

-- 
cheers, Jorg   .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: df -l broken

2001-11-26 Thread NAKAMURA Kazushi

  In my dual Pentium3/1GHz box:

% uname -a
FreeBSD mako.kobe1995.net 5.0-CURRENT-20010830-JPSNAP FreeBSD 
5.0-CURRENT-20010830-JPSNAP #9: Sat Nov  3 17:05:25 JST 2001 
[EMAIL PROTECTED]:/usr/obj/usr/src/sys/KOBE5SMP  i386
% df -l
Filesystem  1K-blocks UsedAvail Capacity  Mounted on
/dev/da0s1a127023572155964749%/
devfs   110   100%/dev
/dev/da0s1e   3935347   112806  3507714 3%/usr
/dev/da0s2a127023346898217330%/altroot
procfs  440   100%/proc
% 

In article [EMAIL PROTECTED]
[EMAIL PROTECTED] writes:
If my patch is exact, then the bug should manifest itself only if there
are no network filesystems mounted.  Do you have any network fs mounted
on your box ?

% df
Filesystem1K-blocks UsedAvail Capacity  Mounted on
/dev/da0s1a  127023572155964749%/
devfs 110   100%/dev
/dev/da0s1e 3935347   112806  3507714 3%/usr
/dev/da0s2a  127023346898217330%/altroot
procfs440   100%/proc
ace:/home   2318686  1079119  105407351%/home
ace:/var/mail 63567   6558417 0%/var/mail
safa:/mnt 113956615 1048400860   100%/mnt
safa:/usr/local 1016047   9605325551595%/usr/local
safa:/usr/X11R6 1016047   9605325551595%/usr/X11R6
safa:/mnt/ftp/pub/obj 113956615 1048400860   100%/usr/obj
-- 
mailto:[EMAIL PROTECTED]   NAKAMURA Kazushi@KOBE
http://kobe1995.net/~kaz/index-e.html
- Break the hate chain. No more kill!

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: df -l broken

2001-11-26 Thread Paul van der Zwan

 Paul van der Zwan wrote:
  
  I noticed the -l option of the df command is broken. It is supposed to 
  print df for local filesystems but on my system it prints nothing at all.
  I had a quick look at the code , as far as I can tell it uses sysctl to
  figure out the mounted filesystems but thinks all of them are non-local and
  ignores them.
  Using sysctl -a I could not find any entries which looked vaguely like
  describing a mount..
  
  Paul
 
 Could you please test the attached patch ?  I did it in a hurry but it
 may fix the problem.
 

It looks ok to me, just the local mounts show up..


Paul

-- 
Paul van der Zwan   paulz @ trantor.xs4all.nl
I think I'll move to theory, everything works in theory...



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



df -l broken

2001-11-25 Thread Paul van der Zwan


I noticed the -l option of the df command is broken. It is supposed to 
print df for local filesystems but on my system it prints nothing at all.
I had a quick look at the code , as far as I can tell it uses sysctl to
figure out the mounted filesystems but thinks all of them are non-local and
ignores them.
Using sysctl -a I could not find any entries which looked vaguely like
describing a mount..

Paul


-- 
I have discovered the art of deceiving diplomats. I tell them the truth
and they never believe me.
-- Camillo Di Cavour



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: df -l broken

2001-11-25 Thread David Wolfskill

Date: Sun, 25 Nov 2001 22:41:01 +0100
From: Paul van der Zwan [EMAIL PROTECTED]

I noticed the -l option of the df command is broken

That differs from my experience:

d141[1] df -l
Filesystem  1K-blocks UsedAvail Capacity  Mounted on
/dev/ad0s3a158783939195216264%/
devfs   110   100%/dev
/dev/ad0s1a158767652608080645%/S1
/dev/ad0s1e   1871095  1059572   66183662%/S1/usr
/dev/ad0s2a158767   1039454212171%/S2
/dev/ad0s2e   1871095   804588   91682047%/S2/usr
/dev/ad0s3e   1870751  1172006   54908568%/usr
/dev/ad0s3g   101630358597   876402 6%/var
/dev/ad0s3h  10277074  5916668  353824163%/common
procfs  440   100%/proc
/dev/md10c 520140   24   478508 0%/tmp
d141[2] uname -a
FreeBSD d141.catwhisker.org 5.0-CURRENT FreeBSD 5.0-CURRENT #182: Sun Nov 25 10:
59:43 PST 2001 [EMAIL PROTECTED]:/common/S3/obj/usr/src/sys/LAPTOP_30
W  i386
d141[3] ssh freebeast tail /var/log/cvsup-history.log
CVSup begin from cvsup13.freebsd.org at Wed Nov 21 03:47:15 PST 2001
CVSup ended from cvsup13.freebsd.org at Wed Nov 21 03:53:35 PST 2001
CVSup begin from cvsup14.freebsd.org at Thu Nov 22 03:47:02 PST 2001
CVSup ended from cvsup14.freebsd.org at Thu Nov 22 03:53:07 PST 2001
CVSup begin from cvsup14.freebsd.org at Fri Nov 23 03:47:02 PST 2001
CVSup ended from cvsup14.freebsd.org at Fri Nov 23 03:53:23 PST 2001
CVSup begin from cvsup14.freebsd.org at Sat Nov 24 03:47:06 PST 2001
CVSup ended from cvsup14.freebsd.org at Sat Nov 24 03:53:47 PST 2001
CVSup begin from cvsup14.freebsd.org at Sun Nov 25 03:47:02 PST 2001
CVSup ended from cvsup14.freebsd.org at Sun Nov 25 03:52:57 PST 2001
d141[4]

Cheers,
david
-- 
David H. Wolfskill  [EMAIL PROTECTED]
As a computing professional, I believe it would be unethical for me to
advise, recommend, or support the use (save possibly for personal
amusement) of any product that is or depends on any Microsoft product.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: df -l broken

2001-11-25 Thread Maxime Henrion

Paul van der Zwan wrote:
 
 I noticed the -l option of the df command is broken. It is supposed to 
 print df for local filesystems but on my system it prints nothing at all.
 I had a quick look at the code , as far as I can tell it uses sysctl to
 figure out the mounted filesystems but thinks all of them are non-local and
 ignores them.
 Using sysctl -a I could not find any entries which looked vaguely like
 describing a mount..
 
   Paul

Could you please test the attached patch ?  I did it in a hurry but it
may fix the problem.

Thanks,
Maxime Henrion
-- 
Don't be fooled by cheap finnish imitations ; BSD is the One True Code


Index: df.c
===
RCS file: /home/ncvs/src/bin/df/df.c,v
retrieving revision 1.32
diff -u -r1.32 df.c
--- df.c1 Aug 2001 02:09:09 -   1.32
+++ df.c25 Nov 2001 22:57:49 -
@@ -561,7 +561,8 @@
*strptr = ',';
free(listptr[i]);
}
-   *(--strptr) = NULL;
+   if (i  0)
+   *(--strptr) = NULL;
 
free(listptr);
return (str);



Re: df -l broken

2001-11-25 Thread Maxime Henrion

David Wolfskill wrote:
 Date: Sun, 25 Nov 2001 22:41:01 +0100
 From: Paul van der Zwan [EMAIL PROTECTED]
 
 I noticed the -l option of the df command is broken
 
 That differs from my experience:
 
 d141[1] df -l
 Filesystem  1K-blocks UsedAvail Capacity  Mounted on
 /dev/ad0s3a158783939195216264%/
 devfs   110   100%/dev
 /dev/ad0s1a158767652608080645%/S1
 /dev/ad0s1e   1871095  1059572   66183662%/S1/usr
 /dev/ad0s2a158767   1039454212171%/S2
 /dev/ad0s2e   1871095   804588   91682047%/S2/usr
 /dev/ad0s3e   1870751  1172006   54908568%/usr
 /dev/ad0s3g   101630358597   876402 6%/var
 /dev/ad0s3h  10277074  5916668  353824163%/common
 procfs  440   100%/proc
 /dev/md10c 520140   24   478508 0%/tmp
[...]

If my patch is exact, then the bug should manifest itself only if there
are no network filesystems mounted.  Do you have any network fs mounted
on your box ?

Thanks,
Maxime Henrion
-- 
Don't be fooled by cheap finnish imitations ; BSD is the One True Code

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message