Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9f73687
)
Return an error from simple_mkdir() if the target exists and isn't a directory.
author
adilger
<adilger>
Tue, 23 Apr 2002 07:15:49 +0000
(07:15 +0000)
committer
adilger
<adilger>
Tue, 23 Apr 2002 07:15:49 +0000
(07:15 +0000)
lustre/lib/simple.c
patch
|
blob
|
history
diff --git
a/lustre/lib/simple.c
b/lustre/lib/simple.c
index
366ec68
..
8876504
100644
(file)
--- a/
lustre/lib/simple.c
+++ b/
lustre/lib/simple.c
@@
-54,8
+54,12
@@
int simple_mkdir(struct dentry *dir, char *name, int mode)
if (IS_ERR(dchild))
RETURN(PTR_ERR(dchild));
- if (dchild->d_inode)
+ if (dchild->d_inode) {
+ if (!S_ISDIR(dchild->d_inode->i_mode))
+ GOTO(out, err = -ENOTDIR);
+
GOTO(out, err = -EEXIST);
+ }
err = vfs_mkdir(dir->d_inode, dchild, mode);
out: