Thread (30 messages) 30 messages, 3 authors, 2017-05-31
STALE3321d

[PATCH 23/24] tmpfs: generate random sb->s_uuid

From: Christoph Hellwig <hidden>
Date: 2017-05-31 16:18:25
Also in: linux-block, linux-fsdevel, linux-xfs, lkml, nvdimm
Subsystem: memory management, the rest, tmpfs (shmem filesystem) · Maintainers: Andrew Morton, Linus Torvalds, Hugh Dickins

From: Amir Goldstein <redacted>

This is used by overlayfs to encode intrasystem unique file handles.

Suggested-by: Miklos Szeredi <redacted>
Cc: Hugh Dickins <redacted>
Cc: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Signed-off-by: Amir Goldstein <redacted>
Signed-off-by: Christoph Hellwig <redacted>
---
 mm/shmem.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/mm/shmem.c b/mm/shmem.c
index e67d6ba4e98e..391f2dcca727 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -75,6 +75,7 @@ static struct vfsmount *shm_mnt;
 #include <uapi/linux/memfd.h>
 #include <linux/userfaultfd_k.h>
 #include <linux/rmap.h>
+#include <linux/uuid.h>
 
 #include <linux/uaccess.h>
 #include <asm/pgtable.h>
@@ -3761,6 +3762,7 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent)
 #ifdef CONFIG_TMPFS_POSIX_ACL
 	sb->s_flags |= MS_POSIXACL;
 #endif
+	uuid_gen(&sb->s_uuid);
 
 	inode = shmem_get_inode(sb, NULL, S_IFDIR | sbinfo->mode, 0, VM_NORESERVE);
 	if (!inode)
-- 
2.11.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help