Commit f18d7309 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'iomap-5.20-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull iomap updates from Darrick Wong:
 "The most notable change in this first batch is that we no longer
  schedule pages beyond i_size for writeback, preferring instead to let
  truncate deal with those pages.

  Next week, there may be a second pull request to remove
  iomap_writepage from the other two filesystems (gfs2/zonefs) that use
  iomap for buffered IO. This follows in the same vein as the recent
  removal of writepage from XFS, since it hasn't been triggered in a few
  years; it does nothing during direct reclaim; and as far as the people
  who examined the patchset can tell, it's moving the codebase in the
  right direction.

  However, as it was a late addition to for-next, I'm holding off on
  that section for another week of testing to see if anyone can come up
  with a solid reason for holding off in the meantime.

  Summary:

   - Skip writeback for pages that are completely beyond EOF

   - Minor code cleanups"

* tag 'iomap-5.20-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
  dax: set did_zero to true when zeroing successfully
  iomap: set did_zero to true when zeroing successfully
  iomap: skip pages past eof in iomap_do_writepage()
parents 2e4f8c72 f8189d5d
...@@ -1088,10 +1088,10 @@ static s64 dax_zero_iter(struct iomap_iter *iter, bool *did_zero) ...@@ -1088,10 +1088,10 @@ static s64 dax_zero_iter(struct iomap_iter *iter, bool *did_zero)
pos += size; pos += size;
length -= size; length -= size;
written += size; written += size;
if (did_zero)
*did_zero = true;
} while (length > 0); } while (length > 0);
if (did_zero)
*did_zero = true;
return written; return written;
} }
......
...@@ -926,10 +926,10 @@ static loff_t iomap_zero_iter(struct iomap_iter *iter, bool *did_zero) ...@@ -926,10 +926,10 @@ static loff_t iomap_zero_iter(struct iomap_iter *iter, bool *did_zero)
pos += bytes; pos += bytes;
length -= bytes; length -= bytes;
written += bytes; written += bytes;
if (did_zero)
*did_zero = true;
} while (length > 0); } while (length > 0);
if (did_zero)
*did_zero = true;
return written; return written;
} }
...@@ -1487,10 +1487,10 @@ iomap_do_writepage(struct page *page, struct writeback_control *wbc, void *data) ...@@ -1487,10 +1487,10 @@ iomap_do_writepage(struct page *page, struct writeback_control *wbc, void *data)
pgoff_t end_index = isize >> PAGE_SHIFT; pgoff_t end_index = isize >> PAGE_SHIFT;
/* /*
* Skip the page if it's fully outside i_size, e.g. due to a * Skip the page if it's fully outside i_size, e.g.
* truncate operation that's in progress. We must redirty the * due to a truncate operation that's in progress. We've
* page so that reclaim stops reclaiming it. Otherwise * cleaned this page and truncate will finish things off for
* iomap_release_folio() is called on it and gets confused. * us.
* *
* Note that the end_index is unsigned long. If the given * Note that the end_index is unsigned long. If the given
* offset is greater than 16TB on a 32-bit system then if we * offset is greater than 16TB on a 32-bit system then if we
...@@ -1505,7 +1505,7 @@ iomap_do_writepage(struct page *page, struct writeback_control *wbc, void *data) ...@@ -1505,7 +1505,7 @@ iomap_do_writepage(struct page *page, struct writeback_control *wbc, void *data)
*/ */
if (folio->index > end_index || if (folio->index > end_index ||
(folio->index == end_index && poff == 0)) (folio->index == end_index && poff == 0))
goto redirty; goto unlock;
/* /*
* The page straddles i_size. It must be zeroed out on each * The page straddles i_size. It must be zeroed out on each
...@@ -1523,6 +1523,7 @@ iomap_do_writepage(struct page *page, struct writeback_control *wbc, void *data) ...@@ -1523,6 +1523,7 @@ iomap_do_writepage(struct page *page, struct writeback_control *wbc, void *data)
redirty: redirty:
folio_redirty_for_writepage(wbc, folio); folio_redirty_for_writepage(wbc, folio);
unlock:
folio_unlock(folio); folio_unlock(folio);
return 0; return 0;
} }
......
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