diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-13 23:25:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-13 23:25:58 -0400 |
commit | 0ea97a2d61df729ccce75b00a2fa37d39a508ab6 (patch) | |
tree | 953c13d8309938b93af2c257de8f7b84004ae748 /fs/fuse | |
parent | a66b4cd1e7163adb327838a3c81faaf6a9330d5a (diff) | |
parent | c7b15a8657da7f8d11269c7cc3d8beef10d26b43 (diff) |
Merge branch 'work.mkdir' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs icache updates from Al Viro:
- NFS mkdir/open_by_handle race fix
- analogous solution for FUSE, replacing the one currently in mainline
- new primitive to be used when discarding halfway set up inodes on
failed object creation; gives sane warranties re icache lookups not
returning such doomed by still not freed inodes. A bunch of
filesystems switched to that animal.
- Miklos' fix for last cycle regression in iget5_locked(); -stable will
need a slightly different variant, unfortunately.
- misc bits and pieces around things icache-related (in adfs and jfs).
* 'work.mkdir' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
jfs: don't bother with make_bad_inode() in ialloc()
adfs: don't put inodes into icache
new helper: inode_fake_hash()
vfs: don't evict uninitialized inode
jfs: switch to discard_new_inode()
ext2: make sure that partially set up inodes won't be returned by ext2_iget()
udf: switch to discard_new_inode()
ufs: switch to discard_new_inode()
btrfs: switch to discard_new_inode()
new primitive: discard_new_inode()
kill d_instantiate_no_diralias()
nfs_instantiate(): prevent multiple aliases for directory inode
Diffstat (limited to 'fs/fuse')
-rw-r--r-- | fs/fuse/dir.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index c979329311c8..d80aab0d5982 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
@@ -539,6 +539,7 @@ static int create_new_entry(struct fuse_conn *fc, struct fuse_args *args, | |||
539 | { | 539 | { |
540 | struct fuse_entry_out outarg; | 540 | struct fuse_entry_out outarg; |
541 | struct inode *inode; | 541 | struct inode *inode; |
542 | struct dentry *d; | ||
542 | int err; | 543 | int err; |
543 | struct fuse_forget_link *forget; | 544 | struct fuse_forget_link *forget; |
544 | 545 | ||
@@ -570,11 +571,17 @@ static int create_new_entry(struct fuse_conn *fc, struct fuse_args *args, | |||
570 | } | 571 | } |
571 | kfree(forget); | 572 | kfree(forget); |
572 | 573 | ||
573 | err = d_instantiate_no_diralias(entry, inode); | 574 | d_drop(entry); |
574 | if (err) | 575 | d = d_splice_alias(inode, entry); |
575 | return err; | 576 | if (IS_ERR(d)) |
577 | return PTR_ERR(d); | ||
576 | 578 | ||
577 | fuse_change_entry_timeout(entry, &outarg); | 579 | if (d) { |
580 | fuse_change_entry_timeout(d, &outarg); | ||
581 | dput(d); | ||
582 | } else { | ||
583 | fuse_change_entry_timeout(entry, &outarg); | ||
584 | } | ||
578 | fuse_invalidate_attr(dir); | 585 | fuse_invalidate_attr(dir); |
579 | return 0; | 586 | return 0; |
580 | 587 | ||