Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Apr 2012 15:11:03 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Sergey Kandaurov <pluknet@gmail.com>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: [patch] ufs extattr panic w/ quota under DIAGNOSTIC
Message-ID:  <20120409121103.GL2358@deviant.kiev.zoral.com.ua>
In-Reply-To: <CAE-mSOKP8UVcPckYppf=d%2B3%2Bf1xQJdXj=NVyZF_uX0JcifLXPQ@mail.gmail.com>
References:  <CAE-mSOKP8UVcPckYppf=d%2B3%2Bf1xQJdXj=NVyZF_uX0JcifLXPQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120409121103.GL2358>