Re: Initramfs FSID altered in 3.14
From: Thomas Bächler
Date: Thu Apr 03 2014 - 14:14:09 EST
Am 03.04.2014 19:57, schrieb Dave Reisner:
> Hi,
>
> [This is a repost of a G+ post at Tejun's request]
>
> With Linux 3.14, you might notice in /proc/self/mountinfo that your
> root's parent FSID is now 0, instead of the 1 that it's been for the
> last N years. Tejun wrote the change (9e30cc9595303b27b48) that caused
> this, but the change comes in a rather innocuous way. Instead of an
> internal kernel mount of sysfs being assigned 0, it's now the initramfs.
>
> So far, this has already caused switch_root and findmnt (from
> util-linux) to break, cp (from coreutils) to break when using the -x
> flag in early userspace, and it's also been pointed out that systemd's
> readahead code makes assumptions about a device number of 0.
>
> Are we now supposed to go and change all the assumptions in userspace
> about 0 being special? I'm conflicted. The kernel isn't supposed to
> break userspace, but it seems to me that FSIDs were never something to
> rely on -- similar to the block device numbering scheme.
Most of these bugs were not caused by rootfs' FSID being different from
1, but rather because there was a file system with FSID 0.
Only util-linux/switch_root assumed that rootfs always had exactly FSID
1 - which is IMO a wrong assumption.
However, tt seems that people have been assuming that st_dev > 0 for a
while. If we want to revert this in the kernel, this patch (untested)
should be sufficient:
diff --git a/fs/super.c b/fs/super.c
index 80d5cf2..d9fddde 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -802,7 +802,7 @@ void emergency_remount(void)
static DEFINE_IDA(unnamed_dev_ida);
static DEFINE_SPINLOCK(unnamed_dev_lock);/* protects the above */
-static int unnamed_dev_start = 0; /* don't bother trying below it */
+static int unnamed_dev_start = 1; /* don't bother trying below it */
int get_anon_bdev(dev_t *p)
{
Attachment:
signature.asc
Description: OpenPGP digital signature