Skip to contentSkip to conversation

dm-bufio per-client retain and dm-verity cache control

PATCH Superseded Yongpeng Yang 2 participants 7 messages Nov 19 – Nov 21

Subsystems (2)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover dm-bufio per-client retain and dm-verity cache control

From: Yongpeng Yang <[email protected]>

Device-mapper's verity targets read their hash trees, and FEC parity when FEC is enabled, through dm-bufio. dm-bufio has a single module-wide retain_bytes value shared by every client, no way to see or change one client's memory use, and no way to warm the cache ahead of the reads that need it.

That fits poorly systems with many verified devices of very different sizes, such as Android, which mounts a dozen verity partitions plus per-app verified images. The hash areas we see range from a few MB to tens of MB: with the 256 KiB default, a large partition's hash blocks are evicted under memory pressure and re-read later, while a uniform large value makes every cold, idle device hold memory it does not need -- and most verity devices are cold most of the time. What is wanted is a lifecycle: prefetch when the device is about to be used, drop when it goes cold again.

This series adds per-client granularity to dm-bufio and gives dm-verity message-based control over its caches:

1. Move the retain target into struct dm_bufio_client, initialized from the module parameter at creation, and export set/get plus a cached-buffer count. The parameter keeps its meaning as the default for new clients.

2. dm-verity: size the hash client's retain target as hash_retain_percent (default 10) of the hash area, so a small device keeps little and a large one keeps enough.

3. dm-verity: add the retain_bytes message to report or set a client's retain target; the reply also reports current_bytes and buffers, so memory use can be watched through the message.

4. dm-verity: add prefetch_hash and drop_hash messages to warm the cache ahead of use and release it afterwards.

Nothing changes for existing users: every client starts with the value the module parameter holds.

Changes since v2:
- The sysfs interface (per-client directories, ABI documentation and the suspend/reload handling around them) is dropped entirely.
- The retain_bytes reply now carries current_bytes and buffers instead.

Tested on a VM running v7.4-rc1: message write paths and the memory reporting in the reply, the shrinker retain floor under memory pressure, prefetch/drop lifecycles, suspend/resume cycles, and error-path injection. No kernel warnings.

[1] v1: https://lore.kernel.org/all/[email protected]/
[2] v2: https://lore.kernel.org/all/[email protected]/

Comments welcome.

Assisted-by LLM

Yongpeng Yang (4):
dm-bufio: make the retain target per client
dm-verity: size the hash retain target from the hash area
dm-verity: add retain_bytes message to inspect and tune the cache
floor
dm-verity: add messages to prefetch and drop the hash cache

 .../admin-guide/device-mapper/verity.rst      |  41 ++++
 .../admin-guide/kernel-parameters.txt         |   6 +
 drivers/md/dm-bufio.c                         |  41 +++-
 drivers/md/dm-verity-target.c                 | 200 +++++++++++++++++-
 include/linux/dm-bufio.h                      |   8 +
 5 files changed, 293 insertions(+), 3 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH v3 1/4 dm-bufio: make the retain target per client

From: Yongpeng Yang <[email protected]>

dm_bufio_retain_bytes is a module-wide value shared by every dm-bufio user, so raising it to keep one device's metadata cached also makes every small, idle device hold on to memory it does not need.

Give each client its own target, initialized from the module parameter at creation. The parameter keeps its meaning as the default for new clients; clients that already exist are not affected. Also export a way to query the retain target and the cached buffer count, so a target can report its memory use.

Assisted-by LLM

---
v3:
- Get rid of sysfs realted code.
v2:
- Round a non-zero target up to a block boundary instead of down, so it keeps at least as many bytes as requested.

---
 drivers/md/dm-bufio.c    | 41 +++++++++++++++++++++++++++++++++++++++-
 include/linux/dm-bufio.h |  8 ++++++++
 2 files changed, 48 insertions(+), 1 deletion(-)
drivers/md/dm-bufio.c +40 -1
index 3b66cf1cb931..f3abf90793c9 100644
@@ -994,6 +994,8 @@ struct dm_bufio_client {
 
 	unsigned int minimum_buffers;
 
+	unsigned long retain_bytes;	/* READ_ONCE/WRITE_ONCE, no lock needed */
+
 	sector_t start;
 
 	struct shrinker *shrinker;
@@ -2284,6 +2286,42 @@ void dm_bufio_set_minimum_buffers(struct dm_bufio_client *c, unsigned int n)
 }
 EXPORT_SYMBOL_GPL(dm_bufio_set_minimum_buffers);
 
