Skip to content

Commit

Permalink
fix reiserfs mkdir() breakage
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Al Viro committed Mar 3, 2011
1 parent babfe56 commit 99890a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/reiserfs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 99890a3

Please sign in to comment.