]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
loop-util: drop workaround for kernel older than v5.0
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 13 Apr 2025 21:54:26 +0000 (06:54 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 14 Apr 2025 12:57:53 +0000 (21:57 +0900)
Now our baseline on the kernel is v5.4.

src/shared/loop-util.c

index 5b2c25067d74258953c8cf0ca87ea44a82049a2b..4a6e0046dfc2796a65bc0bc01fd8302ceaa43a4d 100644 (file)
@@ -199,21 +199,6 @@ static int loop_configure_fallback(int fd, const struct loop_config *c) {
                               random_u64_range(UINT64_C(240) * USEC_PER_MSEC * n_attempts/64));
         }
 
-        /* Work around a kernel bug, where changing offset/size of the loopback device doesn't correctly
-         * invalidate the buffer cache. For details see:
-         *
-         *     https://android.googlesource.com/platform/system/apex/+/bef74542fbbb4cd629793f4efee8e0053b360570
-         *
-         * This was fixed in kernel 5.0, see:
-         *
-         *     https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5db470e229e22b7eda6e23b5566e532c96fb5bc3
-         *
-         * We'll run the work-around here in the legacy LOOP_SET_STATUS64 codepath. In the LOOP_CONFIGURE
-         * codepath above it should not be necessary. */
-        if (c->info.lo_offset != 0 || c->info.lo_sizelimit != 0)
-                if (ioctl(fd, BLKFLSBUF, 0) < 0)
-                        log_debug_errno(errno, "Failed to issue BLKFLSBUF ioctl, ignoring: %m");
-
         /* If a block size is requested then try to configure it. If that doesn't work, ignore errors, but
          * afterwards, let's validate what is in effect, and if it doesn't match what we want, fail */
         if (c->block_size != 0) {