Skip to content

Commit

Permalink
Btrfs: add more error checking to btrfs_dirty_inode
Browse files Browse the repository at this point in the history
The ENOSPC code will now return ENOSPC to btrfs_start_transaction.
btrfs_dirty_inode needs to check for this and error out appropriately.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Chris Mason committed May 27, 2010
1 parent 5a5f79b commit 9aeead7
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -4312,12 +4312,23 @@ void btrfs_dirty_inode(struct inode *inode)
/* whoops, lets try again with the full transaction */
btrfs_end_transaction(trans, root);
trans = btrfs_start_transaction(root, 1);
if (IS_ERR(trans)) {
if (printk_ratelimit()) {
printk(KERN_ERR "btrfs: fail to "
"dirty inode %lu error %ld\n",
inode->i_ino, PTR_ERR(trans));
}
return;
}
btrfs_set_trans_block_group(trans, inode);

ret = btrfs_update_inode(trans, root, inode);
if (ret) {
printk(KERN_ERR"btrfs: fail to dirty inode %lu error %d\n",
inode->i_ino, ret);
if (printk_ratelimit()) {
printk(KERN_ERR "btrfs: fail to "
"dirty inode %lu error %d\n",
inode->i_ino, ret);
}
}
}
btrfs_end_transaction(trans, root);
Expand Down

0 comments on commit 9aeead7

Please sign in to comment.