summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_extattr.c
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2001-10-24 18:32:17 +0000
committerdillon <dillon@FreeBSD.org>2001-10-24 18:32:17 +0000
commitf421c786e53d65928cb8116cba5b0ec64d3f7833 (patch)
treec5b73f96b5e4fa07d0df7a065760e23e3d4732ee /sys/kern/vfs_extattr.c
parent86a48bed454ad49cef5a324b1f1723bdfab44961 (diff)
downloadFreeBSD-src-f421c786e53d65928cb8116cba5b0ec64d3f7833.zip
FreeBSD-src-f421c786e53d65928cb8116cba5b0ec64d3f7833.tar.gz
unwind v_writecount in fhopen() if we are unable to allocate the
descriptor. MFC after: 3 days
Diffstat (limited to 'sys/kern/vfs_extattr.c')
-rw-r--r--sys/kern/vfs_extattr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index b260d55..f8397ab 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -3622,8 +3622,11 @@ fhopen(td, uap)
* end of vn_open code
*/
- if ((error = falloc(td, &nfp, &indx)) != 0)
+ if ((error = falloc(td, &nfp, &indx)) != 0) {
+ if (fmode & FWRITE)
+ vp->v_writecount--;
goto bad;
+ }
fp = nfp;
/*
OpenPOWER on IntegriCloud