Commit d3bc0e67 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'for-4.18-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux

Pull btrfs fixes from David Sterba:
 "We have a few regression fixes for qgroup rescan status tracking and
  the vm_fault_t conversion that mixed up the error values"

* tag 'for-4.18-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
  Btrfs: fix mount failure when qgroup rescan is in progress
  Btrfs: fix regression in btrfs_page_mkwrite() from vm_fault_t conversion
  btrfs: quota: Set rescan progress to (u64)-1 if we hit last leaf
parents 4a770e63 e4e7ede7
...@@ -9005,13 +9005,14 @@ vm_fault_t btrfs_page_mkwrite(struct vm_fault *vmf) ...@@ -9005,13 +9005,14 @@ vm_fault_t btrfs_page_mkwrite(struct vm_fault *vmf)
unlock_extent_cached(io_tree, page_start, page_end, &cached_state); unlock_extent_cached(io_tree, page_start, page_end, &cached_state);
out_unlock:
if (!ret2) { if (!ret2) {
btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE, true); btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE, true);
sb_end_pagefault(inode->i_sb); sb_end_pagefault(inode->i_sb);
extent_changeset_free(data_reserved); extent_changeset_free(data_reserved);
return VM_FAULT_LOCKED; return VM_FAULT_LOCKED;
} }
out_unlock:
unlock_page(page); unlock_page(page);
out: out:
btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE, (ret != 0)); btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE, (ret != 0));
......
...@@ -2680,8 +2680,10 @@ qgroup_rescan_leaf(struct btrfs_fs_info *fs_info, struct btrfs_path *path, ...@@ -2680,8 +2680,10 @@ qgroup_rescan_leaf(struct btrfs_fs_info *fs_info, struct btrfs_path *path,
free_extent_buffer(scratch_leaf); free_extent_buffer(scratch_leaf);
} }
if (done && !ret) if (done && !ret) {
ret = 1; ret = 1;
fs_info->qgroup_rescan_progress.objectid = (u64)-1;
}
return ret; return ret;
} }
...@@ -2784,13 +2786,20 @@ qgroup_rescan_init(struct btrfs_fs_info *fs_info, u64 progress_objectid, ...@@ -2784,13 +2786,20 @@ qgroup_rescan_init(struct btrfs_fs_info *fs_info, u64 progress_objectid,
if (!init_flags) { if (!init_flags) {
/* we're resuming qgroup rescan at mount time */ /* we're resuming qgroup rescan at mount time */
if (!(fs_info->qgroup_flags & BTRFS_QGROUP_STATUS_FLAG_RESCAN)) if (!(fs_info->qgroup_flags &
BTRFS_QGROUP_STATUS_FLAG_RESCAN)) {
btrfs_warn(fs_info, btrfs_warn(fs_info,
"qgroup rescan init failed, qgroup is not enabled"); "qgroup rescan init failed, qgroup is not enabled");
else if (!(fs_info->qgroup_flags & BTRFS_QGROUP_STATUS_FLAG_ON)) ret = -EINVAL;
} else if (!(fs_info->qgroup_flags &
BTRFS_QGROUP_STATUS_FLAG_ON)) {
btrfs_warn(fs_info, btrfs_warn(fs_info,
"qgroup rescan init failed, qgroup rescan is not queued"); "qgroup rescan init failed, qgroup rescan is not queued");
return -EINVAL; ret = -EINVAL;
}
if (ret)
return ret;
} }
mutex_lock(&fs_info->qgroup_rescan_lock); mutex_lock(&fs_info->qgroup_rescan_lock);
......
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