vfs: fix deadlock in vfs_creat
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
d64ed97227
commit
7556c3170e
1 changed files with 2 additions and 2 deletions
|
|
@ -184,8 +184,6 @@ int vfs_creat(dirent_t *parent, const char *name, u64 mode, int flags, dirent_t
|
||||||
if (len > 255)
|
if (len > 255)
|
||||||
return -ENAMETOOLONG;
|
return -ENAMETOOLONG;
|
||||||
|
|
||||||
write_lock(&ino->rwlock);
|
|
||||||
|
|
||||||
dirent_t *test = NULL;
|
dirent_t *test = NULL;
|
||||||
res = inode_find_dirent(ino, name, &test);
|
res = inode_find_dirent(ino, name, &test);
|
||||||
|
|
||||||
|
|
@ -199,6 +197,8 @@ int vfs_creat(dirent_t *parent, const char *name, u64 mode, int flags, dirent_t
|
||||||
goto out_err;
|
goto out_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
write_lock(&ino->rwlock);
|
||||||
|
|
||||||
/* create inode */
|
/* create inode */
|
||||||
fs_t *fs = parent->fs;
|
fs_t *fs = parent->fs;
|
||||||
inode_t *new_ino;
|
inode_t *new_ino;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue