Commit 7cf96da3 authored by Tsutomu Itoh's avatar Tsutomu Itoh Committed by Chris Mason

Btrfs: cleanup error handling in inode.c

The error processing of several places is changed like setting the
error number only at the error.
Signed-off-by: default avatarTsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 64728bbb
...@@ -4731,9 +4731,10 @@ static int btrfs_mknod(struct inode *dir, struct dentry *dentry, ...@@ -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, inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name,
dentry->d_name.len, dir->i_ino, objectid, dentry->d_name.len, dir->i_ino, objectid,
BTRFS_I(dir)->block_group, mode, &index); 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; goto out_unlock;
}
err = btrfs_init_inode_security(trans, inode, dir); err = btrfs_init_inode_security(trans, inode, dir);
if (err) { if (err) {
...@@ -4792,9 +4793,10 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry, ...@@ -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, inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name,
dentry->d_name.len, dir->i_ino, objectid, dentry->d_name.len, dir->i_ino, objectid,
BTRFS_I(dir)->block_group, mode, &index); 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; goto out_unlock;
}
err = btrfs_init_inode_security(trans, inode, dir); err = btrfs_init_inode_security(trans, inode, dir);
if (err) { if (err) {
...@@ -7278,9 +7280,10 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry, ...@@ -7278,9 +7280,10 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry,
dentry->d_name.len, dir->i_ino, objectid, dentry->d_name.len, dir->i_ino, objectid,
BTRFS_I(dir)->block_group, S_IFLNK|S_IRWXUGO, BTRFS_I(dir)->block_group, S_IFLNK|S_IRWXUGO,
&index); &index);
err = PTR_ERR(inode); if (IS_ERR(inode)) {
if (IS_ERR(inode)) err = PTR_ERR(inode);
goto out_unlock; goto out_unlock;
}
err = btrfs_init_inode_security(trans, inode, dir); err = btrfs_init_inode_security(trans, inode, dir);
if (err) { if (err) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment