Subject: Re: kern/36284
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Geoff Wing <gcw@pobox.com>
List: netbsd-bugs
Date: 05/21/2007 01:40:03
The following reply was made to PR kern/36284; it has been noted by GNATS.
From: Geoff Wing <gcw@pobox.com>
To: gnats-bugs@NetBSD.org
Cc: Kurt Schreiner <ks@ub.uni-mainz.de>,
David Laight <dsl@NetBSD.org>
Subject: Re: kern/36284
Date: Mon, 21 May 2007 11:37:54 +1000
On Saturday 2007-05-19 14:25 +0000, Kurt Schreiner output:
:From: Kurt Schreiner <ks@ub.uni-mainz.de>
:To: gnats-bugs@NetBSD.org
:Cc: David Laight <dsl@NetBSD.org>
:Subject: Re: kern/36284
:Date: Sat, 19 May 2007 16:23:57 +0200
:
: this was introduced between 29.04.2007_23:59 and 30.04.2007_23:59.
: Below's a diff of ident <kernel_from_29...> and ident <kernel_from_30...>.
: Maybe some of the changes to vfs_syscalls causes the "shining through"
: of files from the lower layer?
: < $NetBSD: vfs_syscalls.c,v 1.310 2007/04/22 08:30:01 dsl Exp $
: ---
: > $NetBSD: vfs_syscalls.c,v 1.311 2007/04/30 08:32:14 dsl Exp $
Good pick. There was a logic inversion introduced here in sys_fstatvfs1().
- if ((error = dostatvfs(mp, sb, l, SCARG(uap, flags), 1)) != 0)
- goto out;
- error = copyout(sb, SCARG(uap, buf), sizeof(*sb));
- out:
- FILE_UNUSE(fp, l);
+ error = do_sys_fstatvfs(l, SCARG(uap, fd), SCARG(uap, flags), sb);
+ if (error != 0)
+ error = copyout(sb, SCARG(uap, buf), sizeof(*sb));
Regards,
Geoff
--- sys/kern/vfs_syscalls.c.org 2007-05-21 11:22:13.000000000 +1000
+++ sys/kern/vfs_syscalls.c 2007-05-21 11:25:34.000000000 +1000
@@ -881,7 +881,7 @@
sb = STATVFSBUF_GET();
error = do_sys_fstatvfs(l, SCARG(uap, fd), SCARG(uap, flags), sb);
- if (error != 0)
+ if (error == 0)
error = copyout(sb, SCARG(uap, buf), sizeof(*sb));
STATVFSBUF_PUT(sb);
return error;