[PATCH 4/6] fuse: return correct dentry for ->mkdir
Al Viro
viro at zeniv.linux.org.uk
Fri Feb 21 20:24:02 PST 2025
On Fri, Feb 21, 2025 at 10:36:33AM +1100, NeilBrown wrote:
> @@ -871,7 +870,12 @@ static int fuse_mknod(struct mnt_idmap *idmap, struct inode *dir,
> args.in_args[0].value = &inarg;
> args.in_args[1].size = entry->d_name.len + 1;
> args.in_args[1].value = entry->d_name.name;
> - return create_new_entry(idmap, fm, &args, dir, entry, mode);
> + de = create_new_entry(idmap, fm, &args, dir, entry, mode);
> + if (IS_ERR(de))
> + return PTR_ERR(de);
> + if (de)
> + dput(de);
> + return 0;
Can that really happen?
> @@ -934,7 +939,12 @@ static int fuse_symlink(struct mnt_idmap *idmap, struct inode *dir,
> args.in_args[1].value = entry->d_name.name;
> args.in_args[2].size = len;
> args.in_args[2].value = link;
> - return create_new_entry(idmap, fm, &args, dir, entry, S_IFLNK);
> + de = create_new_entry(idmap, fm, &args, dir, entry, S_IFLNK);
> + if (IS_ERR(de))
> + return PTR_ERR(de);
> + if (de)
> + dput(de);
> + return 0;
Same question.
> + de = create_new_entry(&invalid_mnt_idmap, fm, &args, newdir, newent, inode->i_mode);
> + if (!IS_ERR(de)) {
> + if (de)
> + dput(de);
> + de = NULL;
Whoa... Details, please. What's going on here?
More information about the linux-um
mailing list