aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-11-19 13:00:57 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2014-11-19 13:00:57 -0500
commit154e80e4c3ad3b1713ad0b9670ac2e91c677c101 (patch)
treeda87b6085c464dd89c4e0336ed0543e82ceb2226 /fs/gfs2
parent427c77d4619657c483c49b28ca1813bb33e857b0 (diff)
parent845409b49bcc8fe2ad9f1a948cc4f54c301b742d (diff)
Merge branch 'for-gfs2' into for-next
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/inode.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index c4ed823d150e..6e2917433170 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -596,7 +596,6 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
596 struct gfs2_inode *dip = GFS2_I(dir), *ip; 596 struct gfs2_inode *dip = GFS2_I(dir), *ip;
597 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); 597 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode);
598 struct gfs2_glock *io_gl; 598 struct gfs2_glock *io_gl;
599 struct dentry *d;
600 int error, free_vfs_inode = 0; 599 int error, free_vfs_inode = 0;
601 u32 aflags = 0; 600 u32 aflags = 0;
602 unsigned blocks = 1; 601 unsigned blocks = 1;
@@ -624,22 +623,18 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
624 inode = gfs2_dir_search(dir, &dentry->d_name, !S_ISREG(mode) || excl); 623 inode = gfs2_dir_search(dir, &dentry->d_name, !S_ISREG(mode) || excl);
625 error = PTR_ERR(inode); 624 error = PTR_ERR(inode);
626 if (!IS_ERR(inode)) { 625 if (!IS_ERR(inode)) {
627 d = d_splice_alias(inode, dentry); 626 if (S_ISDIR(inode->i_mode)) {
628 error = PTR_ERR(d); 627 iput(inode);
629 if (IS_ERR(d)) { 628 inode = ERR_PTR(-EISDIR);
630 inode = ERR_CAST(d);
631 goto fail_gunlock; 629 goto fail_gunlock;
632 } 630 }
631 d_instantiate(dentry, inode);
633 error = 0; 632 error = 0;
634 if (file) { 633 if (file) {
635 if (S_ISREG(inode->i_mode)) { 634 if (S_ISREG(inode->i_mode))
636 WARN_ON(d != NULL);
637 error = finish_open(file, dentry, gfs2_open_common, opened); 635 error = finish_open(file, dentry, gfs2_open_common, opened);
638 } else { 636 else
639 error = finish_no_open(file, d); 637 error = finish_no_open(file, NULL);
640 }
641 } else {
642 dput(d);
643 } 638 }
644 gfs2_glock_dq_uninit(ghs); 639 gfs2_glock_dq_uninit(ghs);
645 return error; 640 return error;
@@ -1254,11 +1249,8 @@ static int gfs2_atomic_open(struct inode *dir, struct dentry *dentry,
1254 if (d != NULL) 1249 if (d != NULL)
1255 dentry = d; 1250 dentry = d;
1256 if (dentry->d_inode) { 1251 if (dentry->d_inode) {
1257 if (!(*opened & FILE_OPENED)) { 1252 if (!(*opened & FILE_OPENED))
1258 if (d == NULL) 1253 return finish_no_open(file, d);
1259 dget(dentry);
1260 return finish_no_open(file, dentry);
1261 }
1262 dput(d); 1254 dput(d);
1263 return 0; 1255 return 0;
1264 } 1256 }