Change FAPPEND to IO_APPEND as this is a ioflag and not a fflag.

This corrects writing to append-only files on ZFS.

PR:		kern/149495 [1], kern/151082 [2]
Submitted by:	Daniel Zhelev <daniel@zhelev.biz> [1], Michael Naef <cal@linu.gs> [2]
Approved by:	delphij (mentor)
MFC after:	1 week
This commit is contained in:
Martin Matuska 2010-10-08 23:01:38 +00:00
parent 7adc700072
commit a362d75576

View File

@ -755,7 +755,7 @@ zfs_write(vnode_t *vp, uio_t *uio, int ioflag, cred_t *cr, caller_context_t *ct)
*/
pflags = zp->z_phys->zp_flags;
if ((pflags & (ZFS_IMMUTABLE | ZFS_READONLY)) ||
((pflags & ZFS_APPENDONLY) && !(ioflag & FAPPEND) &&
((pflags & ZFS_APPENDONLY) && !(ioflag & IO_APPEND) &&
(uio->uio_loffset < zp->z_phys->zp_size))) {
ZFS_EXIT(zfsvfs);
return (EPERM);