diff options
author | Al Viro <viro@ZenIV.linux.org.uk> | 2014-11-19 14:34:49 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2014-11-20 05:16:58 -0500 |
commit | 571a4b57975aaaf50479a59882f1d44ae2737084 (patch) | |
tree | f1c55bc1307ecefc13ac0572403858d9bd23e718 /fs/gfs2 | |
parent | 30badc9543490f41497c42f004db02f1e8a29341 (diff) |
GFS2: bugger off early if O_CREAT open finds a directory
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/inode.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 04065e5af4b6..f41b2fd12416 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -624,6 +624,11 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry, | |||
624 | inode = gfs2_dir_search(dir, &dentry->d_name, !S_ISREG(mode) || excl); | 624 | inode = gfs2_dir_search(dir, &dentry->d_name, !S_ISREG(mode) || excl); |
625 | error = PTR_ERR(inode); | 625 | error = PTR_ERR(inode); |
626 | if (!IS_ERR(inode)) { | 626 | if (!IS_ERR(inode)) { |
627 | if (S_ISDIR(inode->i_mode)) { | ||
628 | iput(inode); | ||
629 | inode = ERR_PTR(-EISDIR); | ||
630 | goto fail_gunlock; | ||
631 | } | ||
627 | d = d_splice_alias(inode, dentry); | 632 | d = d_splice_alias(inode, dentry); |
628 | error = PTR_ERR(d); | 633 | error = PTR_ERR(d); |
629 | if (IS_ERR(d)) { | 634 | if (IS_ERR(d)) { |