Skip to content

Commit

Permalink
Btrfs: cleanup error handling in inode.c
Browse files Browse the repository at this point in the history
The error processing of several places is changed like setting the
error number only at the error.

Signed-off-by: Tsutomu Itoh <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
  • Loading branch information
Tsutomu Itoh authored and chrismason-xx committed Apr 25, 2011
1 parent 64728bb commit 7cf96da
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -4731,9 +4731,10 @@ static int btrfs_mknod(struct inode *dir, struct dentry *dentry,
inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name,
dentry->d_name.len, dir->i_ino, objectid,
BTRFS_I(dir)->block_group, mode, &index);
err = PTR_ERR(inode);
if (IS_ERR(inode))
if (IS_ERR(inode)) {
err = PTR_ERR(inode);
goto out_unlock;
}

err = btrfs_init_inode_security(trans, inode, dir);
if (err) {
Expand Down Expand Up @@ -4792,9 +4793,10 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry,
inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name,
dentry->d_name.len, dir->i_ino, objectid,
BTRFS_I(dir)->block_group, mode, &index);
err = PTR_ERR(inode);
if (IS_ERR(inode))
if (IS_ERR(inode)) {
err = PTR_ERR(inode);
goto out_unlock;
}

err = btrfs_init_inode_security(trans, inode, dir);
if (err) {
Expand Down Expand Up @@ -7278,9 +7280,10 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry,
dentry->d_name.len, dir->i_ino, objectid,
BTRFS_I(dir)->block_group, S_IFLNK|S_IRWXUGO,
&index);
err = PTR_ERR(inode);
if (IS_ERR(inode))
if (IS_ERR(inode)) {
err = PTR_ERR(inode);
goto out_unlock;
}

err = btrfs_init_inode_security(trans, inode, dir);
if (err) {
Expand Down

0 comments on commit 7cf96da

Please sign in to comment.