aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2012-06-12 10:20:45 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-31 01:45:52 -0400
commitb2b5ef5c8e89f19b68c174bf246f3ca212dbf0bc (patch)
tree05bc5ec6d01f45307eed33082f9f1c288c907999 /fs/btrfs/disk-io.c
parent2c22b337b5bbb497c41b348b2357b7070ed5ba88 (diff)
btrfs: Convert to new freezing mechanism
We convert btrfs_file_aio_write() to use new freeze check. We also add proper freeze protection to btrfs_page_mkwrite(). We also add freeze protection to the transaction mechanism to avoid starting transactions on frozen filesystem. At minimum this is necessary to stop iput() of unlinked file to change frozen filesystem during truncation. Checks in cleaner_kthread() and transaction_kthread() can be safely removed since btrfs_freeze() will lock the mutexes and thus block the threads (and they shouldn't have anything to do anyway). CC: linux-btrfs@vger.kernel.org CC: Chris Mason <chris.mason@oracle.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 2936ca49b3b4..20c49b16b759 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1533,8 +1533,6 @@ static int cleaner_kthread(void *arg)
1533 struct btrfs_root *root = arg; 1533 struct btrfs_root *root = arg;
1534 1534
1535 do { 1535 do {
1536 vfs_check_frozen(root->fs_info->sb, SB_FREEZE_WRITE);
1537
1538 if (!(root->fs_info->sb->s_flags & MS_RDONLY) && 1536 if (!(root->fs_info->sb->s_flags & MS_RDONLY) &&
1539 mutex_trylock(&root->fs_info->cleaner_mutex)) { 1537 mutex_trylock(&root->fs_info->cleaner_mutex)) {
1540 btrfs_run_delayed_iputs(root); 1538 btrfs_run_delayed_iputs(root);
@@ -1566,7 +1564,6 @@ static int transaction_kthread(void *arg)
1566 do { 1564 do {
1567 cannot_commit = false; 1565 cannot_commit = false;
1568 delay = HZ * 30; 1566 delay = HZ * 30;
1569 vfs_check_frozen(root->fs_info->sb, SB_FREEZE_WRITE);
1570 mutex_lock(&root->fs_info->transaction_kthread_mutex); 1567 mutex_lock(&root->fs_info->transaction_kthread_mutex);
1571 1568
1572 spin_lock(&root->fs_info->trans_lock); 1569 spin_lock(&root->fs_info->trans_lock);