]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Btrfs: deal with enospc from dirtying inodes properly
authorChris Mason <chris.mason@oracle.com>
Fri, 16 Dec 2011 19:54:14 +0000 (14:54 -0500)
committerChris Mason <chris.mason@oracle.com>
Fri, 16 Dec 2011 19:54:14 +0000 (14:54 -0500)
commit8fb8bd0cd500ae7781129e3f61f0cdfdbc6b22a2
tree9df54f0a153c193d9be45b7b2385760a96fdbe6f
parent9ce6e49093d9f1dcb4e850d8b137107b9a8b92ed
Btrfs: deal with enospc from dirtying inodes properly

Now that we're properly keeping track of delayed inode space we've been getting
a lot of warnings out of btrfs_dirty_inode() when running xfstest 83.  This is
because a bunch of people call mark_inode_dirty, which is void so we can't
return ENOSPC.  This needs to be fixed in a few areas

1) file_update_time - this updates the mtime and such when writing to a file,
which will call mark_inode_dirty.  So copy file_update_time into btrfs so we can
call btrfs_dirty_inode directly and return an error if we get one appropriately.

2) fix symlinks to use btrfs_setattr for ->setattr.  For some reason we weren't
setting ->setattr for symlinks, even though we should have been.  This catches
one of the cases where we were getting errors in mark_inode_dirty.

3) Fix btrfs_setattr and btrfs_setsize to call btrfs_dirty_inode directly
instead of mark_inode_dirty.  This lets us return errors properly for truncate
and chown/anything related to setattr.

4) Add a new btrfs_fs_dirty_inode which will just call btrfs_dirty_inode and
print an error if we have one.  The only remaining user we can't control for
this is touch_atime(), but we don't really want to keep people from walking
down the tree if we don't have space to save the atime update, so just complain
but don't worry about it.

With this patch xfstests 83 complains a handful of times instead of hundreds of
times.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
(cherry picked from commit 22c44fe65adacd20a174f3f54686509ee94ef7be with conflicts)

Conflicts:

fs/btrfs/inode.c

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/ctree.h
fs/btrfs/file.c
fs/btrfs/inode.c
fs/btrfs/super.c