Commit 9aeead73 authored by Chris Mason's avatar Chris Mason

Btrfs: add more error checking to btrfs_dirty_inode

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: default avatarChris Mason <chris.mason@oracle.com>
parent 5a5f79b5
...@@ -4312,14 +4312,25 @@ void btrfs_dirty_inode(struct inode *inode) ...@@ -4312,14 +4312,25 @@ void btrfs_dirty_inode(struct inode *inode)
/* whoops, lets try again with the full transaction */ /* whoops, lets try again with the full transaction */
btrfs_end_transaction(trans, root); btrfs_end_transaction(trans, root);
trans = btrfs_start_transaction(root, 1); 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); btrfs_set_trans_block_group(trans, inode);
ret = btrfs_update_inode(trans, root, inode); ret = btrfs_update_inode(trans, root, inode);
if (ret) { if (ret) {
printk(KERN_ERR"btrfs: fail to dirty inode %lu error %d\n", if (printk_ratelimit()) {
printk(KERN_ERR "btrfs: fail to "
"dirty inode %lu error %d\n",
inode->i_ino, ret); inode->i_ino, ret);
} }
} }
}
btrfs_end_transaction(trans, root); btrfs_end_transaction(trans, root);
} }
......
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