@@ -567,8 +567,10 @@ static int utimensat_empty(struct lo_data *lo, struct lo_inode *inode,
fallback:
res = lo_parent_and_name(lo, inode, path, &parent);
- if (res != -1)
+ if (res != -1) {
res = utimensat(parent->fd, path, tv, AT_SYMLINK_NOFOLLOW);
+ unref_inode(lo, parent, 1);
+ }
return res;
}
@@ -1024,8 +1026,10 @@ static int linkat_empty_nofollow(struct lo_data *lo, struct lo_inode *inode,
fallback:
res = lo_parent_and_name(lo, inode, path, &parent);
- if (res != -1)
+ if (res != -1) {
res = linkat(parent->fd, path, dfd, name, 0);
+ unref_inode(lo, parent, 1);
+ }
return res;
}
utimensat_empty() and linkat_empty_nofollow() must unref the parent directory inode that was obtained from lo_parent_and_name(). Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> --- contrib/virtiofsd/passthrough_ll.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)