summaryrefslogtreecommitdiff
path: root/fs/reiserfs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-03-02 09:35:13 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2011-03-03 01:28:40 -0500
commit99890a3be1ee67346300f1e0a873006588760f2a (patch)
treea2d704543672fd5c36c95aee728cddaf2f2c26d5 /fs/reiserfs
parentbabfe56046885749b6a90a3c4409219a1f16cf48 (diff)
downloadlinux-3.10-99890a3be1ee67346300f1e0a873006588760f2a.tar.gz
linux-3.10-99890a3be1ee67346300f1e0a873006588760f2a.tar.bz2
linux-3.10-99890a3be1ee67346300f1e0a873006588760f2a.zip
fix reiserfs mkdir() breakage
if directory has so many subdirectories that its link count is set to 1 (i.e. "can't tell accurately") and reiserfs_new_inode() fails, we shouldn't decrement the parent's link count in cleanup path; that's what DEC_DIR_INODE_NLINK() is for. As it is, we end up with parent suddenly getting zero i_nlink, with very unpleasant effects. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/reiserfs')
-rw-r--r--fs/reiserfs/namei.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
index ba5f51ec345..68fdf45cc6c 100644
--- a/fs/reiserfs/namei.c
+++ b/fs/reiserfs/namei.c
@@ -771,7 +771,7 @@ static int reiserfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
EMPTY_DIR_SIZE_V1 : EMPTY_DIR_SIZE,
dentry, inode, &security);
if (retval) {
- dir->i_nlink--;
+ DEC_DIR_INODE_NLINK(dir)
goto out_failed;
}