projects/linux·commit be85bcca

Revert "vfs: Export file system uuid via /proc/<pid>/mountinfo"

be85bcca · Linus Torvalds <[email protected]> · 2011-04-12 13:35:56 -07:00

This reverts commit 93f1c20bc8cdb757be50566eff88d65c3b26881f.

It turns out that libmount misparses it because it adds a '-' character
in the uuid string, which libmount then incorrectly confuses with the
separator string (" - ") at the end of all the optional arguments.

Upstream libmount (in the util-linux tree) has been fixed, but until
that fix actually percolates up to users, we'd better not expose this
change in the kernel.

Let's revisit this later (possibly by exposing the UUID without any '-'
characters in it, avoiding the user-space bug).

Reported-by: Dave Jones <[email protected]>
Cc: Aneesh Kumar K.V <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Karel Zak <[email protected]>
Cc: Ram Pai <[email protected]>
Cc: Miklos Szeredi <[email protected]>
Cc: Eric Sandeen <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
be85bccaa5aa5a11dcaf85f9e945ffefd253f631
Parents
16ad5697

Changes

2 files changed · +0 −17

FileStatusAddDelContent
fs/namespace.cmodified+0−16View file
include/linux/fs.hmodified+0−1View file

fs/namespace.c

View file
diff --git a/fs/namespace.c b/fs/namespace.c
index 7dba2ed..d99bcf5 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1030,18 +1030,6 @@ const struct seq_operations mounts_op = {
.show = show_vfsmnt
};
-static int uuid_is_nil(u8 *uuid)
-{
- int i;
- u8 *cp = (u8 *)uuid;
-
- for (i = 0; i < 16; i++) {
- if (*cp++)
- return 0;
- }
- return 1;
-}
-
static int show_mountinfo(struct seq_file *m, void *v)
{
struct proc_mounts *p = m->private;
@@ -1085,10 +1073,6 @@ static int show_mountinfo(struct seq_file *m, void *v)
if (IS_MNT_UNBINDABLE(mnt))
seq_puts(m, " unbindable");
- if (!uuid_is_nil(mnt->mnt_sb->s_uuid))
- /* print the uuid */
- seq_printf(m, " uuid:%pU", mnt->mnt_sb->s_uuid);
-
/* Filesystem specific data */
seq_puts(m, " - ");
show_type(m, sb);

include/linux/fs.h

View file
diff --git a/include/linux/fs.h b/include/linux/fs.h
index dbd860a..5b14843 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1403,7 +1403,6 @@ struct super_block {
wait_queue_head_t s_wait_unfrozen;
char s_id[32]; /* Informational name */
- u8 s_uuid[16]; /* UUID */
void *s_fs_info; /* Filesystem private info */
fmode_t s_mode;