From owner-freebsd-fs@FreeBSD.ORG Mon Apr 9 12:11:11 2012 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E1E23106566B for ; Mon, 9 Apr 2012 12:11:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 587AF8FC12 for ; Mon, 9 Apr 2012 12:11:11 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q39CB4KC030992; Mon, 9 Apr 2012 15:11:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q39CB385049609; Mon, 9 Apr 2012 15:11:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q39CB3G9049608; Mon, 9 Apr 2012 15:11:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 9 Apr 2012 15:11:03 +0300 From: Konstantin Belousov To: Sergey Kandaurov Message-ID: <20120409121103.GL2358@deviant.kiev.zoral.com.ua> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TP7FfcN1qgl8s+1K" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-fs@freebsd.org Subject: Re: [patch] ufs extattr panic w/ quota under DIAGNOSTIC X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2012 12:11:12 -0000 --TP7FfcN1qgl8s+1K Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 09, 2012 at 03:58:50PM +0400, Sergey Kandaurov wrote: > Hi. >=20 > This is a patch to fix ufs extattr panic seen when trying to set extended > attributes on a file system with quotas enabled and options DIAGNOSTIC. >=20 > # setextattr system md5 `md5 -q /boot/kernel/kernel` /boot/kernel/kernel >=20 > The problem is that when getting at chkdquot() from UFS_BALLOC() > it is expected that the vnode to operate extattr on was "prepared" with > getinoquota(). This assertion is explicitly turned off for snapshots and > quota files by setting VV_SYSTEM vnode flag. >=20 > This is probably should be also done for extended attributes. >=20 > Index: sys/ufs/ffs/ffs_vnops.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/ufs/ffs/ffs_vnops.c (revision 233936) > +++ sys/ufs/ffs/ffs_vnops.c (working copy) > @@ -1681,6 +1681,8 @@ vop_setextattr { > return (error); > } >=20 > + ap->a_vp->v_vflag |=3D VV_SYSTEM; > + > error =3D ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td); > if (error) > return (error); >=20 The patch turns off quota for any file that is accessed for setting extended attribute. Why not calling getinoquota(), as it is done for other VOPs modifying the inode ? >=20 > chkdquot: missing dquot > 0xfffffe00483744e0: tag ufs, type VREG > usecount 1, writecount 0, refcount 567 mountedhere 0 > flags () > v_object 0xfffffe004839bbc8 ref 0 pages 2260 > lock type ufs: EXCL by thread 0xfffffe004844a000 (pid 11419, > setextattr, tid 100136) >=20 >=20 > #9 0xffffffff804380f7 in panic (fmt=3DVariable "fmt" is not available. > ) at /usr/src/sys/kern/kern_shutdown.c:633 > #10 0xffffffff80666f94 in chkdquot (ip=3D0xfffffe00669749d8) > at /usr/src/sys/ufs/ufs/ufs_quota.c:479 > #11 0xffffffff8066765c in chkdq (ip=3D0xfffffe00669749d8, change=3D4, > cred=3D0xfffffe0071d0a800, flags=3D0) at /usr/src/sys/ufs/ufs/ufs_quo= ta.c:174 > #12 0xffffffff80632879 in ffs_alloc (ip=3D0xfffffe00669749d8, > lbn=3DVariable "lbn" is not available. > ) > at /usr/src/sys/ufs/ffs/ffs_alloc.c:184 > #13 0xffffffff80635b49 in ffs_balloc_ufs2 (vp=3D0xfffffe006475cc30, > startoffset=3DVariable "startoffset" is not available. > ) > at /usr/src/sys/ufs/ffs/ffs_balloc.c:647 > #14 0xffffffff8065f1e9 in ffs_close_ea (vp=3D0xfffffe006475cc30, > commit=3DVariable "commit" is not available. > ) > at /usr/src/sys/ufs/ffs/ffs_vnops.c:1076 > #15 0xffffffff8065f7d7 in ffs_setextattr (ap=3D0xffffff809097e850) > at /usr/src/sys/ufs/ffs/ffs_vnops.c:1749 > #16 0xffffffff806fd349 in VOP_SETEXTATTR_APV (vop=3D0xffffffff80a3d900, > a=3D0xffffff809097e850) at vnode_if.c:3294 > #17 0xffffffff804ca399 in extattr_set_vp (vp=3D0xfffffe006475cc30, > attrnamespace=3D2, attrname=3D0xffffff809097e9d0 "md5", data=3DVariab= le > "data" is not available. > ) > at vnode_if.h:1480 > #18 0xffffffff804ca6c3 in sys_extattr_set_file (td=3D0xfffffe006d2bb920, > uap=3D0xffffff809097ebb0) at /usr/src/sys/kern/vfs_extattr.c:276 > #19 0xffffffff806b3610 in amd64_syscall (td=3D0xfffffe006d2bb920, traced= =3D0) > at subr_syscall.c:135 >=20 > --=20 > wbr, > pluknet > _______________________________________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" --TP7FfcN1qgl8s+1K Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk+C0dcACgkQC3+MBN1Mb4iQgQCg7cKKbxOs8Y041I/1SAnwZHfN 458AoJtVQjY9yRkE6OAyd/9calUxMLJb =s2sV -----END PGP SIGNATURE----- --TP7FfcN1qgl8s+1K--