From owner-cvs-all@FreeBSD.ORG Sat Apr 24 11:22:34 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B8B6816A4CE; Sat, 24 Apr 2004 11:22:34 -0700 (PDT) Received: from sev.net.ua (sev.net.ua [212.86.233.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id F1D6443D39; Sat, 24 Apr 2004 11:22:32 -0700 (PDT) (envelope-from shadow@psoft.net) Received: from berloga.shadowland ([213.227.237.65]) by sev.net.ua (8.12.10/8.12.9) with ESMTP id i3OIMUv0075004; Sat, 24 Apr 2004 21:22:30 +0300 (EEST) (envelope-from shadow@psoft.net) Received: from berloga.shadowland (berloga.shadowland [127.0.0.1]) by berloga.shadowland (8.12.10/8.12.10) with ESMTP id i3OIMU3X009174; Sat, 24 Apr 2004 21:22:30 +0300 Received: (from root@localhost) by berloga.shadowland (8.12.10/8.12.10/Submit) id i3OIMTwp009172; Sat, 24 Apr 2004 21:22:29 +0300 From: Alex Lyashkov To: Pawel Jakub Dawidek In-Reply-To: <20040422233154.GY24376@darkness.comp.waw.pl> References: <200404221540.i3MFeSIM038514@repoman.freebsd.org> <20040422231910.GB709@timesink.dyndns.org> <20040422233154.GY24376@darkness.comp.waw.pl> Content-Type: multipart/mixed; boundary="=-8zguUUZ7HzlcEhU90OeI" Organization: PSoft Message-Id: <1082830949.8545.11.camel@berloga.shadowland> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-1) Date: Sat, 24 Apr 2004 21:22:29 +0300 cc: Thomas Moestl cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern vfs_syscalls.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2004 18:22:34 -0000 --=-8zguUUZ7HzlcEhU90OeI Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable =F7 =F0=D4=CE, 23.04.2004, =D7 02:31, Pawel Jakub Dawidek =D0=C9=DB=C5=D4: > On Fri, Apr 23, 2004 at 01:19:10AM +0200, Thomas Moestl wrote: > +> On Thu, 2004/04/22 at 08:40:28 -0700, Pawel Jakub Dawidek wrote: > +> > pjd 2004/04/22 08:40:27 PDT > +> >=20 > +> > FreeBSD src repository > +> >=20 > +> > Modified files: > +> > sys/kern vfs_syscalls.c=20 > +> > Log: > +> > Look out! vn_start_write() is able to return 0 and NULL 'mp'. > +>=20 > +> Hmmm, I'm not sure, but wasn't the real bug to use the struct mount * > +> that vn_start_write() returns instead of nd.ni_vp->v_mount (or at > +> least, not using nd.ni_vp->v_mount if mp turns out to be NULL)?=20 > +> extattrctl() chooses that way. > +> It seems that file systems are not required to implement > +> VOP_GETWRITEMOUNT(), but could choose to implement VFS_QUOTACTL() > +> anyway (although IIRC there currently are none that maintain this > +> combination), so unconditionally returning EOPNOTSUPP would be too > +> strict. > +>=20 > +> The only case where the mount point of the vnode and the mount point > +> returned by vn_start_write() should differ is when unionfs is > +> involved; in that case, the correct semantics of quotactl() is a bit > +> doubtful, and so unionfs does not support quotactl() at all; thus > +> using the mount point of the vnode should not break anything. >=20 > Yes. Even quotactl(2) in RELENG_4 is using nd.ni_vp->v_mount. > Anyone want to test this patch: >=20 > http://people.freebsd.org/~pjd/patches/vfs_syscalls.c.3.patch It`s patch wrong. After it box have panic with message - negative cnt at vn_finished_write. At mail I attach patch who not have panic and use nd.ni_vp->v_mount if vn_start_write return NULL in mp. =20 --=20 Alex Lyashkov PSoft --=-8zguUUZ7HzlcEhU90OeI Content-Description: Content-Disposition: attachment; filename=patch Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: base64 PyBsb2cNCkluZGV4OiB2ZnNfc3lzY2FsbHMuYw0KPT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09P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