git: ac2576b9f7bc - main - tmpfs open: assert that there is no double-init of f_data.

Konstantin Belousov kib at FreeBSD.org
Sun Jan 10 02:50:02 UTC 2021


The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=ac2576b9f7bc88b6f213141178102024705b03d3

commit ac2576b9f7bc88b6f213141178102024705b03d3
Author:     Konstantin Belousov <kib at FreeBSD.org>
AuthorDate: 2021-01-07 16:34:02 +0000
Commit:     Konstantin Belousov <kib at FreeBSD.org>
CommitDate: 2021-01-10 02:48:36 +0000

    tmpfs open: assert that there is no double-init of f_data.
    
    Sponsored by:   The FreeBSD Foundation
---
 sys/fs/tmpfs/tmpfs_vnops.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c
index 3c80c33ea047..90711b4849c5 100644
--- a/sys/fs/tmpfs/tmpfs_vnops.c
+++ b/sys/fs/tmpfs/tmpfs_vnops.c
@@ -311,6 +311,7 @@ tmpfs_open(struct vop_open_args *v)
 	}
 
 	fp = v->a_fp;
+	MPASS(fp == NULL || fp->f_data == NULL);
 	if (error == 0 && fp != NULL && vp->v_type == VREG) {
 		tmpfs_ref_node(node);
 		finit_vnode(fp, mode, node, &tmpfs_fnops);


More information about the dev-commits-src-all mailing list