aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/9p/vfs_inode.c43
1 files changed, 24 insertions, 19 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index cf3dd6bc537e..c8fe480d0db0 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -680,26 +680,31 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
680 goto error; 680 goto error;
681 } 681 }
682 682
683 /* now walk from the parent so we can get unopened fid */ 683 if (!(perm & P9_DMLINK)) {
684 fid = p9_client_walk(dfid, 1, &name, 1); 684 /* now walk from the parent so we can get unopened fid */
685 if (IS_ERR(fid)) { 685 fid = p9_client_walk(dfid, 1, &name, 1);
686 err = PTR_ERR(fid); 686 if (IS_ERR(fid)) {
687 p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err); 687 err = PTR_ERR(fid);
688 fid = NULL; 688 p9_debug(P9_DEBUG_VFS,
689 goto error; 689 "p9_client_walk failed %d\n", err);
690 } 690 fid = NULL;
691 691 goto error;
692 /* instantiate inode and assign the unopened fid to the dentry */ 692 }
693 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb); 693 /*
694 if (IS_ERR(inode)) { 694 * instantiate inode and assign the unopened fid to the dentry
695 err = PTR_ERR(inode); 695 */
696 p9_debug(P9_DEBUG_VFS, "inode creation failed %d\n", err); 696 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb);
697 goto error; 697 if (IS_ERR(inode)) {
698 err = PTR_ERR(inode);
699 p9_debug(P9_DEBUG_VFS,
700 "inode creation failed %d\n", err);
701 goto error;
702 }
703 err = v9fs_fid_add(dentry, fid);
704 if (err < 0)
705 goto error;
706 d_instantiate(dentry, inode);
698 } 707 }
699 err = v9fs_fid_add(dentry, fid);
700 if (err < 0)
701 goto error;
702 d_instantiate(dentry, inode);
703 return ofid; 708 return ofid;
704error: 709error:
705 if (ofid) 710 if (ofid)