]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
xfs: don't clear imap_valid for a non-uptodate buffers
authorChristoph Hellwig <hch@lst.de>
Thu, 12 Jul 2018 05:25:58 +0000 (22:25 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Thu, 12 Jul 2018 05:25:58 +0000 (22:25 -0700)
Finding a buffer that isn't uptodate doesn't invalidate the mapping for
any given block.  The last_sector check will already take care of starting
another ioend as soon as we find any non-update buffer, and if the current
mapping doesn't include the next uptodate buffer the xfs_imap_valid check
will take care of it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_aops.c

index df80a383ccd86aa9ac6a4147cc219468fd90e9b6..1d1cb917cc6e06f41df7f63c012e7ce36272c182 100644 (file)
@@ -863,10 +863,8 @@ xfs_writepage_map(
                 * meaningless for holes (!mapped && uptodate), so skip
                 * buffers covering holes here.
                 */
-               if (!buffer_mapped(bh) && buffer_uptodate(bh)) {
-                       wpc->imap_valid = false;
+               if (!buffer_mapped(bh) && buffer_uptodate(bh))
                        continue;
-               }
 
                if (buffer_unwritten(bh))
                        new_type = XFS_IO_UNWRITTEN;
@@ -879,11 +877,8 @@ xfs_writepage_map(
                                ASSERT(buffer_mapped(bh));
                        /*
                         * This buffer is not uptodate and will not be
-                        * written to disk.  Ensure that we will put any
-                        * subsequent writeable buffers into a new
-                        * ioend.
+                        * written to disk.
                         */
-                       wpc->imap_valid = false;
                        continue;
                }