diff options
author | Chris Mason <chris.mason@oracle.com> | 2010-05-27 10:23:00 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2010-05-27 10:23:00 -0400 |
commit | 9aeead73782c4b8e2a91def36dbf95db28605c95 (patch) | |
tree | 7dc2cc6f382ec72715c87ac17ff20e7c0649e4b8 /fs/btrfs/inode.c | |
parent | 5a5f79b57069c5691f5b6fd8381fdf487f548ae5 (diff) | |
download | op-kernel-dev-9aeead73782c4b8e2a91def36dbf95db28605c95.zip op-kernel-dev-9aeead73782c4b8e2a91def36dbf95db28605c95.tar.gz |
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: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 6866c36..2551b80 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -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); |