git: 852088f6af6c - main - vfs: add missing atomic conversion to writecount adjustment
Mateusz Guzik
mjg at FreeBSD.org
Fri May 14 15:43:39 UTC 2021
The branch main has been updated by mjg:
URL: https://cgit.FreeBSD.org/src/commit/?id=852088f6af6c5cd44542dde72aa5c3f4c4f9353c
commit 852088f6af6c5cd44542dde72aa5c3f4c4f9353c
Author: Mateusz Guzik <mjg at FreeBSD.org>
AuthorDate: 2021-05-14 15:41:39 +0000
Commit: Mateusz Guzik <mjg at FreeBSD.org>
CommitDate: 2021-05-14 15:42:05 +0000
vfs: add missing atomic conversion to writecount adjustment
Fixes: ("vfs: lockless writecount adjustment in set/unset text")
---
sys/kern/vfs_default.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c
index 3518bbeaa279..ace9ad1d37c3 100644
--- a/sys/kern/vfs_default.c
+++ b/sys/kern/vfs_default.c
@@ -1210,7 +1210,7 @@ vop_stdset_text(struct vop_set_text_args *ap)
vrefl(vp);
}
- vp->v_writecount--;
+ atomic_subtract_int(&vp->v_writecount, 1);
error = 0;
}
VI_UNLOCK(vp);
@@ -1247,7 +1247,7 @@ vop_stdunset_text(struct vop_unset_text_args *ap)
last = true;
vp->v_iflag &= ~VI_TEXT_REF;
}
- vp->v_writecount++;
+ atomic_add_int(&vp->v_writecount, 1);
error = 0;
} else {
error = EINVAL;
More information about the dev-commits-src-main
mailing list