From: Yu Watanabe Date: Sun, 9 Nov 2025 01:14:11 +0000 (+0900) Subject: reread-partition-table: fix error code check X-Git-Tag: v259-rc1~121 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7304557ea961ebc7841254f4dde8e0136550cf25;p=thirdparty%2Fsystemd.git reread-partition-table: fix error code check flock() sets EAGAIN rather than EBUSY when a node is already locked. Follow-up for d8e38d4aaac23cb27cc7e0f410449c3a6034db4f. Fixes #39544. --- diff --git a/src/shared/reread-partition-table.c b/src/shared/reread-partition-table.c index 9f9fa7d94ce..d95e2864c44 100644 --- a/src/shared/reread-partition-table.c +++ b/src/shared/reread-partition-table.c @@ -262,7 +262,7 @@ static int reread_partition_table_full(sd_device *dev, int fd, RereadPartitionTa if (flock(lock_fd, LOCK_EX|LOCK_NB) < 0) { r = log_device_debug_errno(dev, errno, "Failed to take BSD lock on block device '%s': %m", p); - if (r == -EBUSY && FLAGS_SET(flags, REREADPT_FORCE_UEVENT)) { + if (r == -EAGAIN && FLAGS_SET(flags, REREADPT_FORCE_UEVENT)) { log_device_debug(dev, "Giving up rereading partition table of '%s'. Triggering change events for the device and its partitions.", p); (void) trigger_partitions(dev, /* blkrrpart_success= */ false); }