Date: Thu, 22 Oct 2009 20:10:03 GMT From: Jaakko Heinonen <jh@FreeBSD.org> To: freebsd-fs@FreeBSD.org Subject: Re: kern/139806: [zfs] [panic] Write attempt to file in ZFS snapshot dir causes panic Message-ID: <200910222010.n9MKA3YG090955@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/139806; it has been noted by GNATS. From: Jaakko Heinonen <jh@FreeBSD.org> To: Carl Chave <online@chave.us> Cc: bug-followup@FreeBSD.org Subject: Re: kern/139806: [zfs] [panic] Write attempt to file in ZFS snapshot dir causes panic Date: Thu, 22 Oct 2009 22:50:56 +0300 Hi, On 2009-10-21, Carl Chave wrote: > Fixit# echo hello >> test.txt > panic: dirtying snapshot! The problem seems to be that in certain conditions zfs_freebsd_access() uses only vaccess(9) for access check. However vaccess(9) doesn't handle the read-only file system case. Could you try this patch? --- patch begins here --- Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c (revision 198368) +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c (working copy) @@ -3989,7 +3989,12 @@ struct thread *a_td; } */ *ap; { + int error; + error = zfs_access(ap->a_vp, ap->a_accmode, 0, ap->a_cred, NULL); + if (error != 0) + return (error); + /* * ZFS itself only knowns about VREAD, VWRITE and VEXEC, the rest * we have to handle by calling vaccess(). @@ -3999,11 +4004,11 @@ znode_t *zp = VTOZ(vp); znode_phys_t *zphys = zp->z_phys; - return (vaccess(vp->v_type, zphys->zp_mode, zphys->zp_uid, - zphys->zp_gid, ap->a_accmode, ap->a_cred, NULL)); + error = vaccess(vp->v_type, zphys->zp_mode, zphys->zp_uid, + zphys->zp_gid, ap->a_accmode, ap->a_cred, NULL); } - return (zfs_access(ap->a_vp, ap->a_accmode, 0, ap->a_cred, NULL)); + return (error); } static int --- patch ends here --- -- Jaakko
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910222010.n9MKA3YG090955>