Skip to content

Commit

Permalink
Merge branch 'for-next' of git://git.infradead.org/users/willy/pageca…
Browse files Browse the repository at this point in the history
…che.git

# Conflicts:
#	Documentation/vm/page_migration.rst
#	mm/migrate.c
  • Loading branch information
Mark Brown committed Sep 27, 2022
2 parents f118b62 + 03b33c0 commit 507b548
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -4089,7 +4089,7 @@ static int wait_dev_supers(struct btrfs_device *device, int max_mirrors)
max_mirrors = BTRFS_SUPER_MIRROR_MAX;

for (i = 0; i < max_mirrors; i++) {
struct page *page;
struct folio *folio;

ret = btrfs_sb_log_location(device, i, READ, &bytenr);
if (ret == -ENOENT) {
Expand All @@ -4104,27 +4104,24 @@ static int wait_dev_supers(struct btrfs_device *device, int max_mirrors)
device->commit_total_bytes)
break;

page = find_get_page(device->bdev->bd_inode->i_mapping,
folio = filemap_get_folio(device->bdev->bd_inode->i_mapping,
bytenr >> PAGE_SHIFT);
if (!page) {
if (!folio) {
errors++;
if (i == 0)
primary_failed = true;
continue;
}
/* Page is submitted locked and unlocked once the IO completes */
wait_on_page_locked(page);
if (PageError(page)) {
/* Folio is unlocked once the IO completes */
folio_wait_locked(folio);
if (!folio_test_uptodate(folio)) {
errors++;
if (i == 0)
primary_failed = true;
}

/* Drop our reference */
put_page(page);

/* Drop the reference from the writing run */
put_page(page);
/* Drop our reference and the one from the writing run */
folio_put_refs(folio, 2);
}

/* log error, force error return */
Expand Down

0 comments on commit 507b548

Please sign in to comment.