projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
30badc9
)
GFS2: bugger off early if O_CREAT open finds a directory
author
Al Viro
<viro@ZenIV.linux.org.uk>
Wed, 19 Nov 2014 19:34:49 +0000
(19:34 +0000)
committer
Steven Whitehouse
<swhiteho@redhat.com>
Thu, 20 Nov 2014 10:16:58 +0000
(10:16 +0000)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/inode.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/gfs2/inode.c
b/fs/gfs2/inode.c
index 04065e5af4b6773faf5ae8c8d49334110c762218..f41b2fd12416328d574bba7bce39aba7db21063a 100644
(file)
--- 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,
inode = gfs2_dir_search(dir, &dentry->d_name, !S_ISREG(mode) || excl);
error = PTR_ERR(inode);
if (!IS_ERR(inode)) {
+ if (S_ISDIR(inode->i_mode)) {
+ iput(inode);
+ inode = ERR_PTR(-EISDIR);
+ goto fail_gunlock;
+ }
d = d_splice_alias(inode, dentry);
error = PTR_ERR(d);
if (IS_ERR(d)) {