[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH v3 14/23] lib/vfscore: keep vnode locked during drele call



Signed-off-by: Yuri Volchkov <yuri.volchkov@xxxxxxxxx>
---
 lib/vfscore/lookup.c   | 2 +-
 lib/vfscore/syscalls.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/vfscore/lookup.c b/lib/vfscore/lookup.c
index 1e2c4005..cbc02b52 100644
--- a/lib/vfscore/lookup.c
+++ b/lib/vfscore/lookup.c
@@ -181,8 +181,8 @@ namei(const char *path, struct dentry **dpp)
                                /* Find a vnode in this directory. */
                                error = VOP_LOOKUP(dvp, name, &vp);
                                if (error) {
-                                       vn_unlock(dvp);
                                        drele(ddp);
+                                       vn_unlock(dvp);
                                        return error;
                                }
 
diff --git a/lib/vfscore/syscalls.c b/lib/vfscore/syscalls.c
index fa0498e7..33004960 100644
--- a/lib/vfscore/syscalls.c
+++ b/lib/vfscore/syscalls.c
@@ -132,8 +132,8 @@ sys_open(char *path, int flags, mode_t mode, struct 
vfscore_file **fpp)
                        mode &= ~S_IFMT;
                        mode |= S_IFREG;
                        error = VOP_CREATE(ddp->d_vnode, filename, mode);
-                       vn_unlock(ddp->d_vnode);
                        drele(ddp);
+                       vn_unlock(ddp->d_vnode);
 
                        if (error)
                                return error;
-- 
2.19.2


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.