Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
[firefly-linux-kernel-4.4.55.git] / fs / namespace.c
index 7b0b95371696117494af637af71c24d6752a3939..e96e03782def7d02df8cb40443a483747061ecdc 100644 (file)
@@ -1002,6 +1002,18 @@ 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;
@@ -1040,6 +1052,10 @@ 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);
@@ -1244,7 +1260,7 @@ static int do_umount(struct vfsmount *mnt, int flags)
                 */
                br_write_lock(vfsmount_lock);
                if (mnt_get_count(mnt) != 2) {
-                       br_write_lock(vfsmount_lock);
+                       br_write_unlock(vfsmount_lock);
                        return -EBUSY;
                }
                br_write_unlock(vfsmount_lock);
@@ -1767,6 +1783,10 @@ static int do_remount(struct path *path, int flags, int mnt_flags,
        if (path->dentry != path->mnt->mnt_root)
                return -EINVAL;
 
+       err = security_sb_remount(sb, data);
+       if (err)
+               return err;
+
        down_write(&sb->s_umount);
        if (flags & MS_BIND)
                err = change_mount_flags(path->mnt, flags);