]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dm space maps: don't reset space map allocation cursor when committing
authorJoe Thornber <ejt@redhat.com>
Tue, 13 Apr 2021 08:03:49 +0000 (09:03 +0100)
committerMike Snitzer <snitzer@redhat.com>
Tue, 25 May 2021 20:23:02 +0000 (16:23 -0400)
commit3bcecb93e4a00652258bc626b8001500dabcf24c
tree4e3cfb6b9d78c92c246f4557d007fc1f09a20247
parentdee29bf9192b7e7fec69191951286fe6a5cea89a
dm space maps: don't reset space map allocation cursor when committing

Current commit code resets the place where the search for free blocks
will begin back to the start of the metadata device.  There are a couple
of repercussions to this:

- The first allocation after the commit is likely to take longer than
  normal as it searches for a free block in an area that is likely to
  have very few free blocks (if any).

- Any free blocks it finds will have been recently freed.  Reusing them
  means we have fewer old copies of the metadata to aid recovery from
  hardware error.

Fix these issues by leaving the cursor alone, only resetting when the
search hits the end of the metadata device.

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/persistent-data/dm-space-map-disk.c
drivers/md/persistent-data/dm-space-map-metadata.c