+/*
+ * Set the number of bytes this client tries to keep cached; 0 resets it
+ * to the module default.  Non-zero values are rounded up to a block
+ * boundary, so the target keeps at least as many bytes as requested.
+ */
+void dm_bufio_set_retain_bytes(struct dm_bufio_client *c, unsigned long bytes)
+{
+	if (!bytes) {
+		WRITE_ONCE(c->retain_bytes, READ_ONCE(dm_bufio_retain_bytes));
+		return;
+	}
+
+	/* clamp so the round-up below cannot overflow */
+	if (bytes > ULONG_MAX - c->block_size + 1)
+		bytes = ULONG_MAX - c->block_size + 1;
+
+	WRITE_ONCE(c->retain_bytes,
+		   DIV_ROUND_UP(bytes, c->block_size) * c->block_size);
+}
+EXPORT_SYMBOL_GPL(dm_bufio_set_retain_bytes);
+
+unsigned long dm_bufio_get_retain_bytes(struct dm_bufio_client *c)
+{
+	return READ_ONCE(c->retain_bytes);
+}
+EXPORT_SYMBOL_GPL(dm_bufio_get_retain_bytes);
+
+/*
+ * The number of buffers currently cached by this client.
+ */
+unsigned long dm_bufio_get_cached_buffers(struct dm_bufio_client *c)
+{
+	return cache_total(&c->cache);
+}
+EXPORT_SYMBOL_GPL(dm_bufio_get_cached_buffers);
+
 unsigned int dm_bufio_get_block_size(struct dm_bufio_client *c)
 {
 	return c->block_size;
@@ -2389,7 +2427,7 @@ static void drop_buffers(struct dm_bufio_client *c)
 
 static unsigned long get_retain_buffers(struct dm_bufio_client *c)
 {
-	unsigned long retain_bytes = READ_ONCE(dm_bufio_retain_bytes);
+	unsigned long retain_bytes = READ_ONCE(c->retain_bytes);
 
 	if (likely(c->sectors_per_block_bits >= 0))
 		retain_bytes >>= c->sectors_per_block_bits + SECTOR_SHIFT;
@@ -2522,6 +2560,7 @@ struct dm_bufio_client *dm_bufio_client_create(struct block_device *bdev, unsign
 
 	mutex_init(&c->lock);
 	spin_lock_init(&c->spinlock);
+	c->retain_bytes = READ_ONCE(dm_bufio_retain_bytes);
 	INIT_LIST_HEAD(&c->reserved_buffers);
 	c->need_reserved_buffers = reserved_buffers;
 
include/linux/dm-bufio.h +8 -0
index d1503b815a78..f4d86b4b7e0f 100644
@@ -158,6 +158,14 @@ void dm_bufio_forget_buffers(struct dm_bufio_client *c, sector_t block, sector_t
  */
 void dm_bufio_set_minimum_buffers(struct dm_bufio_client *c, unsigned int n);
 
+/*
+ * Configure and query the per-client retain target; 0 resets the
+ * module default.
+ */
+void dm_bufio_set_retain_bytes(struct dm_bufio_client *c, unsigned long bytes);
+unsigned long dm_bufio_get_retain_bytes(struct dm_bufio_client *c);
+unsigned long dm_bufio_get_cached_buffers(struct dm_bufio_client *c);
+
 unsigned int dm_bufio_get_block_size(struct dm_bufio_client *c);
 sector_t dm_bufio_get_device_size(struct dm_bufio_client *c);
 struct dm_io_client *dm_bufio_get_dm_io_client(struct dm_bufio_client *c);
Signature · 1 line
2.43.0
#2 lore raw

PATCH v3 2/4 dm-verity: size the hash retain target from the hash area

In reply to Yongpeng Yang

From: Yongpeng Yang <[email protected]>

With the dm-bufio default of 256 KiB a large device re-reads hash blocks evicted under memory pressure, while a small device holds far more than it needs.

Set the hash client's target to hash_retain_percent (default 10) of the hash area, computed with mul_u64_u32_div() and clamped at ULONG_MAX so a large area cannot truncate to near-zero on 32-bit. A percentage above 100 is ignored, leaving the dm-bufio default.

The parameter only affects devices created afterwards.

Assisted-by LLM

---
v3:
- The leftover sysfs-era bufio_kobj field is removed.
v2:
- Compute the percentage with mul_u64_u32_div() and clamp it at ULONG_MAX, so a large area cannot truncate to near-zero on 32-bit.

---
 .../admin-guide/device-mapper/verity.rst      | 15 +++++++++++
 .../admin-guide/kernel-parameters.txt         |  6 +++++
 drivers/md/dm-verity-target.c                 | 26 +++++++++++++++++--
 3 files changed, 45 insertions(+), 2 deletions(-)
Documentation/admin-guide/device-mapper/verity.rst +15 -0
index 9e9d4b8157c0..7d6e567cef33 100644
@@ -328,6 +328,21 @@ Status
 2. Number of corrected blocks by Forward Error Correction.
    '-' if Forward Error Correction is not enabled.
 
+Metadata caching
+================
+
+The hash blocks, and the FEC parity blocks when FEC is enabled, are cached in
+memory by dm-bufio.  How much of the hash tree is kept cached is controlled by
+the ``hash_retain_percent`` module parameter (default 10), settable at boot
+time with ``dm_verity.hash_retain_percent=<0-100>`` or at run time through
+``/sys/module/dm_verity/parameters/hash_retain_percent``.  A value of 0 or
+above 100 leaves the dm-bufio default (256 KiB), which is also what the FEC
+clients keep.  Only devices created afterwards are affected.
+
+The retain target is a floor applied by the memory shrinker, not a cap: when
+there is no memory pressure a fully warmed cache may grow past it, and when
+memory is short dm-bufio evicts buffers until the target is met again.
+
 Example
 =======
 Set up a device::
Documentation/admin-guide/kernel-parameters.txt +6 -0
index 0b3c140babd9..914da403c5de 100644
@@ -1351,6 +1351,12 @@ Kernel parameters
 			For details see:
 			Documentation/admin-guide/hw-vuln/reg-file-data-sampling.rst
 
+	dm_verity.hash_retain_percent=
+			[DM] Percentage of the hash area that dm-verity
+			asks dm-bufio to keep cached for a new device.
+			Defaults to 10; 0 or a value above 100 leaves the
+			dm-bufio default.
+
 	dm_verity.keyring_unsealed=
 			[KNL] When set to 1, leave the dm-verity keyring
 			unsealed after initialization so userspace can
drivers/md/dm-verity-target.c +24 -2
index 451c75e30a8f..0e8af1a57d75 100644
@@ -32,6 +32,8 @@
 #define DM_VERITY_DEFAULT_PREFETCH_SIZE	262144
 #define DM_VERITY_USE_BH_DEFAULT_BYTES	8192
 
+#define DM_VERITY_DEFAULT_HASH_RETAIN_PERCENT	10
+
 #define DM_VERITY_MAX_CORRUPTED_ERRS	100
 
 #define DM_VERITY_OPT_LOGGING		"ignore_corruption"
@@ -50,6 +52,13 @@ static unsigned int dm_verity_prefetch_cluster = DM_VERITY_DEFAULT_PREFETCH_SIZE
 
 module_param_named(prefetch_cluster, dm_verity_prefetch_cluster, uint, 0644);
 
+/* Default fraction of the hash tree that dm-bufio is asked to keep cached. */
+static unsigned int dm_verity_hash_retain_percent = DM_VERITY_DEFAULT_HASH_RETAIN_PERCENT;
+
+module_param_named(hash_retain_percent, dm_verity_hash_retain_percent, uint, 0644);
+MODULE_PARM_DESC(hash_retain_percent,
+	"Percentage of the hash area to keep cached by default");
+
 static unsigned int dm_verity_use_bh_bytes[4] = {
 	DM_VERITY_USE_BH_DEFAULT_BYTES,	// IOPRIO_CLASS_NONE
 	DM_VERITY_USE_BH_DEFAULT_BYTES,	// IOPRIO_CLASS_RT
@@ -1084,14 +1093,14 @@ static void verity_dtr(struct dm_target *ti)
 
 	kfree(v->alg_name);
 
+	verity_fec_dtr(v);
+
 	if (v->hash_dev)
 		dm_put_device(ti, v->hash_dev);
 
 	if (v->data_dev)
 		dm_put_device(ti, v->data_dev);
 
-	verity_fec_dtr(v);
-
 	kfree(v->signature_key_desc);
 
 	if (v->use_bh_wq)
@@ -1421,6 +1430,7 @@ static int verity_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 	struct dm_verity_sig_opts verify_args = {0};
 	struct dm_arg_set as;
 	unsigned int num;
+	unsigned int hash_retain_percent;
 	unsigned long long num_ll;
 	int r;
 	int i;
@@ -1638,6 +1648,18 @@ static int verity_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 		goto bad;
 	}
 
+	/* Keep a configurable fraction of the hash tree cached by default. */
+	hash_retain_percent = READ_ONCE(dm_verity_hash_retain_percent);
+	if (hash_retain_percent <= 100) {
+		u64 retain = mul_u64_u32_div((u64)(v->hash_end - v->hash_start) <<
+					     v->hash_dev_block_bits,
+					     hash_retain_percent, 100);
+
+		if (retain > ULONG_MAX)
+			retain = ULONG_MAX;
+		dm_bufio_set_retain_bytes(v->bufio, retain);
+	}
+
 	/*
 	 * Using WQ_HIGHPRI improves throughput and completion latency by
 	 * reducing wait times when reading from a dm-verity device.
Signature · 1 line
2.43.0
#3 lore raw

PATCH v3 3/4 dm-verity: add retain_bytes message to inspect and tune the cache floor

In reply to Yongpeng Yang

From: Yongpeng Yang <[email protected]>

Nothing lets a user see how much memory a verity device keeps cached, or tune it for one device without touching every future client.

Add the retain_bytes <hash|fec> [<bytes>] message. It reports the selected client's retain target, or sets it when <bytes> is given (0 resets to the dm-bufio default); the reply also reports the bytes and buffers currently cached, so memory use can be watched through the message itself.

Assisted-by LLM

---
v3:
- The reply now also reports current_bytes and buffers, replacing the v1/v2 sysfs interface, which is dropped entirely.

---
 .../admin-guide/device-mapper/verity.rst      | 10 +++
 drivers/md/dm-verity-target.c                 | 63 +++++++++++++++++++
 2 files changed, 73 insertions(+)
Documentation/admin-guide/device-mapper/verity.rst +10 -0
index 7d6e567cef33..1e532c4251ae 100644
@@ -343,6 +343,16 @@ The retain target is a floor applied by the memory shrinker, not a cap: when
 there is no memory pressure a fully warmed cache may grow past it, and when
 memory is short dm-bufio evicts buffers until the target is met again.
 
+Messages
+========
+
+``retain_bytes <hash|fec> [<bytes>]``
+    Report the retain target of the hash or FEC parity client, or set it
+    (0 resets to the dm-bufio default).  ``fec`` requires FEC to be
+    enabled.  The reply is
+    ``retain_bytes=<bytes> current_bytes=<bytes> buffers=<n>``, so the
+    client's actual memory use can be watched through the message.
+
 Example
 =======
 Set up a device::
drivers/md/dm-verity-target.c +63 -0

75 lines not on this page · raw message

Signature · 1 line
2.43.0
#4 lore raw

PATCH v3 4/4 dm-verity: add messages to prefetch and drop the hash cache

In reply to Yongpeng Yang

From: Yongpeng Yang <[email protected]>

Nothing lets a user warm a verity device's cache ahead of the reads that will need it, or release the memory a device no longer needs.

Add two messages. prefetch_hash [<start> <count>] starts reading hash blocks asynchronously; it is not limited by the retain target, which only applies to eviction. drop_hash [<start> <count>] drops hash blocks, keeping those that are in use or dirty. Together they let userspace warm the cache when a device is about to be used and release the memory when it goes cold, instead of occupying it continuously.

prefetch_hash and drop_hash are unsupported on try_verify_in_tasklet devices (-EOPNOTSUPP), whose bufio client cannot evict or wait for a buffer that is still being read.

Assisted-by LLM

---
v3:
- Split out of the previous message patch; contains only the cache lifecycle commands.
- Reject prefetch_hash on try_verify_in_tasklet devices (-EOPNOTSUPP), same as drop_hash.
- Accept prefetch_hash/drop_hash with an empty hash area (levels == 0) as a no-op instead of failing.

---
 .../admin-guide/device-mapper/verity.rst      |  16 +++
 drivers/md/dm-verity-target.c                 | 115 +++++++++++++++++-
 2 files changed, 129 insertions(+), 2 deletions(-)
Documentation/admin-guide/device-mapper/verity.rst +16 -0
index 1e532c4251ae..ab772fb2d7b6 100644
@@ -353,6 +353,22 @@ Messages
     ``retain_bytes=<bytes> current_bytes=<bytes> buffers=<n>``, so the
     client's actual memory use can be watched through the message.
 
+``prefetch_hash [<start> <count>]``
+    Start reading hash blocks into the cache; without arguments, the whole
+    hash area.  The read is asynchronous and is not limited by the retain
+    target, which only applies to eviction.  Not supported on devices
+    created with ``try_verify_in_tasklet`` (``-EOPNOTSUPP``), whose bufio
+    client cannot evict or wait for a buffer that is still being read.
+
+``drop_hash [<start> <count>]``
+    Drop hash blocks from the cache, keeping blocks that are in use or
+    dirty.  Not supported on devices created with ``try_verify_in_tasklet``
+    (``-EOPNOTSUPP``), whose bufio client cannot drop buffers.
+
+While the device is suspended, ``prefetch_hash`` reads are queued and
+complete on resume, and ``drop_hash`` finds an empty cache because
+verity resets the bufio client on suspend; both are harmless.
+
 Example
 =======
 Set up a device::
drivers/md/dm-verity-target.c +113 -2

131 lines not on this page · raw message

Signature · 1 line
2.43.0
#5 lore raw

Re: [PATCH v3 4/4] dm-verity: add messages to prefetch and drop the hash cache

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [High] dm-verity: verity_prefetch_hash() races with suspend and breaks quiescence --

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [High] dm-verity: verity_prefetch_hash() races with suspend and breaks quiescence
--

commit d29b7b5d122e67887bc98258e3fe7f3b2d2db059
Author: Yongpeng Yang <[email protected]>

dm-verity: add messages to prefetch and drop the hash cache

This commit adds prefetch_hash and drop_hash target messages to warm or drop hash blocks in the dm-verity bufio cache.

Quoted 46 lines
drivers/md/dm-verity-target.c +38 -0
index 44b95dbdaebbc..622c427949a35 100644
@@ -1828,12 +1828,117 @@ static void verity_postsuspend(struct dm_target *ti)
 	verity_security_clear_integrity(ti);
 }
 
+static int verity_prefetch_hash(struct dm_verity *v, unsigned int argc,
+				char **argv, char *result, unsigned int maxlen)
+{
+	sector_t total = v->hash_end - v->hash_start;
+	sector_t start, n;
+	unsigned long long value;
+	unsigned int sz = 0;
+
+	/*
+	 * On a no_sleep client a buffer being read cannot be evicted or
+	 * waited for, so an unfinished prefetch would outlive a suspend or
+	 * teardown; drop_hash rejects this case for the same reason.
+	 */
+	if (v->use_bh_wq) {
+		DMERR("prefetch_hash unsupported on tasklet-verifying device");
+		return -EOPNOTSUPP;
+	}
+
+	if (argc == 1) {
+		start = 0;
+		n = total;
+	} else if (argc == 3) {
+		if (kstrtoull(argv[1], 0, &value) || (sector_t)value != value)
+			return -EINVAL;
+		start = value;
+
+		if (kstrtoull(argv[2], 0, &value) || (sector_t)value != value)
+			return -EINVAL;
+		n = value;
+	} else {
+		return -EINVAL;
+	}
+
+	if (start >= total) {
+		if (!total) {
+			n = 0;
+			goto out;
+		}

drivers/md/dm-verity-target.c static void verity_postsuspend(struct dm_target *ti) · line 1878

Quoted 10 lines
drivers/md/dm-verity-target.c +10 -0
+		DMERR("prefetch_hash start %llu beyond hash area (%llu blocks)",
+		      (unsigned long long)start, (unsigned long long)total);
+		return -EINVAL;
+	}
+
+	n = min(n, total - start);
+	n = min_t(sector_t, n, UINT_MAX);
+
+out:
+	dm_bufio_prefetch(v->bufio, v->hash_start + start, n);

[Severity: High]
Can verity_prefetch_hash() race with verity_postsuspend() or run while the device is suspended?

target_message() in drivers/md/dm-ioctl.c only takes the SRCU read lock via dm_get_live_table() and does not take md->suspend_lock or check whether the device is suspending or suspended. In dm_suspend(), __dm_suspend() completes synchronize_srcu(&md->io_barrier) before calling dm_table_postsuspend_targets() -> verity_postsuspend().

CPU0 CPU1
target_message()
verity_message()

    verity_prefetch_hash()
      __dm_bufio_prefetch()
        dm_bufio_lock(c)
        b = __bufio_new(...)
          b->hold_count = 1
        dm_bufio_unlock(c)
                                      dm_suspend()
                                        __dm_suspend()
                                        verity_postsuspend()
                                          dm_bufio_client_reset(v->bufio)
                                            drop_buffers()
                                              cache_iterate(..., warn_leak)
                                              WARN_ON(cache_count(...))
        submit_io(b, ...)
        dm_bufio_release(b)  <-- use-after-free if
                                 CONFIG_DM_DEBUG_BLOCK_STACK_TRACING

While __dm_bufio_prefetch() drops dm_bufio_lock(c) across submit_io() and dm_bufio_release(), b remains in c->cache with hold_count == 1. A concurrent dm_bufio_client_reset() skips b in __get_unclaimed_buffer(), triggers the leak WARN_ONs in warn_leak() and drop_buffers(), and under CONFIG_DM_DEBUG_BLOCK_STACK_TRACING zeroes b->hold_count and frees b while CPU0 still holds it.

Also, contrary to the documentation note in verity.rst, v->bufio is bound to v->hash_dev->bdev rather than the top-level DM device, so calling prefetch_hash while suspended submits read bios directly to the underlying hash device instead of queueing them until resume, breaking the suspend quiescence fixed by commit 2de510fccbca ("dm-verity: fix prefetch-vs-suspend race").

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
#6 lore raw

Re: [PATCH 4/4] dm-verity: add messages to prefetch and drop the hash cache

Quoted 6 lines · On Fri, Nov 20, 2026, [email protected] wrote:

While __dm_bufio_prefetch() drops dm_bufio_lock(c) across submit_io() and dm_bufio_release(), b remains in c->cache with hold_count == 1. A concurrent dm_bufio_client_reset() skips b in __get_unclaimed_buffer(), triggers the leak WARN_ONs in warn_leak() and drop_buffers(), and under CONFIG_DM_DEBUG_BLOCK_STACK_TRACING zeroes b->hold_count and frees b while CPU0 still holds it.

Confirmed -- dm_bufio_lock is indeed released before submit_io() and dm_bufio_release(), so the hold_count == 1 window is real. My earlier analysis that the release happened under the lock was wrong.

Quoted 4 lines

Also, contrary to the documentation note in verity.rst, v->bufio is bound to v->hash_dev->bdev rather than the top-level DM device, so calling prefetch_hash while suspended submits read bios directly to the underlying hash device instead of queueing them until resume.

Also correct; the documentation claim was wrong.

v4 rejects prefetch_hash and drop_hash with -EBUSY while the device is suspended. No further serialization is needed: __dm_suspend() sets the suspended flag before the final synchronize_srcu() that precedes ->postsuspend, and the message handler runs inside the SRCU read section, so a message that passed the check is drained before the reset (including the hold_count == 1 window), and one that arrives after the barrier sees the flag.

I could not reproduce the WARN on a VM even with a debug delay widening the window to 100us per block: synchronize_srcu() drains in-flight messages before postsuspend, leaving only a microsecond-scale gap that I could not hit. The scenario is correct on paper; the -EBUSY check removes it regardless.

Thanks for the review,
Yongpeng