FreeBSD Bugzilla – Attachment 206101 Details for
Bug 239100
r348991 breaks unionfs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Select lower/upper vnode for write ref as seems suitable.
1.patch (text/plain), 1.83 KB, created by
Konstantin Belousov
on 2019-07-27 15:28:46 UTC
(
hide
)
Description:
Select lower/upper vnode for write ref as seems suitable.
Filename:
MIME Type:
Creator:
Konstantin Belousov
Created:
2019-07-27 15:28:46 UTC
Size:
1.83 KB
patch
obsolete
>diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c >index f3b5e484005..faa95ea4904 100644 >--- a/sys/fs/unionfs/union_subr.c >+++ b/sys/fs/unionfs/union_subr.c >@@ -349,6 +349,13 @@ unionfs_noderem(struct vnode *vp, struct thread *td) > vp->v_vnlock = &(vp->v_lock); > vp->v_data = NULL; > vp->v_object = NULL; >+ if (vp->v_writecount > 0) { >+ if (uvp != NULL) >+ VOP_ADD_WRITECOUNT(uvp, -vp->v_writecount); >+ else if (lvp != NULL) >+ VOP_ADD_WRITECOUNT(lvp, -vp->v_writecount); >+ } else if (vp->v_writecount < 0) >+ vp->v_writecount = 0; > VI_UNLOCK(vp); > > if (lvp != NULLVP) >diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c >index b4082771d1c..ff77e506831 100644 >--- a/sys/fs/unionfs/union_vnops.c >+++ b/sys/fs/unionfs/union_vnops.c >@@ -2511,6 +2511,33 @@ unionfs_vptofh(struct vop_vptofh_args *ap) > return (EOPNOTSUPP); > } > >+static int >+unionfs_add_writecount(struct vop_add_writecount_args *ap) >+{ >+ struct vnode *tvp, *vp; >+ struct unionfs_node *unp; >+ int error; >+ >+ vp = ap->a_vp; >+ unp = VTOUNIONFS(vp); >+ tvp = unp->un_uppervp != NULL ? unp->un_uppervp : unp->un_lowervp; >+ VI_LOCK(vp); >+ /* text refs are bypassed to lowervp */ >+ VNASSERT(vp->v_writecount >= 0, vp, ("wrong null writecount")); >+ VNASSERT(vp->v_writecount + ap->a_inc >= 0, vp, >+ ("wrong writecount inc %d", ap->a_inc)); >+ if (tvp != NULL) >+ error = VOP_ADD_WRITECOUNT(tvp, ap->a_inc); >+ else if (vp->v_writecount < 0) >+ error = ETXTBSY; >+ else >+ error = 0; >+ if (error == 0) >+ vp->v_writecount += ap->a_inc; >+ VI_UNLOCK(vp); >+ return (error); >+} >+ > struct vop_vector unionfs_vnodeops = { > .vop_default = &default_vnodeops, > >@@ -2559,4 +2586,5 @@ struct vop_vector unionfs_vnodeops = { > .vop_whiteout = unionfs_whiteout, > .vop_write = unionfs_write, > .vop_vptofh = unionfs_vptofh, >+ .vop_add_writecount = unionfs_add_writecount, > };
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 239100
: 206101