linux/fs/namespace.c
<<
>>
Prefs
   1/*
   2 *  linux/fs/namespace.c
   3 *
   4 * (C) Copyright Al Viro 2000, 2001
   5 *      Released under GPL v2.
   6 *
   7 * Based on code from fs/super.c, copyright Linus Torvalds and others.
   8 * Heavily rewritten.
   9 */
  10
  11#include <linux/syscalls.h>
  12#include <linux/slab.h>
  13#include <linux/sched.h>
  14#include <linux/spinlock.h>
  15#include <linux/percpu.h>
  16#include <linux/init.h>
  17#include <linux/kernel.h>
  18#include <linux/acct.h>
  19#include <linux/capability.h>
  20#include <linux/cpumask.h>
  21#include <linux/module.h>
  22#include <linux/sysfs.h>
  23#include <linux/seq_file.h>
  24#include <linux/mnt_namespace.h>
  25#include <linux/namei.h>
  26#include <linux/nsproxy.h>
  27#include <linux/security.h>
  28#include <linux/mount.h>
  29#include <linux/ramfs.h>
  30#include <linux/log2.h>
  31#include <linux/idr.h>
  32#include <linux/fs_struct.h>
  33#include <linux/fsnotify.h>
  34#include <asm/uaccess.h>
  35#include <asm/unistd.h>
  36#include "pnode.h"
  37#include "internal.h"
  38
  39#define HASH_SHIFT ilog2(PAGE_SIZE / sizeof(struct list_head))
  40#define HASH_SIZE (1UL << HASH_SHIFT)
  41
  42static int event;
  43static DEFINE_IDA(mnt_id_ida);
  44static DEFINE_IDA(mnt_group_ida);
  45static DEFINE_SPINLOCK(mnt_id_lock);
  46static int mnt_id_start = 0;
  47static int mnt_group_start = 1;
  48
  49static struct list_head *mount_hashtable __read_mostly;
  50static struct kmem_cache *mnt_cache __read_mostly;
  51static struct rw_semaphore namespace_sem;
  52
  53/* /sys/fs */
  54struct kobject *fs_kobj;
  55EXPORT_SYMBOL_GPL(fs_kobj);
  56
  57/*
  58 * vfsmount lock may be taken for read to prevent changes to the
  59 * vfsmount hash, ie. during mountpoint lookups or walking back
  60 * up the tree.
  61 *
  62 * It should be taken for write in all cases where the vfsmount
  63 * tree or hash is modified or when a vfsmount structure is modified.
  64 */
  65DEFINE_BRLOCK(vfsmount_lock);
  66
  67static inline unsigned long hash(struct vfsmount *mnt, struct dentry *dentry)
  68{
  69        unsigned long tmp = ((unsigned long)mnt / L1_CACHE_BYTES);
  70        tmp += ((unsigned long)dentry / L1_CACHE_BYTES);
  71        tmp = tmp + (tmp >> HASH_SHIFT);
  72        return tmp & (HASH_SIZE - 1);
  73}
  74
  75#define MNT_WRITER_UNDERFLOW_LIMIT -(1<<16)
  76
  77/*
  78 * allocation is serialized by namespace_sem, but we need the spinlock to
  79 * serialize with freeing.
  80 */
  81static int mnt_alloc_id(struct vfsmount *mnt)
  82{
  83        int res;
  84
  85retry:
  86        ida_pre_get(&mnt_id_ida, GFP_KERNEL);
  87        spin_lock(&mnt_id_lock);
  88        res = ida_get_new_above(&mnt_id_ida, mnt_id_start, &mnt->mnt_id);
  89        if (!res)
  90                mnt_id_start = mnt->mnt_id + 1;
  91        spin_unlock(&mnt_id_lock);
  92        if (res == -EAGAIN)
  93                goto retry;
  94
  95        return res;
  96}
  97
  98static void mnt_free_id(struct vfsmount *mnt)
  99{
 100        int id = mnt->mnt_id;
 101        spin_lock(&mnt_id_lock);
 102        ida_remove(&mnt_id_ida, id);
 103        if (mnt_id_start > id)
 104                mnt_id_start = id;
 105        spin_unlock(&mnt_id_lock);
 106}
 107
 108/*
 109 * Allocate a new peer group ID
 110 *
 111 * mnt_group_ida is protected by namespace_sem
 112 */
 113static int mnt_alloc_group_id(struct vfsmount *mnt)
 114{
 115        int res;
 116
 117        if (!ida_pre_get(&mnt_group_ida, GFP_KERNEL))
 118                return -ENOMEM;
 119
 120        res = ida_get_new_above(&mnt_group_ida,
 121                                mnt_group_start,
 122                                &mnt->mnt_group_id);
 123        if (!res)
 124                mnt_group_start = mnt->mnt_group_id + 1;
 125
 126        return res;
 127}
 128
 129/*
 130 * Release a peer group ID
 131 */
 132void mnt_release_group_id(struct vfsmount *mnt)
 133{
 134        int id = mnt->mnt_group_id;
 135        ida_remove(&mnt_group_ida, id);
 136        if (mnt_group_start > id)
 137                mnt_group_start = id;
 138        mnt->mnt_group_id = 0;
 139}
 140
 141/*
 142 * vfsmount lock must be held for read
 143 */
 144static inline void mnt_add_count(struct vfsmount *mnt, int n)
 145{
 146#ifdef CONFIG_SMP
 147        this_cpu_add(mnt->mnt_pcp->mnt_count, n);
 148#else
 149        preempt_disable();
 150        mnt->mnt_count += n;
 151        preempt_enable();
 152#endif
 153}
 154
 155static inline void mnt_set_count(struct vfsmount *mnt, int n)
 156{
 157#ifdef CONFIG_SMP
 158        this_cpu_write(mnt->mnt_pcp->mnt_count, n);
 159#else
 160        mnt->mnt_count = n;
 161#endif
 162}
 163
 164/*
 165 * vfsmount lock must be held for read
 166 */
 167static inline void mnt_inc_count(struct vfsmount *mnt)
 168{
 169        mnt_add_count(mnt, 1);
 170}
 171
 172/*
 173 * vfsmount lock must be held for read
 174 */
 175static inline void mnt_dec_count(struct vfsmount *mnt)
 176{
 177        mnt_add_count(mnt, -1);
 178}
 179
 180/*
 181 * vfsmount lock must be held for write
 182 */
 183unsigned int mnt_get_count(struct vfsmount *mnt)
 184{
 185#ifdef CONFIG_SMP
 186        unsigned int count = 0;
 187        int cpu;
 188
 189        for_each_possible_cpu(cpu) {
 190                count += per_cpu_ptr(mnt->mnt_pcp, cpu)->mnt_count;
 191        }
 192
 193        return count;
 194#else
 195        return mnt->mnt_count;
 196#endif
 197}
 198
 199static struct vfsmount *alloc_vfsmnt(const char *name)
 200{
 201        struct vfsmount *mnt = kmem_cache_zalloc(mnt_cache, GFP_KERNEL);
 202        if (mnt) {
 203                int err;
 204
 205                err = mnt_alloc_id(mnt);
 206                if (err)
 207                        goto out_free_cache;
 208
 209                if (name) {
 210                        mnt->mnt_devname = kstrdup(name, GFP_KERNEL);
 211                        if (!mnt->mnt_devname)
 212                                goto out_free_id;
 213                }
 214
 215#ifdef CONFIG_SMP
 216                mnt->mnt_pcp = alloc_percpu(struct mnt_pcp);
 217                if (!mnt->mnt_pcp)
 218                        goto out_free_devname;
 219
 220                this_cpu_add(mnt->mnt_pcp->mnt_count, 1);
 221#else
 222                mnt->mnt_count = 1;
 223                mnt->mnt_writers = 0;
 224#endif
 225
 226                INIT_LIST_HEAD(&mnt->mnt_hash);
 227                INIT_LIST_HEAD(&mnt->mnt_child);
 228                INIT_LIST_HEAD(&mnt->mnt_mounts);
 229                INIT_LIST_HEAD(&mnt->mnt_list);
 230                INIT_LIST_HEAD(&mnt->mnt_expire);
 231                INIT_LIST_HEAD(&mnt->mnt_share);
 232                INIT_LIST_HEAD(&mnt->mnt_slave_list);
 233                INIT_LIST_HEAD(&mnt->mnt_slave);
 234#ifdef CONFIG_FSNOTIFY
 235                INIT_HLIST_HEAD(&mnt->mnt_fsnotify_marks);
 236#endif
 237        }
 238        return mnt;
 239
 240#ifdef CONFIG_SMP
 241out_free_devname:
 242        kfree(mnt->mnt_devname);
 243#endif
 244out_free_id:
 245        mnt_free_id(mnt);
 246out_free_cache:
 247        kmem_cache_free(mnt_cache, mnt);
 248        return NULL;
 249}
 250
 251/*
 252 * Most r/o checks on a fs are for operations that take
 253 * discrete amounts of time, like a write() or unlink().
 254 * We must keep track of when those operations start
 255 * (for permission checks) and when they end, so that
 256 * we can determine when writes are able to occur to
 257 * a filesystem.
 258 */
 259/*
 260 * __mnt_is_readonly: check whether a mount is read-only
 261 * @mnt: the mount to check for its write status
 262 *
 263 * This shouldn't be used directly ouside of the VFS.
 264 * It does not guarantee that the filesystem will stay
 265 * r/w, just that it is right *now*.  This can not and
 266 * should not be used in place of IS_RDONLY(inode).
 267 * mnt_want/drop_write() will _keep_ the filesystem
 268 * r/w.
 269 */
 270int __mnt_is_readonly(struct vfsmount *mnt)
 271{
 272        if (mnt->mnt_flags & MNT_READONLY)
 273                return 1;
 274        if (mnt->mnt_sb->s_flags & MS_RDONLY)
 275                return 1;
 276        return 0;
 277}
 278EXPORT_SYMBOL_GPL(__mnt_is_readonly);
 279
 280static inline void mnt_inc_writers(struct vfsmount *mnt)
 281{
 282#ifdef CONFIG_SMP
 283        this_cpu_inc(mnt->mnt_pcp->mnt_writers);
 284#else
 285        mnt->mnt_writers++;
 286#endif
 287}
 288
 289static inline void mnt_dec_writers(struct vfsmount *mnt)
 290{
 291#ifdef CONFIG_SMP
 292        this_cpu_dec(mnt->mnt_pcp->mnt_writers);
 293#else
 294        mnt->mnt_writers--;
 295#endif
 296}
 297
 298static unsigned int mnt_get_writers(struct vfsmount *mnt)
 299{
 300#ifdef CONFIG_SMP
 301        unsigned int count = 0;
 302        int cpu;
 303
 304        for_each_possible_cpu(cpu) {
 305                count += per_cpu_ptr(mnt->mnt_pcp, cpu)->mnt_writers;
 306        }
 307
 308        return count;
 309#else
 310        return mnt->mnt_writers;
 311#endif
 312}
 313
 314/*
 315 * Most r/o checks on a fs are for operations that take
 316 * discrete amounts of time, like a write() or unlink().
 317 * We must keep track of when those operations start
 318 * (for permission checks) and when they end, so that
 319 * we can determine when writes are able to occur to
 320 * a filesystem.
 321 */
 322/**
 323 * mnt_want_write - get write access to a mount
 324 * @mnt: the mount on which to take a write
 325 *
 326 * This tells the low-level filesystem that a write is
 327 * about to be performed to it, and makes sure that
 328 * writes are allowed before returning success.  When
 329 * the write operation is finished, mnt_drop_write()
 330 * must be called.  This is effectively a refcount.
 331 */
 332int mnt_want_write(struct vfsmount *mnt)
 333{
 334        int ret = 0;
 335
 336        preempt_disable();
 337        mnt_inc_writers(mnt);
 338        /*
 339         * The store to mnt_inc_writers must be visible before we pass
 340         * MNT_WRITE_HOLD loop below, so that the slowpath can see our
 341         * incremented count after it has set MNT_WRITE_HOLD.
 342         */
 343        smp_mb();
 344        while (mnt->mnt_flags & MNT_WRITE_HOLD)
 345                cpu_relax();
 346        /*
 347         * After the slowpath clears MNT_WRITE_HOLD, mnt_is_readonly will
 348         * be set to match its requirements. So we must not load that until
 349         * MNT_WRITE_HOLD is cleared.
 350         */
 351        smp_rmb();
 352        if (__mnt_is_readonly(mnt)) {
 353                mnt_dec_writers(mnt);
 354                ret = -EROFS;
 355                goto out;
 356        }
 357out:
 358        preempt_enable();
 359        return ret;
 360}
 361EXPORT_SYMBOL_GPL(mnt_want_write);
 362
 363/**
 364 * mnt_clone_write - get write access to a mount
 365 * @mnt: the mount on which to take a write
 366 *
 367 * This is effectively like mnt_want_write, except
 368 * it must only be used to take an extra write reference
 369 * on a mountpoint that we already know has a write reference
 370 * on it. This allows some optimisation.
 371 *
 372 * After finished, mnt_drop_write must be called as usual to
 373 * drop the reference.
 374 */
 375int mnt_clone_write(struct vfsmount *mnt)
 376{
 377        /* superblock may be r/o */
 378        if (__mnt_is_readonly(mnt))
 379                return -EROFS;
 380        preempt_disable();
 381        mnt_inc_writers(mnt);
 382        preempt_enable();
 383        return 0;
 384}
 385EXPORT_SYMBOL_GPL(mnt_clone_write);
 386
 387/**
 388 * mnt_want_write_file - get write access to a file's mount
 389 * @file: the file who's mount on which to take a write
 390 *
 391 * This is like mnt_want_write, but it takes a file and can
 392 * do some optimisations if the file is open for write already
 393 */
 394int mnt_want_write_file(struct file *file)
 395{
 396        struct inode *inode = file->f_dentry->d_inode;
 397        if (!(file->f_mode & FMODE_WRITE) || special_file(inode->i_mode))
 398                return mnt_want_write(file->f_path.mnt);
 399        else
 400                return mnt_clone_write(file->f_path.mnt);
 401}
 402EXPORT_SYMBOL_GPL(mnt_want_write_file);
 403
 404/**
 405 * mnt_drop_write - give up write access to a mount
 406 * @mnt: the mount on which to give up write access
 407 *
 408 * Tells the low-level filesystem that we are done
 409 * performing writes to it.  Must be matched with
 410 * mnt_want_write() call above.
 411 */
 412void mnt_drop_write(struct vfsmount *mnt)
 413{
 414        preempt_disable();
 415        mnt_dec_writers(mnt);
 416        preempt_enable();
 417}
 418EXPORT_SYMBOL_GPL(mnt_drop_write);
 419
 420static int mnt_make_readonly(struct vfsmount *mnt)
 421{
 422        int ret = 0;
 423
 424        br_write_lock(vfsmount_lock);
 425        mnt->mnt_flags |= MNT_WRITE_HOLD;
 426        /*
 427         * After storing MNT_WRITE_HOLD, we'll read the counters. This store
 428         * should be visible before we do.
 429         */
 430        smp_mb();
 431
 432        /*
 433         * With writers on hold, if this value is zero, then there are
 434         * definitely no active writers (although held writers may subsequently
 435         * increment the count, they'll have to wait, and decrement it after
 436         * seeing MNT_READONLY).
 437         *
 438         * It is OK to have counter incremented on one CPU and decremented on
 439         * another: the sum will add up correctly. The danger would be when we
 440         * sum up each counter, if we read a counter before it is incremented,
 441         * but then read another CPU's count which it has been subsequently
 442         * decremented from -- we would see more decrements than we should.
 443         * MNT_WRITE_HOLD protects against this scenario, because
 444         * mnt_want_write first increments count, then smp_mb, then spins on
 445         * MNT_WRITE_HOLD, so it can't be decremented by another CPU while
 446         * we're counting up here.
 447         */
 448        if (mnt_get_writers(mnt) > 0)
 449                ret = -EBUSY;
 450        else
 451                mnt->mnt_flags |= MNT_READONLY;
 452        /*
 453         * MNT_READONLY must become visible before ~MNT_WRITE_HOLD, so writers
 454         * that become unheld will see MNT_READONLY.
 455         */
 456        smp_wmb();
 457        mnt->mnt_flags &= ~MNT_WRITE_HOLD;
 458        br_write_unlock(vfsmount_lock);
 459        return ret;
 460}
 461
 462static void __mnt_unmake_readonly(struct vfsmount *mnt)
 463{
 464        br_write_lock(vfsmount_lock);
 465        mnt->mnt_flags &= ~MNT_READONLY;
 466        br_write_unlock(vfsmount_lock);
 467}
 468
 469static void free_vfsmnt(struct vfsmount *mnt)
 470{
 471        kfree(mnt->mnt_devname);
 472        mnt_free_id(mnt);
 473#ifdef CONFIG_SMP
 474        free_percpu(mnt->mnt_pcp);
 475#endif
 476        kmem_cache_free(mnt_cache, mnt);
 477}
 478
 479/*
 480 * find the first or last mount at @dentry on vfsmount @mnt depending on
 481 * @dir. If @dir is set return the first mount else return the last mount.
 482 * vfsmount_lock must be held for read or write.
 483 */
 484struct vfsmount *__lookup_mnt(struct vfsmount *mnt, struct dentry *dentry,
 485                              int dir)
 486{
 487        struct list_head *head = mount_hashtable + hash(mnt, dentry);
 488        struct list_head *tmp = head;
 489        struct vfsmount *p, *found = NULL;
 490
 491        for (;;) {
 492                tmp = dir ? tmp->next : tmp->prev;
 493                p = NULL;
 494                if (tmp == head)
 495                        break;
 496                p = list_entry(tmp, struct vfsmount, mnt_hash);
 497                if (p->mnt_parent == mnt && p->mnt_mountpoint == dentry) {
 498                        found = p;
 499                        break;
 500                }
 501        }
 502        return found;
 503}
 504
 505/*
 506 * lookup_mnt increments the ref count before returning
 507 * the vfsmount struct.
 508 */
 509struct vfsmount *lookup_mnt(struct path *path)
 510{
 511        struct vfsmount *child_mnt;
 512
 513        br_read_lock(vfsmount_lock);
 514        if ((child_mnt = __lookup_mnt(path->mnt, path->dentry, 1)))
 515                mntget(child_mnt);
 516        br_read_unlock(vfsmount_lock);
 517        return child_mnt;
 518}
 519
 520static inline int check_mnt(struct vfsmount *mnt)
 521{
 522        return mnt->mnt_ns == current->nsproxy->mnt_ns;
 523}
 524
 525/*
 526 * vfsmount lock must be held for write
 527 */
 528static void touch_mnt_namespace(struct mnt_namespace *ns)
 529{
 530        if (ns) {
 531                ns->event = ++event;
 532                wake_up_interruptible(&ns->poll);
 533        }
 534}
 535
 536/*
 537 * vfsmount lock must be held for write
 538 */
 539static void __touch_mnt_namespace(struct mnt_namespace *ns)
 540{
 541        if (ns && ns->event != event) {
 542                ns->event = event;
 543                wake_up_interruptible(&ns->poll);
 544        }
 545}
 546
 547/*
 548 * Clear dentry's mounted state if it has no remaining mounts.
 549 * vfsmount_lock must be held for write.
 550 */
 551static void dentry_reset_mounted(struct vfsmount *mnt, struct dentry *dentry)
 552{
 553        unsigned u;
 554
 555        for (u = 0; u < HASH_SIZE; u++) {
 556                struct vfsmount *p;
 557
 558                list_for_each_entry(p, &mount_hashtable[u], mnt_hash) {
 559                        if (p->mnt_mountpoint == dentry)
 560                                return;
 561                }
 562        }
 563        spin_lock(&dentry->d_lock);
 564        dentry->d_flags &= ~DCACHE_MOUNTED;
 565        spin_unlock(&dentry->d_lock);
 566}
 567
 568/*
 569 * vfsmount lock must be held for write
 570 */
 571static void detach_mnt(struct vfsmount *mnt, struct path *old_path)
 572{
 573        old_path->dentry = mnt->mnt_mountpoint;
 574        old_path->mnt = mnt->mnt_parent;
 575        mnt->mnt_parent = mnt;
 576        mnt->mnt_mountpoint = mnt->mnt_root;
 577        list_del_init(&mnt->mnt_child);
 578        list_del_init(&mnt->mnt_hash);
 579        dentry_reset_mounted(old_path->mnt, old_path->dentry);
 580}
 581
 582/*
 583 * vfsmount lock must be held for write
 584 */
 585void mnt_set_mountpoint(struct vfsmount *mnt, struct dentry *dentry,
 586                        struct vfsmount *child_mnt)
 587{
 588        child_mnt->mnt_parent = mntget(mnt);
 589        child_mnt->mnt_mountpoint = dget(dentry);
 590        spin_lock(&dentry->d_lock);
 591        dentry->d_flags |= DCACHE_MOUNTED;
 592        spin_unlock(&dentry->d_lock);
 593}
 594
 595/*
 596 * vfsmount lock must be held for write
 597 */
 598static void attach_mnt(struct vfsmount *mnt, struct path *path)
 599{
 600        mnt_set_mountpoint(path->mnt, path->dentry, mnt);
 601        list_add_tail(&mnt->mnt_hash, mount_hashtable +
 602                        hash(path->mnt, path->dentry));
 603        list_add_tail(&mnt->mnt_child, &path->mnt->mnt_mounts);
 604}
 605
 606static inline void __mnt_make_longterm(struct vfsmount *mnt)
 607{
 608#ifdef CONFIG_SMP
 609        atomic_inc(&mnt->mnt_longterm);
 610#endif
 611}
 612
 613/* needs vfsmount lock for write */
 614static inline void __mnt_make_shortterm(struct vfsmount *mnt)
 615{
 616#ifdef CONFIG_SMP
 617        atomic_dec(&mnt->mnt_longterm);
 618#endif
 619}
 620
 621/*
 622 * vfsmount lock must be held for write
 623 */
 624static void commit_tree(struct vfsmount *mnt)
 625{
 626        struct vfsmount *parent = mnt->mnt_parent;
 627        struct vfsmount *m;
 628        LIST_HEAD(head);
 629        struct mnt_namespace *n = parent->mnt_ns;
 630
 631        BUG_ON(parent == mnt);
 632
 633        list_add_tail(&head, &mnt->mnt_list);
 634        list_for_each_entry(m, &head, mnt_list) {
 635                m->mnt_ns = n;
 636                __mnt_make_longterm(m);
 637        }
 638
 639        list_splice(&head, n->list.prev);
 640
 641        list_add_tail(&mnt->mnt_hash, mount_hashtable +
 642                                hash(parent, mnt->mnt_mountpoint));
 643        list_add_tail(&mnt->mnt_child, &parent->mnt_mounts);
 644        touch_mnt_namespace(n);
 645}
 646
 647static struct vfsmount *next_mnt(struct vfsmount *p, struct vfsmount *root)
 648{
 649        struct list_head *next = p->mnt_mounts.next;
 650        if (next == &p->mnt_mounts) {
 651                while (1) {
 652                        if (p == root)
 653                                return NULL;
 654                        next = p->mnt_child.next;
 655                        if (next != &p->mnt_parent->mnt_mounts)
 656                                break;
 657                        p = p->mnt_parent;
 658                }
 659        }
 660        return list_entry(next, struct vfsmount, mnt_child);
 661}
 662
 663static struct vfsmount *skip_mnt_tree(struct vfsmount *p)
 664{
 665        struct list_head *prev = p->mnt_mounts.prev;
 666        while (prev != &p->mnt_mounts) {
 667                p = list_entry(prev, struct vfsmount, mnt_child);
 668                prev = p->mnt_mounts.prev;
 669        }
 670        return p;
 671}
 672
 673struct vfsmount *
 674vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void *data)
 675{
 676        struct vfsmount *mnt;
 677        struct dentry *root;
 678
 679        if (!type)
 680                return ERR_PTR(-ENODEV);
 681
 682        mnt = alloc_vfsmnt(name);
 683        if (!mnt)
 684                return ERR_PTR(-ENOMEM);
 685
 686        if (flags & MS_KERNMOUNT)
 687                mnt->mnt_flags = MNT_INTERNAL;
 688
 689        root = mount_fs(type, flags, name, data);
 690        if (IS_ERR(root)) {
 691                free_vfsmnt(mnt);
 692                return ERR_CAST(root);
 693        }
 694
 695        mnt->mnt_root = root;
 696        mnt->mnt_sb = root->d_sb;
 697        mnt->mnt_mountpoint = mnt->mnt_root;
 698        mnt->mnt_parent = mnt;
 699        return mnt;
 700}
 701EXPORT_SYMBOL_GPL(vfs_kern_mount);
 702
 703static struct vfsmount *clone_mnt(struct vfsmount *old, struct dentry *root,
 704                                        int flag)
 705{
 706        struct super_block *sb = old->mnt_sb;
 707        struct vfsmount *mnt = alloc_vfsmnt(old->mnt_devname);
 708
 709        if (mnt) {
 710                if (flag & (CL_SLAVE | CL_PRIVATE))
 711                        mnt->mnt_group_id = 0; /* not a peer of original */
 712                else
 713                        mnt->mnt_group_id = old->mnt_group_id;
 714
 715                if ((flag & CL_MAKE_SHARED) && !mnt->mnt_group_id) {
 716                        int err = mnt_alloc_group_id(mnt);
 717                        if (err)
 718                                goto out_free;
 719                }
 720
 721                mnt->mnt_flags = old->mnt_flags & ~MNT_WRITE_HOLD;
 722                atomic_inc(&sb->s_active);
 723                mnt->mnt_sb = sb;
 724                mnt->mnt_root = dget(root);
 725                mnt->mnt_mountpoint = mnt->mnt_root;
 726                mnt->mnt_parent = mnt;
 727
 728                if (flag & CL_SLAVE) {
 729                        list_add(&mnt->mnt_slave, &old->mnt_slave_list);
 730                        mnt->mnt_master = old;
 731                        CLEAR_MNT_SHARED(mnt);
 732                } else if (!(flag & CL_PRIVATE)) {
 733                        if ((flag & CL_MAKE_SHARED) || IS_MNT_SHARED(old))
 734                                list_add(&mnt->mnt_share, &old->mnt_share);
 735                        if (IS_MNT_SLAVE(old))
 736                                list_add(&mnt->mnt_slave, &old->mnt_slave);
 737                        mnt->mnt_master = old->mnt_master;
 738                }
 739                if (flag & CL_MAKE_SHARED)
 740                        set_mnt_shared(mnt);
 741
 742                /* stick the duplicate mount on the same expiry list
 743                 * as the original if that was on one */
 744                if (flag & CL_EXPIRE) {
 745                        if (!list_empty(&old->mnt_expire))
 746                                list_add(&mnt->mnt_expire, &old->mnt_expire);
 747                }
 748        }
 749        return mnt;
 750
 751 out_free:
 752        free_vfsmnt(mnt);
 753        return NULL;
 754}
 755
 756static inline void mntfree(struct vfsmount *mnt)
 757{
 758        struct super_block *sb = mnt->mnt_sb;
 759
 760        /*
 761         * This probably indicates that somebody messed
 762         * up a mnt_want/drop_write() pair.  If this
 763         * happens, the filesystem was probably unable
 764         * to make r/w->r/o transitions.
 765         */
 766        /*
 767         * The locking used to deal with mnt_count decrement provides barriers,
 768         * so mnt_get_writers() below is safe.
 769         */
 770        WARN_ON(mnt_get_writers(mnt));
 771        fsnotify_vfsmount_delete(mnt);
 772        dput(mnt->mnt_root);
 773        free_vfsmnt(mnt);
 774        deactivate_super(sb);
 775}
 776
 777static void mntput_no_expire(struct vfsmount *mnt)
 778{
 779put_again:
 780#ifdef CONFIG_SMP
 781        br_read_lock(vfsmount_lock);
 782        if (likely(atomic_read(&mnt->mnt_longterm))) {
 783                mnt_dec_count(mnt);
 784                br_read_unlock(vfsmount_lock);
 785                return;
 786        }
 787        br_read_unlock(vfsmount_lock);
 788
 789        br_write_lock(vfsmount_lock);
 790        mnt_dec_count(mnt);
 791        if (mnt_get_count(mnt)) {
 792                br_write_unlock(vfsmount_lock);
 793                return;
 794        }
 795#else
 796        mnt_dec_count(mnt);
 797        if (likely(mnt_get_count(mnt)))
 798                return;
 799        br_write_lock(vfsmount_lock);
 800#endif
 801        if (unlikely(mnt->mnt_pinned)) {
 802                mnt_add_count(mnt, mnt->mnt_pinned + 1);
 803                mnt->mnt_pinned = 0;
 804                br_write_unlock(vfsmount_lock);
 805                acct_auto_close_mnt(mnt);
 806                goto put_again;
 807        }
 808        br_write_unlock(vfsmount_lock);
 809        mntfree(mnt);
 810}
 811
 812void mntput(struct vfsmount *mnt)
 813{
 814        if (mnt) {
 815                /* avoid cacheline pingpong, hope gcc doesn't get "smart" */
 816                if (unlikely(mnt->mnt_expiry_mark))
 817                        mnt->mnt_expiry_mark = 0;
 818                mntput_no_expire(mnt);
 819        }
 820}
 821EXPORT_SYMBOL(mntput);
 822
 823struct vfsmount *mntget(struct vfsmount *mnt)
 824{
 825        if (mnt)
 826                mnt_inc_count(mnt);
 827        return mnt;
 828}
 829EXPORT_SYMBOL(mntget);
 830
 831void mnt_pin(struct vfsmount *mnt)
 832{
 833        br_write_lock(vfsmount_lock);
 834        mnt->mnt_pinned++;
 835        br_write_unlock(vfsmount_lock);
 836}
 837EXPORT_SYMBOL(mnt_pin);
 838
 839void mnt_unpin(struct vfsmount *mnt)
 840{
 841        br_write_lock(vfsmount_lock);
 842        if (mnt->mnt_pinned) {
 843                mnt_inc_count(mnt);
 844                mnt->mnt_pinned--;
 845        }
 846        br_write_unlock(vfsmount_lock);
 847}
 848EXPORT_SYMBOL(mnt_unpin);
 849
 850static inline void mangle(struct seq_file *m, const char *s)
 851{
 852        seq_escape(m, s, " \t\n\\");
 853}
 854
 855/*
 856 * Simple .show_options callback for filesystems which don't want to
 857 * implement more complex mount option showing.
 858 *
 859 * See also save_mount_options().
 860 */
 861int generic_show_options(struct seq_file *m, struct vfsmount *mnt)
 862{
 863        const char *options;
 864
 865        rcu_read_lock();
 866        options = rcu_dereference(mnt->mnt_sb->s_options);
 867
 868        if (options != NULL && options[0]) {
 869                seq_putc(m, ',');
 870                mangle(m, options);
 871        }
 872        rcu_read_unlock();
 873
 874        return 0;
 875}
 876EXPORT_SYMBOL(generic_show_options);
 877
 878/*
 879 * If filesystem uses generic_show_options(), this function should be
 880 * called from the fill_super() callback.
 881 *
 882 * The .remount_fs callback usually needs to be handled in a special
 883 * way, to make sure, that previous options are not overwritten if the
 884 * remount fails.
 885 *
 886 * Also note, that if the filesystem's .remount_fs function doesn't
 887 * reset all options to their default value, but changes only newly
 888 * given options, then the displayed options will not reflect reality
 889 * any more.
 890 */
 891void save_mount_options(struct super_block *sb, char *options)
 892{
 893        BUG_ON(sb->s_options);
 894        rcu_assign_pointer(sb->s_options, kstrdup(options, GFP_KERNEL));
 895}
 896EXPORT_SYMBOL(save_mount_options);
 897
 898void replace_mount_options(struct super_block *sb, char *options)
 899{
 900        char *old = sb->s_options;
 901        rcu_assign_pointer(sb->s_options, options);
 902        if (old) {
 903                synchronize_rcu();
 904                kfree(old);
 905        }
 906}
 907EXPORT_SYMBOL(replace_mount_options);
 908
 909#ifdef CONFIG_PROC_FS
 910/* iterator */
 911static void *m_start(struct seq_file *m, loff_t *pos)
 912{
 913        struct proc_mounts *p = m->private;
 914
 915        down_read(&namespace_sem);
 916        return seq_list_start(&p->ns->list, *pos);
 917}
 918
 919static void *m_next(struct seq_file *m, void *v, loff_t *pos)
 920{
 921        struct proc_mounts *p = m->private;
 922
 923        return seq_list_next(v, &p->ns->list, pos);
 924}
 925
 926static void m_stop(struct seq_file *m, void *v)
 927{
 928        up_read(&namespace_sem);
 929}
 930
 931int mnt_had_events(struct proc_mounts *p)
 932{
 933        struct mnt_namespace *ns = p->ns;
 934        int res = 0;
 935
 936        br_read_lock(vfsmount_lock);
 937        if (p->m.poll_event != ns->event) {
 938                p->m.poll_event = ns->event;
 939                res = 1;
 940        }
 941        br_read_unlock(vfsmount_lock);
 942
 943        return res;
 944}
 945
 946struct proc_fs_info {
 947        int flag;
 948        const char *str;
 949};
 950
 951static int show_sb_opts(struct seq_file *m, struct super_block *sb)
 952{
 953        static const struct proc_fs_info fs_info[] = {
 954                { MS_SYNCHRONOUS, ",sync" },
 955                { MS_DIRSYNC, ",dirsync" },
 956                { MS_MANDLOCK, ",mand" },
 957                { 0, NULL }
 958        };
 959        const struct proc_fs_info *fs_infop;
 960
 961        for (fs_infop = fs_info; fs_infop->flag; fs_infop++) {
 962                if (sb->s_flags & fs_infop->flag)
 963                        seq_puts(m, fs_infop->str);
 964        }
 965
 966        return security_sb_show_options(m, sb);
 967}
 968
 969static void show_mnt_opts(struct seq_file *m, struct vfsmount *mnt)
 970{
 971        static const struct proc_fs_info mnt_info[] = {
 972                { MNT_NOSUID, ",nosuid" },
 973                { MNT_NODEV, ",nodev" },
 974                { MNT_NOEXEC, ",noexec" },
 975                { MNT_NOATIME, ",noatime" },
 976                { MNT_NODIRATIME, ",nodiratime" },
 977                { MNT_RELATIME, ",relatime" },
 978                { 0, NULL }
 979        };
 980        const struct proc_fs_info *fs_infop;
 981
 982        for (fs_infop = mnt_info; fs_infop->flag; fs_infop++) {
 983                if (mnt->mnt_flags & fs_infop->flag)
 984                        seq_puts(m, fs_infop->str);
 985        }
 986}
 987
 988static void show_type(struct seq_file *m, struct super_block *sb)
 989{
 990        mangle(m, sb->s_type->name);
 991        if (sb->s_subtype && sb->s_subtype[0]) {
 992                seq_putc(m, '.');
 993                mangle(m, sb->s_subtype);
 994        }
 995}
 996
 997static int show_vfsmnt(struct seq_file *m, void *v)
 998{
 999        struct vfsmount *mnt = list_entry(v, struct vfsmount, mnt_list);
1000        int err = 0;
1001        struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
1002
1003        if (mnt->mnt_sb->s_op->show_devname) {
1004                err = mnt->mnt_sb->s_op->show_devname(m, mnt);
1005                if (err)
1006                        goto out;
1007        } else {
1008                mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none");
1009        }
1010        seq_putc(m, ' ');
1011        seq_path(m, &mnt_path, " \t\n\\");
1012        seq_putc(m, ' ');
1013        show_type(m, mnt->mnt_sb);
1014        seq_puts(m, __mnt_is_readonly(mnt) ? " ro" : " rw");
1015        err = show_sb_opts(m, mnt->mnt_sb);
1016        if (err)
1017                goto out;
1018        show_mnt_opts(m, mnt);
1019        if (mnt->mnt_sb->s_op->show_options)
1020                err = mnt->mnt_sb->s_op->show_options(m, mnt);
1021        seq_puts(m, " 0 0\n");
1022out:
1023        return err;
1024}
1025
1026const struct seq_operations mounts_op = {
1027        .start  = m_start,
1028        .next   = m_next,
1029        .stop   = m_stop,
1030        .show   = show_vfsmnt
1031};
1032
1033static int show_mountinfo(struct seq_file *m, void *v)
1034{
1035        struct proc_mounts *p = m->private;
1036        struct vfsmount *mnt = list_entry(v, struct vfsmount, mnt_list);
1037        struct super_block *sb = mnt->mnt_sb;
1038        struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
1039        struct path root = p->root;
1040        int err = 0;
1041
1042        seq_printf(m, "%i %i %u:%u ", mnt->mnt_id, mnt->mnt_parent->mnt_id,
1043                   MAJOR(sb->s_dev), MINOR(sb->s_dev));
1044        if (sb->s_op->show_path)
1045                err = sb->s_op->show_path(m, mnt);
1046        else
1047                seq_dentry(m, mnt->mnt_root, " \t\n\\");
1048        if (err)
1049                goto out;
1050        seq_putc(m, ' ');
1051
1052        /* mountpoints outside of chroot jail will give SEQ_SKIP on this */
1053        err = seq_path_root(m, &mnt_path, &root, " \t\n\\");
1054        if (err)
1055                goto out;
1056
1057        seq_puts(m, mnt->mnt_flags & MNT_READONLY ? " ro" : " rw");
1058        show_mnt_opts(m, mnt);
1059
1060        /* Tagged fields ("foo:X" or "bar") */
1061        if (IS_MNT_SHARED(mnt))
1062                seq_printf(m, " shared:%i", mnt->mnt_group_id);
1063        if (IS_MNT_SLAVE(mnt)) {
1064                int master = mnt->mnt_master->mnt_group_id;
1065                int dom = get_dominating_id(mnt, &p->root);
1066                seq_printf(m, " master:%i", master);
1067                if (dom && dom != master)
1068                        seq_printf(m, " propagate_from:%i", dom);
1069        }
1070        if (IS_MNT_UNBINDABLE(mnt))
1071                seq_puts(m, " unbindable");
1072
1073        /* Filesystem specific data */
1074        seq_puts(m, " - ");
1075        show_type(m, sb);
1076        seq_putc(m, ' ');
1077        if (sb->s_op->show_devname)
1078                err = sb->s_op->show_devname(m, mnt);
1079        else
1080                mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none");
1081        if (err)
1082                goto out;
1083        seq_puts(m, sb->s_flags & MS_RDONLY ? " ro" : " rw");
1084        err = show_sb_opts(m, sb);
1085        if (err)
1086                goto out;
1087        if (sb->s_op->show_options)
1088                err = sb->s_op->show_options(m, mnt);
1089        seq_putc(m, '\n');
1090out:
1091        return err;
1092}
1093
1094const struct seq_operations mountinfo_op = {
1095        .start  = m_start,
1096        .next   = m_next,
1097        .stop   = m_stop,
1098        .show   = show_mountinfo,
1099};
1100
1101static int show_vfsstat(struct seq_file *m, void *v)
1102{
1103        struct vfsmount *mnt = list_entry(v, struct vfsmount, mnt_list);
1104        struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
1105        int err = 0;
1106
1107        /* device */
1108        if (mnt->mnt_sb->s_op->show_devname) {
1109                seq_puts(m, "device ");
1110                err = mnt->mnt_sb->s_op->show_devname(m, mnt);
1111        } else {
1112                if (mnt->mnt_devname) {
1113                        seq_puts(m, "device ");
1114                        mangle(m, mnt->mnt_devname);
1115                } else
1116                        seq_puts(m, "no device");
1117        }
1118
1119        /* mount point */
1120        seq_puts(m, " mounted on ");
1121        seq_path(m, &mnt_path, " \t\n\\");
1122        seq_putc(m, ' ');
1123
1124        /* file system type */
1125        seq_puts(m, "with fstype ");
1126        show_type(m, mnt->mnt_sb);
1127
1128        /* optional statistics */
1129        if (mnt->mnt_sb->s_op->show_stats) {
1130                seq_putc(m, ' ');
1131                if (!err)
1132                        err = mnt->mnt_sb->s_op->show_stats(m, mnt);
1133        }
1134
1135        seq_putc(m, '\n');
1136        return err;
1137}
1138
1139const struct seq_operations mountstats_op = {
1140        .start  = m_start,
1141        .next   = m_next,
1142        .stop   = m_stop,
1143        .show   = show_vfsstat,
1144};
1145#endif  /* CONFIG_PROC_FS */
1146
1147/**
1148 * may_umount_tree - check if a mount tree is busy
1149 * @mnt: root of mount tree
1150 *
1151 * This is called to check if a tree of mounts has any
1152 * open files, pwds, chroots or sub mounts that are
1153 * busy.
1154 */
1155int may_umount_tree(struct vfsmount *mnt)
1156{
1157        int actual_refs = 0;
1158        int minimum_refs = 0;
1159        struct vfsmount *p;
1160
1161        /* write lock needed for mnt_get_count */
1162        br_write_lock(vfsmount_lock);
1163        for (p = mnt; p; p = next_mnt(p, mnt)) {
1164                actual_refs += mnt_get_count(p);
1165                minimum_refs += 2;
1166        }
1167        br_write_unlock(vfsmount_lock);
1168
1169        if (actual_refs > minimum_refs)
1170                return 0;
1171
1172        return 1;
1173}
1174
1175EXPORT_SYMBOL(may_umount_tree);
1176
1177/**
1178 * may_umount - check if a mount point is busy
1179 * @mnt: root of mount
1180 *
1181 * This is called to check if a mount point has any
1182 * open files, pwds, chroots or sub mounts. If the
1183 * mount has sub mounts this will return busy
1184 * regardless of whether the sub mounts are busy.
1185 *
1186 * Doesn't take quota and stuff into account. IOW, in some cases it will
1187 * give false negatives. The main reason why it's here is that we need
1188 * a non-destructive way to look for easily umountable filesystems.
1189 */
1190int may_umount(struct vfsmount *mnt)
1191{
1192        int ret = 1;
1193        down_read(&namespace_sem);
1194        br_write_lock(vfsmount_lock);
1195        if (propagate_mount_busy(mnt, 2))
1196                ret = 0;
1197        br_write_unlock(vfsmount_lock);
1198        up_read(&namespace_sem);
1199        return ret;
1200}
1201
1202EXPORT_SYMBOL(may_umount);
1203
1204void release_mounts(struct list_head *head)
1205{
1206        struct vfsmount *mnt;
1207        while (!list_empty(head)) {
1208                mnt = list_first_entry(head, struct vfsmount, mnt_hash);
1209                list_del_init(&mnt->mnt_hash);
1210                if (mnt->mnt_parent != mnt) {
1211                        struct dentry *dentry;
1212                        struct vfsmount *m;
1213
1214                        br_write_lock(vfsmount_lock);
1215                        dentry = mnt->mnt_mountpoint;
1216                        m = mnt->mnt_parent;
1217                        mnt->mnt_mountpoint = mnt->mnt_root;
1218                        mnt->mnt_parent = mnt;
1219                        m->mnt_ghosts--;
1220                        br_write_unlock(vfsmount_lock);
1221                        dput(dentry);
1222                        mntput(m);
1223                }
1224                mntput(mnt);
1225        }
1226}
1227
1228/*
1229 * vfsmount lock must be held for write
1230 * namespace_sem must be held for write
1231 */
1232void umount_tree(struct vfsmount *mnt, int propagate, struct list_head *kill)
1233{
1234        LIST_HEAD(tmp_list);
1235        struct vfsmount *p;
1236
1237        for (p = mnt; p; p = next_mnt(p, mnt))
1238                list_move(&p->mnt_hash, &tmp_list);
1239
1240        if (propagate)
1241                propagate_umount(&tmp_list);
1242
1243        list_for_each_entry(p, &tmp_list, mnt_hash) {
1244                list_del_init(&p->mnt_expire);
1245                list_del_init(&p->mnt_list);
1246                __touch_mnt_namespace(p->mnt_ns);
1247                p->mnt_ns = NULL;
1248                __mnt_make_shortterm(p);
1249                list_del_init(&p->mnt_child);
1250                if (p->mnt_parent != p) {
1251                        p->mnt_parent->mnt_ghosts++;
1252                        dentry_reset_mounted(p->mnt_parent, p->mnt_mountpoint);
1253                }
1254                change_mnt_propagation(p, MS_PRIVATE);
1255        }
1256        list_splice(&tmp_list, kill);
1257}
1258
1259static void shrink_submounts(struct vfsmount *mnt, struct list_head *umounts);
1260
1261static int do_umount(struct vfsmount *mnt, int flags)
1262{
1263        struct super_block *sb = mnt->mnt_sb;
1264        int retval;
1265        LIST_HEAD(umount_list);
1266
1267        retval = security_sb_umount(mnt, flags);
1268        if (retval)
1269                return retval;
1270
1271        /*
1272         * Allow userspace to request a mountpoint be expired rather than
1273         * unmounting unconditionally. Unmount only happens if:
1274         *  (1) the mark is already set (the mark is cleared by mntput())
1275         *  (2) the usage count == 1 [parent vfsmount] + 1 [sys_umount]
1276         */
1277        if (flags & MNT_EXPIRE) {
1278                if (mnt == current->fs->root.mnt ||
1279                    flags & (MNT_FORCE | MNT_DETACH))
1280                        return -EINVAL;
1281
1282                /*
1283                 * probably don't strictly need the lock here if we examined
1284                 * all race cases, but it's a slowpath.
1285                 */
1286                br_write_lock(vfsmount_lock);
1287                if (mnt_get_count(mnt) != 2) {
1288                        br_write_unlock(vfsmount_lock);
1289                        return -EBUSY;
1290                }
1291                br_write_unlock(vfsmount_lock);
1292
1293                if (!xchg(&mnt->mnt_expiry_mark, 1))
1294                        return -EAGAIN;
1295        }
1296
1297        /*
1298         * If we may have to abort operations to get out of this
1299         * mount, and they will themselves hold resources we must
1300         * allow the fs to do things. In the Unix tradition of
1301         * 'Gee thats tricky lets do it in userspace' the umount_begin
1302         * might fail to complete on the first run through as other tasks
1303         * must return, and the like. Thats for the mount program to worry
1304         * about for the moment.
1305         */
1306
1307        if (flags & MNT_FORCE && sb->s_op->umount_begin) {
1308                sb->s_op->umount_begin(sb);
1309        }
1310
1311        /*
1312         * No sense to grab the lock for this test, but test itself looks
1313         * somewhat bogus. Suggestions for better replacement?
1314         * Ho-hum... In principle, we might treat that as umount + switch
1315         * to rootfs. GC would eventually take care of the old vfsmount.
1316         * Actually it makes sense, especially if rootfs would contain a
1317         * /reboot - static binary that would close all descriptors and
1318         * call reboot(9). Then init(8) could umount root and exec /reboot.
1319         */
1320        if (mnt == current->fs->root.mnt && !(flags & MNT_DETACH)) {
1321                /*
1322                 * Special case for "unmounting" root ...
1323                 * we just try to remount it readonly.
1324                 */
1325                down_write(&sb->s_umount);
1326                if (!(sb->s_flags & MS_RDONLY))
1327                        retval = do_remount_sb(sb, MS_RDONLY, NULL, 0);
1328                up_write(&sb->s_umount);
1329                return retval;
1330        }
1331
1332        down_write(&namespace_sem);
1333        br_write_lock(vfsmount_lock);
1334        event++;
1335
1336        if (!(flags & MNT_DETACH))
1337                shrink_submounts(mnt, &umount_list);
1338
1339        retval = -EBUSY;
1340        if (flags & MNT_DETACH || !propagate_mount_busy(mnt, 2)) {
1341                if (!list_empty(&mnt->mnt_list))
1342                        umount_tree(mnt, 1, &umount_list);
1343                retval = 0;
1344        }
1345        br_write_unlock(vfsmount_lock);
1346        up_write(&namespace_sem);
1347        release_mounts(&umount_list);
1348        return retval;
1349}
1350
1351/*
1352 * Now umount can handle mount points as well as block devices.
1353 * This is important for filesystems which use unnamed block devices.
1354 *
1355 * We now support a flag for forced unmount like the other 'big iron'
1356 * unixes. Our API is identical to OSF/1 to avoid making a mess of AMD
1357 */
1358
1359SYSCALL_DEFINE2(umount, char __user *, name, int, flags)
1360{
1361        struct path path;
1362        int retval;
1363        int lookup_flags = 0;
1364
1365        if (flags & ~(MNT_FORCE | MNT_DETACH | MNT_EXPIRE | UMOUNT_NOFOLLOW))
1366                return -EINVAL;
1367
1368        if (!(flags & UMOUNT_NOFOLLOW))
1369                lookup_flags |= LOOKUP_FOLLOW;
1370
1371        retval = user_path_at(AT_FDCWD, name, lookup_flags, &path);
1372        if (retval)
1373                goto out;
1374        retval = -EINVAL;
1375        if (path.dentry != path.mnt->mnt_root)
1376                goto dput_and_out;
1377        if (!check_mnt(path.mnt))
1378                goto dput_and_out;
1379
1380        retval = -EPERM;
1381        if (!capable(CAP_SYS_ADMIN))
1382                goto dput_and_out;
1383
1384        retval = do_umount(path.mnt, flags);
1385dput_and_out:
1386        /* we mustn't call path_put() as that would clear mnt_expiry_mark */
1387        dput(path.dentry);
1388        mntput_no_expire(path.mnt);
1389out:
1390        return retval;
1391}
1392
1393#ifdef __ARCH_WANT_SYS_OLDUMOUNT
1394
1395/*
1396 *      The 2.0 compatible umount. No flags.
1397 */
1398SYSCALL_DEFINE1(oldumount, char __user *, name)
1399{
1400        return sys_umount(name, 0);
1401}
1402
1403#endif
1404
1405static int mount_is_safe(struct path *path)
1406{
1407        if (capable(CAP_SYS_ADMIN))
1408                return 0;
1409        return -EPERM;
1410#ifdef notyet
1411        if (S_ISLNK(path->dentry->d_inode->i_mode))
1412                return -EPERM;
1413        if (path->dentry->d_inode->i_mode & S_ISVTX) {
1414                if (current_uid() != path->dentry->d_inode->i_uid)
1415                        return -EPERM;
1416        }
1417        if (inode_permission(path->dentry->d_inode, MAY_WRITE))
1418                return -EPERM;
1419        return 0;
1420#endif
1421}
1422
1423struct vfsmount *copy_tree(struct vfsmount *mnt, struct dentry *dentry,
1424                                        int flag)
1425{
1426        struct vfsmount *res, *p, *q, *r, *s;
1427        struct path path;
1428
1429        if (!(flag & CL_COPY_ALL) && IS_MNT_UNBINDABLE(mnt))
1430                return NULL;
1431
1432        res = q = clone_mnt(mnt, dentry, flag);
1433        if (!q)
1434                goto Enomem;
1435        q->mnt_mountpoint = mnt->mnt_mountpoint;
1436
1437        p = mnt;
1438        list_for_each_entry(r, &mnt->mnt_mounts, mnt_child) {
1439                if (!is_subdir(r->mnt_mountpoint, dentry))
1440                        continue;
1441
1442                for (s = r; s; s = next_mnt(s, r)) {
1443                        if (!(flag & CL_COPY_ALL) && IS_MNT_UNBINDABLE(s)) {
1444                                s = skip_mnt_tree(s);
1445                                continue;
1446                        }
1447                        while (p != s->mnt_parent) {
1448                                p = p->mnt_parent;
1449                                q = q->mnt_parent;
1450                        }
1451                        p = s;
1452                        path.mnt = q;
1453                        path.dentry = p->mnt_mountpoint;
1454                        q = clone_mnt(p, p->mnt_root, flag);
1455                        if (!q)
1456                                goto Enomem;
1457                        br_write_lock(vfsmount_lock);
1458                        list_add_tail(&q->mnt_list, &res->mnt_list);
1459                        attach_mnt(q, &path);
1460                        br_write_unlock(vfsmount_lock);
1461                }
1462        }
1463        return res;
1464Enomem:
1465        if (res) {
1466                LIST_HEAD(umount_list);
1467                br_write_lock(vfsmount_lock);
1468                umount_tree(res, 0, &umount_list);
1469                br_write_unlock(vfsmount_lock);
1470                release_mounts(&umount_list);
1471        }
1472        return NULL;
1473}
1474
1475struct vfsmount *collect_mounts(struct path *path)
1476{
1477        struct vfsmount *tree;
1478        down_write(&namespace_sem);
1479        tree = copy_tree(path->mnt, path->dentry, CL_COPY_ALL | CL_PRIVATE);
1480        up_write(&namespace_sem);
1481        return tree;
1482}
1483
1484void drop_collected_mounts(struct vfsmount *mnt)
1485{
1486        LIST_HEAD(umount_list);
1487        down_write(&namespace_sem);
1488        br_write_lock(vfsmount_lock);
1489        umount_tree(mnt, 0, &umount_list);
1490        br_write_unlock(vfsmount_lock);
1491        up_write(&namespace_sem);
1492        release_mounts(&umount_list);
1493}
1494
1495int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
1496                   struct vfsmount *root)
1497{
1498        struct vfsmount *mnt;
1499        int res = f(root, arg);
1500        if (res)
1501                return res;
1502        list_for_each_entry(mnt, &root->mnt_list, mnt_list) {
1503                res = f(mnt, arg);
1504                if (res)
1505                        return res;
1506        }
1507        return 0;
1508}
1509
1510static void cleanup_group_ids(struct vfsmount *mnt, struct vfsmount *end)
1511{
1512        struct vfsmount *p;
1513
1514        for (p = mnt; p != end; p = next_mnt(p, mnt)) {
1515                if (p->mnt_group_id && !IS_MNT_SHARED(p))
1516                        mnt_release_group_id(p);
1517        }
1518}
1519
1520static int invent_group_ids(struct vfsmount *mnt, bool recurse)
1521{
1522        struct vfsmount *p;
1523
1524        for (p = mnt; p; p = recurse ? next_mnt(p, mnt) : NULL) {
1525                if (!p->mnt_group_id && !IS_MNT_SHARED(p)) {
1526                        int err = mnt_alloc_group_id(p);
1527                        if (err) {
1528                                cleanup_group_ids(mnt, p);
1529                                return err;
1530                        }
1531                }
1532        }
1533
1534        return 0;
1535}
1536
1537/*
1538 *  @source_mnt : mount tree to be attached
1539 *  @nd         : place the mount tree @source_mnt is attached
1540 *  @parent_nd  : if non-null, detach the source_mnt from its parent and
1541 *                 store the parent mount and mountpoint dentry.
1542 *                 (done when source_mnt is moved)
1543 *
1544 *  NOTE: in the table below explains the semantics when a source mount
1545 *  of a given type is attached to a destination mount of a given type.
1546 * ---------------------------------------------------------------------------
1547 * |         BIND MOUNT OPERATION                                            |
1548 * |**************************************************************************
1549 * | source-->| shared        |       private  |       slave    | unbindable |
1550 * | dest     |               |                |                |            |
1551 * |   |      |               |                |                |            |
1552 * |   v      |               |                |                |            |
1553 * |**************************************************************************
1554 * |  shared  | shared (++)   |     shared (+) |     shared(+++)|  invalid   |
1555 * |          |               |                |                |            |
1556 * |non-shared| shared (+)    |      private   |      slave (*) |  invalid   |
1557 * ***************************************************************************
1558 * A bind operation clones the source mount and mounts the clone on the
1559 * destination mount.
1560 *
1561 * (++)  the cloned mount is propagated to all the mounts in the propagation
1562 *       tree of the destination mount and the cloned mount is added to
1563 *       the peer group of the source mount.
1564 * (+)   the cloned mount is created under the destination mount and is marked
1565 *       as shared. The cloned mount is added to the peer group of the source
1566 *       mount.
1567 * (+++) the mount is propagated to all the mounts in the propagation tree
1568 *       of the destination mount and the cloned mount is made slave
1569 *       of the same master as that of the source mount. The cloned mount
1570 *       is marked as 'shared and slave'.
1571 * (*)   the cloned mount is made a slave of the same master as that of the
1572 *       source mount.
1573 *
1574 * ---------------------------------------------------------------------------
1575 * |                    MOVE MOUNT OPERATION                                 |
1576 * |**************************************************************************
1577 * | source-->| shared        |       private  |       slave    | unbindable |
1578 * | dest     |               |                |                |            |
1579 * |   |      |               |                |                |            |
1580 * |   v      |               |                |                |            |
1581 * |**************************************************************************
1582 * |  shared  | shared (+)    |     shared (+) |    shared(+++) |  invalid   |
1583 * |          |               |                |                |            |
1584 * |non-shared| shared (+*)   |      private   |    slave (*)   | unbindable |
1585 * ***************************************************************************
1586 *
1587 * (+)  the mount is moved to the destination. And is then propagated to
1588 *      all the mounts in the propagation tree of the destination mount.
1589 * (+*)  the mount is moved to the destination.
1590 * (+++)  the mount is moved to the destination and is then propagated to
1591 *      all the mounts belonging to the destination mount's propagation tree.
1592 *      the mount is marked as 'shared and slave'.
1593 * (*)  the mount continues to be a slave at the new location.
1594 *
1595 * if the source mount is a tree, the operations explained above is
1596 * applied to each mount in the tree.
1597 * Must be called without spinlocks held, since this function can sleep
1598 * in allocations.
1599 */
1600static int attach_recursive_mnt(struct vfsmount *source_mnt,
1601                        struct path *path, struct path *parent_path)
1602{
1603        LIST_HEAD(tree_list);
1604        struct vfsmount *dest_mnt = path->mnt;
1605        struct dentry *dest_dentry = path->dentry;
1606        struct vfsmount *child, *p;
1607        int err;
1608
1609        if (IS_MNT_SHARED(dest_mnt)) {
1610                err = invent_group_ids(source_mnt, true);
1611                if (err)
1612                        goto out;
1613        }
1614        err = propagate_mnt(dest_mnt, dest_dentry, source_mnt, &tree_list);
1615        if (err)
1616                goto out_cleanup_ids;
1617
1618        br_write_lock(vfsmount_lock);
1619
1620        if (IS_MNT_SHARED(dest_mnt)) {
1621                for (p = source_mnt; p; p = next_mnt(p, source_mnt))
1622                        set_mnt_shared(p);
1623        }
1624        if (parent_path) {
1625                detach_mnt(source_mnt, parent_path);
1626                attach_mnt(source_mnt, path);
1627                touch_mnt_namespace(parent_path->mnt->mnt_ns);
1628        } else {
1629                mnt_set_mountpoint(dest_mnt, dest_dentry, source_mnt);
1630                commit_tree(source_mnt);
1631        }
1632
1633        list_for_each_entry_safe(child, p, &tree_list, mnt_hash) {
1634                list_del_init(&child->mnt_hash);
1635                commit_tree(child);
1636        }
1637        br_write_unlock(vfsmount_lock);
1638
1639        return 0;
1640
1641 out_cleanup_ids:
1642        if (IS_MNT_SHARED(dest_mnt))
1643                cleanup_group_ids(source_mnt, NULL);
1644 out:
1645        return err;
1646}
1647
1648static int lock_mount(struct path *path)
1649{
1650        struct vfsmount *mnt;
1651retry:
1652        mutex_lock(&path->dentry->d_inode->i_mutex);
1653        if (unlikely(cant_mount(path->dentry))) {
1654                mutex_unlock(&path->dentry->d_inode->i_mutex);
1655                return -ENOENT;
1656        }
1657        down_write(&namespace_sem);
1658        mnt = lookup_mnt(path);
1659        if (likely(!mnt))
1660                return 0;
1661        up_write(&namespace_sem);
1662        mutex_unlock(&path->dentry->d_inode->i_mutex);
1663        path_put(path);
1664        path->mnt = mnt;
1665        path->dentry = dget(mnt->mnt_root);
1666        goto retry;
1667}
1668
1669static void unlock_mount(struct path *path)
1670{
1671        up_write(&namespace_sem);
1672        mutex_unlock(&path->dentry->d_inode->i_mutex);
1673}
1674
1675static int graft_tree(struct vfsmount *mnt, struct path *path)
1676{
1677        if (mnt->mnt_sb->s_flags & MS_NOUSER)
1678                return -EINVAL;
1679
1680        if (S_ISDIR(path->dentry->d_inode->i_mode) !=
1681              S_ISDIR(mnt->mnt_root->d_inode->i_mode))
1682                return -ENOTDIR;
1683
1684        if (d_unlinked(path->dentry))
1685                return -ENOENT;
1686
1687        return attach_recursive_mnt(mnt, path, NULL);
1688}
1689
1690/*
1691 * Sanity check the flags to change_mnt_propagation.
1692 */
1693
1694static int flags_to_propagation_type(int flags)
1695{
1696        int type = flags & ~(MS_REC | MS_SILENT);
1697
1698        /* Fail if any non-propagation flags are set */
1699        if (type & ~(MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE))
1700                return 0;
1701        /* Only one propagation flag should be set */
1702        if (!is_power_of_2(type))
1703                return 0;
1704        return type;
1705}
1706
1707/*
1708 * recursively change the type of the mountpoint.
1709 */
1710static int do_change_type(struct path *path, int flag)
1711{
1712        struct vfsmount *m, *mnt = path->mnt;
1713        int recurse = flag & MS_REC;
1714        int type;
1715        int err = 0;
1716
1717        if (!capable(CAP_SYS_ADMIN))
1718                return -EPERM;
1719
1720        if (path->dentry != path->mnt->mnt_root)
1721                return -EINVAL;
1722
1723        type = flags_to_propagation_type(flag);
1724        if (!type)
1725                return -EINVAL;
1726
1727        down_write(&namespace_sem);
1728        if (type == MS_SHARED) {
1729                err = invent_group_ids(mnt, recurse);
1730                if (err)
1731                        goto out_unlock;
1732        }
1733
1734        br_write_lock(vfsmount_lock);
1735        for (m = mnt; m; m = (recurse ? next_mnt(m, mnt) : NULL))
1736                change_mnt_propagation(m, type);
1737        br_write_unlock(vfsmount_lock);
1738
1739 out_unlock:
1740        up_write(&namespace_sem);
1741        return err;
1742}
1743
1744/*
1745 * do loopback mount.
1746 */
1747static int do_loopback(struct path *path, char *old_name,
1748                                int recurse)
1749{
1750        LIST_HEAD(umount_list);
1751        struct path old_path;
1752        struct vfsmount *mnt = NULL;
1753        int err = mount_is_safe(path);
1754        if (err)
1755                return err;
1756        if (!old_name || !*old_name)
1757                return -EINVAL;
1758        err = kern_path(old_name, LOOKUP_FOLLOW|LOOKUP_AUTOMOUNT, &old_path);
1759        if (err)
1760                return err;
1761
1762        err = lock_mount(path);
1763        if (err)
1764                goto out;
1765
1766        err = -EINVAL;
1767        if (IS_MNT_UNBINDABLE(old_path.mnt))
1768" class="line" name=goto (<;
1769
1770        if (!check_mnt(path->mnt) || !check_mnt(old_path.mnt))
1771                goto (<;
1772
1773        err = -ENOMEM;
1774        if (recurse)
1775                mnt = copy_tree(old_path.mnt, old_path.dentry, 0);
1776        else
1777                mnt = clone_mnt(old_path.mnt, old_path.dentry, 0);
1778
1779        if (!mnt)
1780                goto (<;
1781
i_mode))
err = lock_mount(struct old_path.16837err)
16847       if (osref">br_write_unlockvfsmount_lock);
16857               return -umount_list);
, o0sref">old_path);
);
16867chunlock(vfsmount_lock);
16877       return 16887
16897err = 16907span class="comment">/*
79class="sref">LIST_HEAD(old_path);
);
16917span class="comment"> * S7nity 79>retry:
16927span class="comment"> */<7span>79"sref">err = pathold_path);
16937er>err;
16947tatic int 16957
16967       int do_loopbackvfsmount *mnt, struct do_loopback1697716987       /*7Fail if any nor = 16997       if (ty>recurse)
17008               return 0;
8a hre80="L1641" class="line" name="L1648">17018       /*8Only one propat->MS_REC;
17028       if (!LIST_HEAD(8 a href="fs/namespace.c#L8a hre80ass="sref">err)
lock_mount_classis_readonlyf="fs/namespace_classis_readonlyass=">, 17048       return o" id="L1704" class="line" name="L1708">17058
17068>)
8mnt = , 8<      17098span class="comment"> */<8span>80" class="sref">err = 17108tatic int >err;
17018
17128       struct 17138       int 17148       int 17158       int 
retonamereref">mn="L1746" class="line" name="L1748">170688       if (!17188               return -lock_mountdo_reref">"fs/namespace.c#o_reref">pathvfsmount *path, int flag)
do_loopback17198err, int 17208       if (17218               return - = 17228vfsmount *mnt;
mnt_sb->17138       17248       if (!type)
CAP_SYS_ADMIN))
17258               return -EINVAL;
1726817278       capable(path->mnt) || !17188       if ((EINVAL;
17298               17308               if (path->dentry != path->mnt->mnt_root)
17218                       go8o EINVAL;
17328       }
17338err = -EN/a>, int "fs/namespace.c=75" ityss=_reref">path->17248       type>)
17258       for (EI> = 17368               17378       br_write_(&namespace_s="+code=s_flags" s="sref">s_flags & "fs/namespace.c=" id7758" class="line" name="L1758">17188type == MREC;
17298err = invent_gde=m" cl#L175a href="+code=MS_RECde=m" cl#L175a hrepath->mnt->17408       u"L1777" class="line" name="L1778">17418       return  = invent_g#o_reref">f="+code=s_flags" #o_reref">f="path->17428
is_power_ofnamespace.c#L1764" id="L171729" class="line" name="L1728">17438is_power_ofunlockvfsmount_lock);
17448span class="comment">/*
84ex_unlock" class="sref">mutex_unlock<175a href="+code=MS_RECm175a hrepath |h->mnt->mnt_root)
MREC;
17458span class="comment"> * d8 loop84code=ENOENT" class="s">umount_listmnt->mnt_root)
, 17368span class="comment"> */<8span>84nge_mnt_propagation" class="sref">chunlock(vfsmount_lock);
17478tatic int 17488                         8     84"sref">err = namespace_s="+code=s_flags" s="sref">s_flags & "fs/namespace.c=" id7758" class="line" name="L1758">17498
mnt)
17508       is_power_ofunlockvfsmount_lock);
17518       struct  = ->mnt->mnt_root)
17528       struct LIST_HEAD((vfsmount_lock);
17538       int er743" class="line" name="L1748">17548       if (erref">EI> = 17558               return 17568       if (!17578               return -vfsmount *mnt, struct 17588       17498       if (ersref">vfsmount *mnt, struct 17608               return  = m; m, NU71729" class="line" name="L1728">17618IS_MNT_UNBINDABLE(old_path.17628       sref">erref">EI1716" class="line" name="L1718">17638       if (er743" class="line" name="L1748">17648               goto erref">EI1704" class="line" name="L1708">1765817668       17678       if (do_loopback(movetruct vfsmount *path, char *old_name,
17588ss="line" name=goto 17698ersref">vfsmount *old_path;
17708       if (!vfsmount *mnt, struct 17718               goto  = 17728is_power_ofef="+code=CAP_SYS_ADMIN" class="sref">CAP_SYS_ADMIN))
17738       EINVAL;
17748       if (reold_name || !*old_name)
17758               mntEINVAL;
17768       else
err = -EI> = -old_name, LOOKUP_FOLLOW|old_path);
17778               IS_MNT_namespace.c#L1764" id="L1758" class="line" name="L1758">17788(EI> = 17798       if (!17808               goto LIST_HEAD(lock_mount(path);
17818ut;
1683816848       if ((;
16858               return -capable(path->mnt) || !check_mnt(old_path.mnt))
16868;
17778       return 16888
type == ->mnt) || !p1771" class="line" name="L1778">17798err;
16908span class="comment">/*
89="L1641" class="line" name="L1648">16918span class="comment"> * S8nity 891=out" class=LIST_HEAD(;
16928span class="comment"> */<8span>89er_of_2" class="sld_path.mnt))
path->mnt))
mnt_root)
16938;
16848tatic int 16858
c/a>->mnt))
lock_mounthref="+code=mnt" class="sref">mnt))
mnt_root)
16868       int ;
1697816988       /*89lass="sref">type == ->mnt) || !pnt) || !pnt) || !17798       if (err == ->mnt))
pnt) || !pnt) || !17009               return 0;
9a hre90e=out>(17019       /*9Only one propa="fs/namespace.c#L1745" id="L1745" class="line" name="L1749">17029       if (!9 a href="fs/namespace.c#L9a hre90" cla="fs/namespace.c#L1745777777777* id="L1747" class="line" name="L1749">17049       return re>lock_mounthref="+code=mnt" class="sref">mnt))
mnt_root)
oef">o47" class="line" name="L1749"517049 mn="sref">IS_MNT_UNBINDAa href="fs/namespace.UNBINDAa hrefef">old_path.mnt))
mnt_root)
9       int ;
99<      m="L1745" class="line" name="L1749"917069<      if (17109tatic int 17019
->old_path.mnt) || !oef">o47" class="line" name="L1749">17129       struct .mnt))
17139       int ;
17149       int (;
9       int m = mnt) || !mnt_root)
mnt_root)
9->lock_mounthref="+code=mnt" class="sref">mnt))
9       if (!mnt;
9               return -17199err = lock_mountattach_775" iivef="+code=old_path" attach_775" iivef="+path.mnt))
old_path);
17209       if (path->17219               return -(1722917139       err"fs/namespace.c#L1745" paththoce.c#L iscmoved, it espace.nmespnger.c#Lexpireid="L1747" class="line" name="L1749">17249       if (!17259               return -lock_mount(ist_del_ini"+code=path" clasist_del_ini"pathold_path);
mnt_root)
917279       br_write_(struct 17189       if (17199               mnt)
17309               if (is_power_ofhref="+code=path" class="sref">pathold_path);
17219                       go9o (pathold_path);
17329       }
EI> = 1733917249       17259       for (vfsmount *mnt, struct vfsmount *mnt, struct old_name,
9               17379       17189tconstsref">old_name,
EN/a>, int ."fs/namespac=tring">'.'id="L171759" class="line" name="L1759">17199err)
17409       (is_power_ofsubtypes/namespace.c#Lsubtypepath++759" class="line" name="L1759">17419       return  = ;
17429
nt)
17439(<;
17449span class="comment">/*
94ex_unlock" cl}u"L1777" class="line" name="L1779">17459span class="comment"> * d9 loop94code=ENOENT" class="s">umount_listEN/"fs/namespac=tring">""id="L17704" class="line" name="L1709"617049span class="comment"> */<9span>94="L1727" class="line" name="L1729">17479tatic int br_write_namespace.c#L1713" id="L1">mnt_sb->s_flags & EN/a>, int .old_path.17489                         9     94"sref">err = ENOMEM;
17499
mnt)
mnt_sb->s_flags & 17509       (<;
17519       struct EI> = 17429       struct 17539       int 17549       if ((.17559               return EI> = .9       if (!17579               return -17589       vfsmount *mnt17499       if ((classruct "srefconstsref">old_name,
flag)
old_name,
, int 17609               return 17619vfsmount *, struct EN/a>, int .17629       vfsmount *mnt, struct 17539       if (err)
17549               goto ercode=outref">EI> = ;
17559lock_mount/namespace.c#L1771" id="L="vfsmount *.old_path.9       a>)
.oef">o/a>)
s_flags &f MS_REC;
oef">o04" class="line" name="L1709">17579       if (mna>)
mnt_sb->s_flags & 17589ss="line" name=goto lock_mount/namespace.c#L1771" id="L="vfsmount *, struct 17499err = .17709       if (!>err;
17719               goto 17729;
.17539       17749       if (17759               9       else
17779               do_loopback(addsruct vfsmount *mnt, struct vfsmount *path, int flag)
1778917799       if (!ty>recurse)
17809               goto 17819(< hrea href="+code=MS_RECm175a hrepath ref">= ~fld_path. |MREC;
 |MREC;
16839err = -EN/a>, int path);
16849       if (->16859               return -EI> = 1686917779       return br_write_ode=invent_group_ids" class=NVAL;
16889
type, struct MREC;
(oef">o/apable(path->mnt) || !17799err;
16909span class="comment">/*
99="L1641" class="line" name="L1649">16919span class="comment"> * S9nity 99nly one propa="fs/namespace.c#L1745"  Refusehthocst">hfilesystemmonhthocst">he.c#L poy>re" id="L1747" class="line" name="L1749">16929span class="comment"> */<9span>99er_of_2" classref">br_write_ode=invent_group_ids" class=NVAL;
16839err->mnt) || !mnt_sb->lock_mountnew"+code=m" class="srewass="sr">mnt_sb->oef">o04" class="line" name="L1709">16849tatic int ercode/a>->mnt) || !mnt_sb->lock_mount="+code=mnt" class="sref">mnt) || !p104" class="line" name="L1709">16859
(16869       int 16979br_write_ode=invent_group_ids" class=NVAL;
16989       /*99lass="sref">type == ->mnt_sb->pnt) || !17799       if (err<"sut;
170017   if (1>20">"L1727/pre>1>8" class="line" name="L1720"11700 * 20"pa>20"1=out" class=LIST_HEAD(mnt_sb->,  */20"pa>20"er_of_2" classref">br_write_ode=invent_group_ids" class=/a>, int ->old_path.20"="L1744" class="line" name="L1720"4170020"4r_ofMEM;
(20"code=EINVAL" >lock_mount(struct 20"me" class="srref">EI> = 20"7="L1743" class="line" name="L1720"8170020"="L1779" class="line" name="L1720"9170020"" cla="fs/namespace.c#L1708" id="L1745" class="line" name="L17201>1700 =username= andrrequest it 20t1k mount.
20ter_of="fs/namespace.c#L17087" id="L1747" class="line" name="L1720t31700do_loopback(rewsruct vfsmount *path, char *old_name,
olag)
20tass="sref">ercode=out"sref">tyag)
old_name,
, int 20t5sref729" class="line" name="L1720t61700vfsmount *mnt, struct 20tlock" class="r = 20tlass="sref">mnt)
20  ode=ENOENT" class="sref">EINVAL;
20 er_of_2" class"fs/namespace.c#L1745"  wecreed N" clilities...7" id="L1747" class="line" name="L1720231700err)
CAP_SYS_ADMIN))
20 ass="sref">ercode=outref">EINVAL;
20 "sref">err = - *,
o/a>)
20 UNBINDABLE" class="sref">IS_MNT_IS_ERR"fs/namespace.cIS_ERR"srefld_path.20 e=out>(EI> = .20 ="L1770" class="line" name="L17203>170020  r_of_2" classref">br_write_ode=invent_group_ids" class=/a>, int (addsruct old_path.20 er_of_2" clas="sref">LIST_HEAD(.20 ass="sref">erref">EI> = 20 4="L1743" class="line" name="L172035170020 "sreflag)
vfsmount *mnt, struct vfsmount *path, char *20 7sref729" class="line" name="L1720381700ty = 20 9sref">err"fs/namespace.c#L1745"  Thecrewhe.c#L record espace.have at least 2 refsetonprevent it beingid="L1747" class="line" name="L17204>170020 1k mount.
20 er_of_2" classref">br_write_BUG_Ohref="fs/namespaBUG_Oh"srefld_path..20 ="L1744" class="line" name="L1720441700/*<20spa>20 e=out" class=ath->mnt_sb->lock_mount="+code=mnt" class="sref">mnt) || !mnt_sb->oef">o04" class="line" name="L1720 51700 * 20spa>20 " class="sref">mn="sref">IS_MNT_dold_path" class=d="L">mnt_sb->lock_mount="+code=mnt" class="sref">mnt) || !p11729" class="line" name="L1720 61700 */20spa>20 nge_mnt_propagation" sref">br_write_ode=invent_group_ids" class=NVAL;
20 " class="sref">mnt;
t743" class="line" name="L172049170020  r_of_2" classref">br_write_ode=invent_group_ids" class=/a>, int (addsruct .mnt) || !mnt_sb->(20 nly one propat)
20 er_of_2" clas="sref">ref">EI1716" class="line" name="L1720 3170020 e=out" class=L"fs/namespace.c#L1745"  remove m from anyLexpir">m20 code=ENOENT" f">capable(old_path);
mnt_sb->20 nge_mnt_propagation" sref">br_write_down_writfold_path);
mnt);
__20 e=out>(old_path);
mnt_sb->20 " class="sref">err<"sld_path);
(__err<"sld_path);
old_path);
20 nly one propa743" class="line" name="L1720621700br_write_cla"+code=path" classcla"+c"srefld_path.20 "sref">err = -.EI> = 20 5="L1743" class="line" name="L172066170020 7k mount.
20 ail i="fs/namespace.c#L17087* classe21expiry - Put ace.c#L m20 " cla="fs/namespace.c#L17087* @cla: Thece.c#L so sist id="L1746" class="line" name="L17207>170020 er_of="sre_sb->vfsmount *mnt, struct osref">vfsmount *20 3sref729" class="line" name="L1720741700(old_path);
20 code=EINVAL" >lock_mountbr_writf___20 ="L1727" class="line" name="L1720771700br_write_sist_addstailold_path);
mnt_root)
)
20 ="L1779" class="line" name="L1720791700err = (.__err = old_path);
20 d="L1743" class="line" name="L1720 21700.20 ="L1744" class="line" name="L1720841700rs with thecy>rent ofndiscarding anyid="L1745" class="line" name="L1720 61700rs that aren't in=use andrhaven't been souched sinceelast we cameid="L1745" class="line" name="L172087170020 ail i="fs/namespace.c#L17087* id="L1747" class="line" name="L1720891700->vfsmount */*<20spa>20spsref729" class="line" name="L1720911700 * 20spa>20sef="+code=outlaef">vfsmount *mnt, struct oa>, struct  */20spa>20ser_of_2" classref">br_write_LIST_HEAf="fs/namespace.LIST_HEAf"srefld_path.20s"sref">err = -.20s_prop58" class="line" name="L1720s51700cpable(, struct 20snge_mnt_propagation" ref">E758" class="line" name="L172097170020s"sref">err = old_path);
20s9sref">err = .__170017   if (1>210="L1641" class="line" name="L1621011700 * 21"pa>210nly one propa="fs/namespace.c#L1745"  exsra">vfrom thecexpir">m that matchesnthoid="L1745" class="line" name="L1721"21700 */21"pa>210er_of="fs/namespace.c#L1708777777777* following critfria:id="L1745" class="line" name="L1721"3170021"="L17="fs/namespace.c#L1708777777777* - only referenced by irs ="rlas ="sref">mn="L1745" class="line" name="L1721"41700210 href="fs/namespace.c#L1745 77777777* -tlaill car ed a> =expiry (car ed onhthoclast =allchere; car s aremn="L1745" class="line" name="L1721"51700210ck mount.
210a href="fs/namespace.c#L174777777777* id="L1747" class="line" name="L1721"71700210lock" class="sref">br_write_sist_for1each_="sre_saff.o>, struct )
)
210e=out>(capable(old_path);
mnt_root)
210" class="sref">err<"s class="sref">br_write_propagatf_ref">_bus+code=path" claspropagatf_ref">_bus+"srefld_path.o17745" class="line" name="L16211>1700err<"ssssssssscontinue758" class="line" name="L1721111700 = old_path);
mnt_root)
old_path);
211er_of_2" clas743" class="line" name="L1721t31700errcapable(old_path);
21tass="sref">ercode=outld_path);
old_path);
osref">vfsmount *mnt)
211code=ENOENT" class="s">umount_list_ne" name=s/namespace.c#Lsouchef">_ne" name="srefld_path.mnt_root)
211nge_mnt_propagation" sref">br_write_ucass=_srees/namespace.c#Lucass=_sree"srefld_path.o1sref">old_path);
21tlock" class="743" class="line" name="L1721t81700211"sref">err = (.__2119sref">err = old_path);
212="L1641" class="line" name="L1621 117002121=out" class=LIST_HEAD(s+code=s_flags" releasf_ref">spathold_path);
21 er_of743" class="line" name="L17212317002124r_ofMEM;
.212a href="fs/namespace.c#L174" id="L1745" class="line" name="L1721 71700212ail i="fs/namespace.c#L17087*id="L1745" class="line" name="L1721 9170021 er_ofclass="sref">do_loopbackvfsmount *mnt, struct osref">vfsmount *21ass="7g14" class="1ine" name="L1720341700vfsmount *mnt, structthis_sref">a>);
mnt, struct osref">vfsmount *oa>, struct vfsmount 2 hrfa>);
ref">EI1718" class="1ine" name="L17203717002121=opea"sref">oa>, stru=opea"="fsfail2119ss="sref">oa>, struct mnt, structthis_sref">a>);a de=old_path" class="sr"srexs="srsr/a>)
);.href="+code=sisss="sref">oa>, struct 2119ss="sref">oa>, struct mnt, structthis_sref">a>);a de=old_path" class="sr"srexs="srsr/a>)
);fs/namespace.graveyardpath111727" class="1ine" name="L1720421700osref">vfsmount *oa>, struct vfsmount *mnt, struct , int , structtmpa hr"fs/namespace.graveyardpath>osref">vfsmount *vfsmount srefc+cofags" car class=s_for1expirypath7754" class="1ine" name="L1720441700 *espace.c#212119ss="sref">oa>, struct , structtmpa hra de=old_path" classss="sref">oa>, struct  */20sace.c#91689"98lass="srefame="srefld_path.MREC;
(err<"ssssssssscontinue758" class="1ine" name="L1720 81700212"""""""""""""""""* Descenunt.levelsace7* sdsruct semove ms non-t_emphon'graveyard' sist id="L1740" class="1ine" name="L17205>1700
20 code=ENOENT" f">capable();ffs/namespace.graveyardpath111725" class="1ine" name="L1620 21700 *espace.c#212119this_sref">mnt, structthis_sref">a>);
mnt, struct 20 " class="sref"=opea"sref">oa>, stru=opea"="fshref="+code=path" class="sr716" class="1ine" name="L162054170021 er_of747" class="1ine" name="L172055170021 5"L1779" class="1ine" name="L1720561700br_write_propagatf_ref">_bus+code=path" claspropagatf_ref">_bus+"srefld_path. *espace.c#212119"+csist_mss="sref">br_write_sist_ast_mss="soveold_path);
mnt_root)
old_path);
 *espace.c#2121192 hrf">vfsmount 2 hrfa>);++fs/namespace.graveyardpath1758" class="1ine" name="L1720591700 * 21"pa>210nly one prmount.
 */21"pa>210er_of="fs/nAll 20">ewhethis.levels1745ascenuntacrewsu cfusehta="fsmount.
21"="L17="fs/ mount.
mnt, structthis_sref">a>);
!mnt, struct  *espace.c#212119ss="sref">oa>, struct mnt, structthis_sref">a>);a de=old_path" class="src+cof">vfsmount srefc+cofags".href="+code=sisss="sref">oa>, struct 211nge_mnt_pthis_sref">mnt, structthis_sref">a>);
mnt, structthis_sref">a>);a de=old_path" class="srsref">mnt, struct="srsref">a hrnexcode=m" class="srexs="sr713" class="1ine" name="L1720 7170020 lass="sref">t715" class="1ine" name="L172069170020 e=out" c2 hrf">vfsmount 2 hrfa>);nexcode=m" class="srexs="sr716" class="1ine" name="L17207>170020 lass="sref">t716" class="1ine" name="L172071170020 1"L1717" class="1ine" name="L1720721700 */21"pa>210prmount.
21"=k mount.
rs with thecy>rent ofndiscarding anyid="L1719" class="1ine" name="L1720741700210 *espace.c#L1.c#a specific7* - onlrocess acshecy>rent ofndiscarding anyid="L1719" class="1ine" name="L172075170020 ckhecy>rent ofndiscarding anyid="L1719" class="1ine" name="L1720761700_rent ofndiscarding anyid="L1719" class="1ine" name="L1720771700do_loopbackdoe=s_flags" select_sublass=spathvfsmount *mnt, struct osref">vfsmount *old_path);

br_write_LIST_HEAf="fs/namespace.LIST_HEAf"srefld_path. * 20spa>20sef="+code=outlaef">vfsmount *mnt, strua>);nexcode=m" class="srexs="sr713" class="1ine" name="L1720 21700 */21"pa>210propa="fs/nspace.c#L1.c#ass=srocess acsass=s amespace.c#L1745"  exsra"k mount.
2119fclass="sref">do_loopbackmnt, struct old_path);
 *espa"+cod21   >211"sref">errcapable(old_path);
20  sf">mnt, strua>);
old_path);
osref">vfsmount * *espa/namespace.c#21<    goto 20  sref">mnt)
 *espace.c#212119NT" class="s">umount_list_ne" name=s/namespace.c#Lsouchef">_ne"f">mnt, strua>);a de=old_path" class="sref"ef">mnt_root)
210" class="sref">erropagation" sref">br_write_ucass=_srees/namespace.c#Lucassf">mnt, strua>);a de=href="+code=sis>spathold_path);
20 lass="sref">t719" class="1ine" name="L172091170020 nly one propa714" class="1ine" name="L172092170021 er_of748" class="1ine" name="L172093170020  href="fs/namespace.c#L1745" id="L1718" class="1ine" name="L1720s5170020 ck Some copy_ames_fs/n() imple  >245"  s do not= 20 a hbytesss=Lain witto copylasse fault.  But copy_ucass=op5"  s() ewhexpimespachon'graveyard' sist id="L1748" class="1ine" name="L1720971700mm20 ail  ebad valueL1.c#`toass=s, 745her1r">n= 212"  mount.
1700172  if ( href="lowithref="+code=sisc#fs/_copy_ames_fs/nef">old_patha>);a c  st"/namespace.c#202__fs/nef">old_path20 e=out" c2mes">vfsmount 2mesf="+cnamespace.graveyardpath111721" class="2ine" name="L1621011700oa>, strucass=s/span>
);
a>);ef="+code=MS_RECm175ns="L17725" class="2ine" name="L1721"41700old_path20 e=out" c2">vfsmount 2a>);
vfsmount 2mesf="+ef="+code=MS_RECm175ns="L177255 class="2ine" name="L1720s51700vfsmount cf="+ef="+code=MS_RECm175ns="L177256 class="2ine" name="L1620961700eracnt.<_old_path.br_wriVERIFY_R" cres/nace.c#L1721expir2mes">vfsmount 2mesf="+cthref="+code=sisnsref">oa>, strucass=ss/span>
20 e=out" cnsref">oa>, strucass=ef="+code=MS_RECm175ns="L177259 class="2ine" name="L17209917002119ssref">oa>, strucass=ss/namespace.graveyardpath111728" class="2ine" name="L1721111700old_pathvfsmount cf="+nace.c#L1721expir2">vfsmount 2a>);"fs/namespace.graveyardpath111728" class="2ine" name="L1721t21700 *espace.c#212119memseef">mnt, struemseees/namespace.c#Lucasat_list);, 0cthref="+code=sisnsref">oa>, strucass=sef="+code=MS_RECm175ns="L17723" class="2ine" name="L1721t3170021 er_of728" class="2ine" name="L1721t51700);++
vfsmount cf="+ef="+code=MS_RECm175ns="L17728" class="2ine" name="L1721t61700vfsmount 2a>);++fs/namespace.graveyardpath1728" class="2ine" name="L1721t7170020 " class="nsref">oa>, strucass=--fs/namespace.graveyardpath17288 class="2ine" name="L1721t8170020 lass="sref">t728" class="2ine" name="L172119170020 e=out" cnsref">oa>, strucass=ef="+code=MS_RECm175ns="L17728" class="2ine" name="L17212>170020 lass="sref">t721" class="2ine" name="L1621 1170020 1"L1728" class="2ine" name="L1721221700copy_ucass=op5"  s">vfsmount copy_ucass=op5"  ses/nac  st"/namespace.c#202__fs/nef">old_path20 e=out" cdataef">old_path);, unsigned"lowitode=old_name" clwy (cef">old_path
21ass="7g24" class="2ine" name="L1721 41700old_pathold_pathold_path20s="L1625" class="2ine" name="L1721 81700old_pathref">EI1725" class="2ine" name="L1721 91700211"sref">erdataef">old_path);s/span>
20 er_of_2" clas="sref">ref">EI1726" class="2ine" name="L172131170020 1"L1727" class="2ine" name="L1721321700old_pathold_path;
);"fs/span>
20 ede=invent_group_iNOMEMa>;
20s_prop23" class="2ine" name="L1720351700 */21"pa>210proWemespaccareir">m<*some* dataewhethe* @ert.
210a href="fs gave*fs ms valid.  Jus#3irefase, weass=sll zeroesunt.
2127 href="fs the*s=Lainder1.c the*pagchon'graveyard' sist id="L1729" class="2ine" name="L172038170020 a href="fs mount.
 */21"pa>210procopy_ames_fs/nefannot=cro.
old_pathold_path211"sref">erdataef">old_path);ef="+code=MS_RECm175ns="L17727" class="2ine" name="L1720411700old_pathold_path);s/span>
20  sizcef">old_pathold_path);ef="+code=MS_RECm175ns="L17727" class="2ine" name="L172043170020 eief">old_pathold_pathold_patherpagcef">old_pathold_path);, namespace.c#L17sizcef">old_path211"sref">erief">old_path */20sce.c#L1721expir2mee_pagcef">old_pathold_path20 ede=invent_group_iFAULTa>;
);ef="+code=MS_RECm175ns="L17727" class="2ine" name="L1720 8170020 lass="sref">t723" class="2ine" name="L172049170020 eief">old_pathold_path);s/span>
mnt, struemseees/na(f="+co)  >211"sref">erpagcef">old_pathold_pathold_path);
-thref="+code=sisief">old_pathold_pathold_pathref">EI1726" class="2ine" name="L1720 3170020 lass="sref">t726" class="2ine" name="L1620541700copy_ucass=strincodef">capable2__fs/nef">old_pathold_path);, f="+coode=old_name" clwy (cef">old_path
, structtmpa hr_of_2" clas="sref">ref">EI1726" class="2ine" name="L1720581700erdataef">old_path);ss/namespace.graveyardpath111728" class="2ine" name="L17206>1700old_pathref">EI1728" class="2ine" name="L1720611700ref">EI1723" class="2ine" name="L1720621700212="L1728" class="2ine" name="L1720641700old_pathold_path);, namespace.c#L17PAGE_SIZEef">old_path);s_of_2" clas="sref">ref">EI1723" class="2ine" name="L1720651700old_path, structtmpa hrfs/span>
20 e=out" cPTR_ERRef">old_path, structtmpa hrf_of_2" clas="sref">ref">EI1723" class="2ine" name="L1720 71700old_path, structtmpa hr_of_2" clas="sref">ref">EI1725" class="2ine" name="L1720691700ref">EI1726" class="2ine" name="L17207>170020 lass="sref">t726" class="2ine" name="L172071170020 1"L1727" class="2ine" name="L1720721700 */21"pa>210prmount.
21"=k F=ea  ms a 32-bit valueespace.espas uptto 31 non-fs depend onlf=ea  toesunt.
210 *ebethecsis7087* sucass()=expir(ie:= 20 a hdataems a a"+f="+)espacecmess acss708anyfs/nameure upttohecy>rent ofndiscarding anyid="L1729" class="2ine" name="L1720771700rent ofndiscarding anyid="L1729" class="2ine" name="L172078170020 ailinform45"  e(orebetNUL/)hon'graveyard' sist id="L1729" class="2ine" name="L1720791700 */21"pa>210e*s708thats7* suagf="/aluee0xC0EDss=s athis.s=Lain ando assil 2.4.0-test9hon'graveyard' sist id="L1728" class="2ine" name="L172083170021"=k Tmounfore,sace7*is.uagf="number1is.preselassicecmrries nolinform45"  on'graveyard' sist id="L1728" class="2ine" name="L1720841700vfsmountdo_>osrees/nac="+code=old_name" cldevme=s/f">vfsmountdevme=s/a>);, f="+code=old_name" cldirme=s/f">vfsmountdirme=s/a>);, f="+code=old_name" cltype_pagcef">old_path);,/span>
unsigned"lowithref="+code=sis>type, struct old_path
old_pathold_pathref">EI1725" class="2ine" name="L16209>1700 old_pathref">EI1729" class="2ine" name="L1720911700type, struct ref">EI1729" class="2ine" name="L1720921700 */21"pa>210proDpoy>rs.uagf="k mount.
, struct );ss=;

, struct );_of_2" clas="sref">ref">EI1729" class="2ine" name="L1620961700 */21"pa>210proBasf="sanity f=ecks"k mount.
20 ="L1728" class="2ine" name="L1720991700211"sref">erdirme=s/f">vfsmountdirme=s/a>); || !ode=old_name" cldirme=s/f">vfsmountdirme=s/a>); || !  >20   class="memchnef">old_pathvfsmountdirme=s/a>);, 0cthref="+code=sisPAGE_SIZEef">old_path);fs/span>
17001730int ref">EI1731" class="3ine" name="L162101170020 1"L1735" class="3ine" name="L1721"21700old_path
211"sref">erdata_pagcef">old_pathold_path);
-t1]=ref">EI1735" class="3ine" name="L1721"41700 */21"pa>210pro1745as aget87* sucasss acssk mount.
 old_pathold_pathvfsmountdirme=s/a>);, mespace.c#LucasLOOKUP_FOLLOWf">vfsmountLOOKUP_FOLLOWa>);, " clas(ist_first_ef=pathef">old_pathref">EI1737" class="3ine" name="L1721"71700 old_path
20 e=out" c old_pathref">EI17379 class="3ine" name="L1720991700old_pathvfsmountsecurity_sb_>osrees/namespace.c#Lucasdevme=s/f">vfsmountdevme=s/a>);, " clas(ist_first_ef=pathef">old_path
old_path);,thref="+code=sis>type, struct 211"sref">erdata_pagcef">old_pathref">EI1738" class="3ine" name="L1721t21700old_path
20 " class="sref"dput_ouef">vfsmountdput_ouet.s=_of_2" clas="sref">ref">EI1733" class="3ine" name="L1721t41700 */21"pa>210proDefaults708relatime unlt.
type, struct old_path);fs/span>
type, struct old_pathref">EI17338 class="3ine" name="L1721t81700 */21"pa>210proSeparatts7* sper-ucasss acssf=ea  k mount.
type, struct br_wrieS_NOSUIct.s=s/span>
20 " class="="sr>type, struct br_wrieNT_NOSUIct.s=_of_2" clas="sref">ref">EI1738" class="3ine" name="L1721221700type, struct br_wrieS_NODEVt.s=s/span>
20 " class="="sr>type, struct br_wrieNT_NODEVt.s=_of_2" clas="sref">ref">EI1738" class="3ine" name="L1721 41700type, struct br_wrieS_NOEXECt.s=s/span>
type, struct br_wrieNT_NOEXECt.s=_of_2" clas="sref">ref">EI1738" class="3ine" name="L1721261700old_path);fof_2" clas="sref">ref">EI1738" class="3ine" name="L1721 7170020 " class="="sr>type, struct old_pathref">EI17388 class="3ine" name="L1721 81700type, struct old_path);fof_2" clas="sref">ref">EI1738" class="3ine" name="L1721 9170020 " class="="sr>type, struct old_pathref">EI1735" class="3ine" name="L17213>1700type, struct old_path);fof_2" clas="sref">ref">EI1736" class="3ine" name="L1721311700type, struct old_pathold_pathref">EI1737" class="3ine" name="L1721321700type, struct old_path);fof_2" clas="sref">ref">EI1736" class="3ine" name="L1721331700type, struct old_pathref">EI1735" class="3ine" name="L1720341700br_wrieS_NOSUIct.s= |dde=old_name" cleS_NOEXEClassref">br_wrieS_NOEXECt.s= |dde=old_name" cleS_NODEVlassref">br_wrieS_NODEVt.s= |dde=old_name" cleS_ACTIVEef">old_pathold_pathold_path); |dde=old_name" cleS_NODIRATIMEef">old_path); |dde=old_name" cleS_RELATIMEef">old_path;
 =MS_RECm175a hreS_STRICTATIMEef">old_path);f_of_2" clas="sref">ref">EI17358 class="3ine" name="L172038170020 e>type, struct ref">EI1737" class="3ine" name="L17204>170020   class=" old_pathvfsmountdo_re>osrees/na" clas(ist_first_ef=pathef">old_path20 e>type, struct 211"sref">erdata_pagcef">old_pathref">EI1737" class="3ine" name="L172042170020 e>type, struct br_wrieS_BINca>);fof_2" clas="sref">ref">EI1737" class="3ine" name="L1720431700old_pathold_path20 edevme=s/f">vfsmountdevme=s/a>);, "+cod20   >20 e>type, struct br_wrieS_RECt.s=s_of_2" clas="sref">ref">EI1737" class="3ine" name="L172044170020 e>type, struct br_wrieS_SHAREca>); |dde=old_name" cleS_PRIVATEef">old_path); |dde=old_name" cleS_SLAVEef">old_path); |dde=old_name" cleS_UNBINcABLEef">old_path);fs/span>
old_pathold_path20 e>type, struct ref">EI1737" class="3ine" name="L1720 6170020 e>type, struct old_path);fof_2" clas="sref">ref">EI1737" class="3ine" name="L1720 7170020 e old_pathvfsmountdo_>o_ms>osrees/na" clas(ist_first_ef=pathef">old_path20 edevme=s/f">vfsmountdevme=s/a>);s_of_2" clas="sref">ref">EI17378 class="3ine" name="L1720 81700ref">EI1737" class="3ine" name="L172049170020 " class=" old_pathvfsmountdo_news>osrees/na" clas(ist_first_ef=pathef">old_path20 etype_pagcef">old_path);,thref="+code=sis>type, struct 211"sref">ersref>type, struct 
erdevme=s/f">vfsmountdevme=s/a>);, "+cod20   >20 edata_pagcef">old_pathref">EI1738" class="3ine" name="L1720511700vfsmountdput_ouet.s=:of_2" clas="sref">ref">EI1738" class="3ine" name="L1620 21700vfsmountpath_puees/na" clas(ist_first_ef=pathef">old_pathref">EI1738" class="3ine" name="L1720 3170020 e=out" c old_pathref">EI1736" class="3ine" name="L162054170020 lass="sref">t737" class="3ine" name="L172055170020 lass="sref">t737" class="3ine" name="L1720561700umount_listmnt_rootref">EI1735" class="3ine" name="L1720571700umount_listmnt_rootref">EI1736" class="3ine" name="L1720591700mnt_rootmnt_rootumount_list20 eGFP_KERNE/a>;
);"_of_2" clas="sref">ref">EI1738" class="3ine" name="L1720611700mnt_rootref">EI1733" class="3ine" name="L1720621700old_path;
ref">EI1738" class="3ine" name="L172063170020  atomic_seef">mnt, stratomic_seees/na" clas(ist_first_ef=newsef"ef">mnt_rootvfsmountc href="+c 1"_of_2" clas="sref">ref">EI1738" class="3ine" name="L1720641700mnt_rootvfsmountrooet.s=
ref">EI1733" class="3ine" name="L172065170020 eINIT_r_of_2" classref">br_wriINIT_r_of_2" ces/na" clas(ist_first_ef=newsef"ef">mnt_rootmnt_rootref">EI1738" class="3ine" name="L1720661700init_waitqueueosref">vfsmount init_waitqueueosrefes/na" clas(ist_first_ef=newsef"ef">mnt_rootold_pathref">EI1738" class="3ine" name="L1720 71700mnt_rootvfsmounteveret.s=
ref">EI1733" class="3ine" name="L172068170020 e=out" cnewsef"ef">mnt_rootref">EI1735" class="3ine" name="L172069170020 lass="sref">t736" class="3ine" name="L17207>170020 lass="sref">t736" class="3ine" name="L17207117002 nammake_lowitersf">mnt, strunammake_lowiterses/nas> * 20spa>20sef="+code=outlaef">vfsmount *mnt, struct ref">EI1737" class="3ine" name="L1720721700mnt, str__ nammake_lowiterses/nade=mnt" class="sref">mnt, struct ref">EI1739" class="3ine" name="L172074170020 lass="sref">t739" class="3ine" name="L172075170020 lass="sref">t739" class="3ine" name="L1720761700mnt, strunammake_745rtterses/nas> * 20spa>20sef="+code=outlaef">vfsmount *mnt, struct ref">EI1737" class="3ine" name="L172077170020sef="+codCONFIG_SMPf">mnt, strCONFIG_SMP        20   >20 lass="sref">t739" class="3ine" name="L172079170020 eatomic_add_unlt.mnt, stratomic_add_unlt.mnt, struct mnt, strunamlowiterses/n, -1c 1"fof_2" clas="sref">ref">EI1738" class="3ine" name="L17208>1700ref">EI1738" class="3ine" name="L172081170020  br_write_locld_path.ref">EI1738" class="3ine" name="L1720 21700mnt_rootmnt, struct mnt, strunamlowiterses/nf_of_2" clas="sref">ref">EI1738" class="3ine" name="L172083170020  br_write_unlocld_path.ref">EI1738" class="3ine" name="L1720841700ref">EI1738" class="3ine" name="L1720 5170020 lass="sref">t735" class="3ine" name="L1720 61700212prmount.
20 ailAespcattsa new f="fs/ idfs/nameure as apopulattsit wpthsclas=>2son'graveyard' sist id="L1737" class="3ine" name="L1720891700umount_listmnt_root * 20spa>20sef="+codass="s">umount_listmnt_root
 * 20spa>20sef="+codfs_s> * 2, struct  * 2pace"+code=MS_RECf="+fe, struct ref">EI1738" class="3ine" name="L1720931700umount_listmnt_rootref">EI1738" class="3ine" name="L1720s51700vfsmount *mnt, strrooesret.s=
mnt, strpwdsret.s=
ref">EI1739" class="3ine" name="L1620961700vfsmount *ref">EI1739" class="3ine" name="L1720971700mnt_rootmnt_rootref">EI1738" class="3ine" name="L172099170020 eIS_ERRef">old_pathmnt_rootref">EI1748" class="4ine" name="L1721">17001740int mnt_rootref">EI1741" class="4ine" name="L162101170020 1"L1745" class="4ine" name="L1721"21700mnt_root20 _sesf">mnt, strn0   >20 _ses ref">EI1745" class="4ine" name="L1721"31700 */21"pa>210proFirst*pass:ocopy the*tree170pology   mount.
mnt_rootvfsmountrooet.s=
vfsmountc py_treees/nade=mnt" class="sreref"ef">mnt_rootvfsmountrooet.s=,   >211"sref">ersrefef"ef">mnt_rootvfsmountrooet.s=a de=old_path" class="srrooef">vfsmount="srrooees/n,/span>
;
old_pathref">EI17456 class="4ine" name="L162096170020 enewsef"ef">mnt_rootvfsmountrooet.s=ss/namespace.graveyardpath111747" class="4ine" name="L1721"7170020 eup_write"ef">mnt_root20 _sesf">mnt, strn0   >20 _ses ref">EI17458 class="4ine" name="L1620s81700vfsmountkfreees/namespace.c#Lucasnewsef"ef">mnt_rootref">EI17459 class="4ine" name="L172099170020 e=out" cERR_PTRef">old_path;
ref">EI1745" class="4ine" name="L16211>170020 lass="sref">t748" class="4ine" name="L172111170020  br_write_locld_path.ref">EI1748" class="4ine" name="L1721t21700old_pathmnt_rootmnt_rootmnt_rootvfsmountrooet.s=a de=old_path" class="srlfir"ef">mnt_rootref">EI1748" class="4ine" name="L1721t3170020  br_write_unlocld_path.ref">EI1743" class="4ine" name="L1721t41700 */21"pa>210prmount.
210a href="fs Secos apass:oswitch the*tska de=fsa de=* ele  >2s =s a>ark new  *2127 href="fs as belowiings708new f="fs/ id. oWemthatsel 20 a href="fs fs_s> * 2,ndo tska de=fsa de=locl1is.not=neesedhon'graveyard' sist id="L1748" class="4ine" name="L1721191700srefef"ef">mnt_rootvfsmountrooet.s=_of_2" clas="sref">ref">EI1741" class="4ine" name="L1621 1170020  qmnt, structqa hr
mnt_rootvfsmountrooet.s=_of_2" clas="sref">ref">EI1741" class="4ine" name="L172122170020 epmnt, structpa hrss/namespace.graveyardpath111741" class="4ine" name="L1721231700mnt_rootnewsef"ef">mnt_rootref">EI1741" class="4ine" name="L1721 41700mnt, str__ nammake_lowiterses/nade=mnt" class="qmnt, structqa hrf_of_2" clas="sref">ref">EI1741" class="4ine" name="L172125170020 e>e, struct 20 epmnt, structpa hr
<vfsmountrooet.s=.s(ist_first_ef=sref">mnt, struct 20 " class=">e, struct vfsmountrooet.s=.s(ist_first_ef=sref">mnt, struct mnt, struregeees/nade=mnt" class="qmnt, structqa hrf_of_2" clas="sref">ref">EI17418 class="4ine" name="L1721 81700mnt, str__ nammake_lowiterses/nade=mnt" class="qmnt, structqa hrf_of_2" clas="sref">ref">EI1741" class="4ine" name="L1721 91700mnt, strunammake_745rtterses/nac+cod20   >20 epmnt, structpa hrs_of_2" clas="sref">ref">EI1745" class="4ine" name="L17213>1700mnt, strrooesret.s=
ref">EI1745" class="4ine" name="L1721311700t747" class="4ine" name="L172132170020 epmnt, structpa hr
<vfsmount pwft.s=.s(ist_first_ef=sref">mnt, struct vfsmount pwft.s=.s(ist_first_ef=sref">mnt, struct mnt, struregeees/nade=mnt" class="qmnt, structqa hrf_of_2" clas="sref">ref">EI1745" class="4ine" name="L1720341700mnt, str__ nammake_lowiterses/nade=mnt" class="qmnt, structqa hrf_of_2" clas="sref">ref">EI1743" class="4ine" name="L1720351700mnt, strunammake_745rtterses/nac+cod20   >20 epmnt, structpa hrs_of_2" clas="sref">ref">EI1745" class="4ine" name="L1720361700mnt, strpwdsret.s=
ref">EI1745" class="4ine" name="L1720371700           20   >20 lass="sref">t7478 class="4ine" name="L172038170020 lass="sref">t747" class="4ine" name="L172039170020 " class="pmnt, structpa hr
mnt, strnext_srees/nac+cod20   >20 epmnt, structpa hr,   >211"sref">ersrefef"ef">mnt_rootvfsmountrooet.s=s_of_2" clas="sref">ref">EI1747" class="4ine" name="L17204>170020   class="qmnt, structqa hr
mnt, strnext_srees/nac+cod20   >20 eqmnt, structqa hr,   >211"sref">ernewsef"ef">mnt_rootvfsmountrooet.s=s_of_2" clas="sref">ref">EI1747" class="4ine" name="L1720411700t747" class="4ine" name="L1720421700mnt_root20 _sesf">mnt, strn0   >20 _ses ref">EI1747" class="4ine" name="L1720431700ref">EI1747" class="4ine" name="L1720441700mnt, strrooesret.s=fof_2" clas="sref">ref">EI1744" class="4ine" name="L1720 51700vfsmountsrepuees/nac+cod20   >20 e ooesref">mnt, strrooesret.s=f_of_2" clas="sref">ref">EI1747" class="4ine" name="L1720 61700mnt, strpwdsret.s=fof_2" clas="sref">ref">EI1744" class="4ine" name="L1720 7170020 esrepuef">vfsmountsrepuees/nac+cod20   >20 epwdsref">mnt, strpwdsret.s=f_of_2" clas="sref">ref">EI17478 class="4ine" name="L1720 81700mnt_rootref">EI1740" class="4ine" name="L17205>170020 lass="sref">t748" class="4ine" name="L172051170020 1"L1748" class="4ine" name="L1620 21700umount_listmnt_rootumount_listmnt_root
 * 20spa>20sef="+codfs_s> * 2, struct  * 2pace"+code=MS_RECf="+news>e, struct et.s=fof_2" clas="sref">ref">EI1746" class="4ine" name="L1620541700 * 20spa>20sef="+codass="s">umount_listmnt_rootref">EI1747" class="4ine" name="L172056170020 eBUG_ONef">old_path20 enf"ef">mnt_rootref">EI1746" class="4ine" name="L172058170020  get_srefef"ef">mnt_root20 enf"ef">mnt_rootref">EI1746" class="4ine" name="L1720591700, struct ref">EI1748" class="4ine" name="L1720611700mnt_rootref">EI1743" class="4ine" name="L1720621700mnt_rootmnt_rootmnt_root20  news>e, struct et.s=f_of_2" clas="sref">ref">EI1743" class="4ine" name="L1720641700mnt_root20 enf"ef">mnt_rootref">EI1748" class="4ine" name="L1720661700mnt_rootref">EI1748" class="4ine" name="L1720 7170020 lass="sref">t743" class="4ine" name="L172068170020 ="L1745" class="4ine" name="L1720691700
umount_listmnt_root * 20spa>20sef="+code=outlaef">vfsmount *mnt, struct ref">EI1749" class="4ine" name="L1720741700 * 20spa>20sef="+codass="s">umount_listmnt_rootref">EI1749" class="4ine" name="L172076170020 enewsef"ef">mnt_rootmnt_rootref">EI1749" class="4ine" name="L172078170020 eIS_ERRef">old_pathmnt_root20 " class="="sf">mnt, struct mnt_rootnewsef"ef">mnt_rootref">EI1748" class="4ine" name="L17208>1700mnt, str__ nammake_lowiterses/nade=mnt" class="sref">mnt, struct ref">EI1748" class="4ine" name="L1720811700mnt_rootvfsmountrooet.s=
mnt, struct ref">EI1748" class="4ine" name="L1720 21700_fir_addf">mnt, str_fir_addes/na" clas(ist_first_ef=newsef"ef">mnt_rootmnt_rootmnt_rootvfsmountrooet.s=a de=old_path" class="srlfir"ef">mnt_rootref">EI1748" class="4ine" name="L172083170020 lass="sref">t748" class="4ine" name="L172084170020 ecode=MS_RECf="+newsef"ef">mnt_rootref">EI1748" class="4ine" name="L1720 5170020 lass="sref">t745" class="4ine" name="L1720 61700;
mnt_rootref">EI1748" class="4ine" name="L1720871700mnt_rootvfsmountm href="+c chartde=mnt" class="__userf">mnt, str__userpace"+,=c+cod20   >20 edevme=s/f">vfsmountdevme=s/a>);, chartde=mnt" class="__userf">mnt, str__userpace"+,=c+cod20   >20 edirme=s/f">vfsmountdirme=s/es/n,/span>
mnt, str__userpace"+,=c+cod20   >20 etyped_path.mnt, str__userpace"+,=c+cod20   >20 edataf">vfsmountdata ref">EI1745" class="4ine" name="L16209>1700mnt, strret ref">EI1749" class="4ine" name="L1720921700.ref">EI1749" class="4ine" name="L1720931700.ref">EI1749" class="4ine" name="L1720941700.ref">EI1749" class="4ine" name="L1720s51700old_pathref">EI1749" class="4ine" name="L162096170020 ereef">mnt, strret mnt_root inges/nade=mnt" class="typed_path..ref">EI1748" class="4ine" name="L1620s81700mnt, strret ref">EI1745" class="4ine" name="L1720991700ref">EI1758" class="5ine" name="L1721">17001750 if (    20   >20 lass="sref">t751" class="5ine" name="L162101170020  kernel_dird_path.vfsmountgete=s/es/nade=mnt" class="dirme=s/f">vfsmountdirme=s/es/nf_of_2" clas="sref">ref">EI1755" class="5ine" name="L1721"21700old_path.mnt, strret old_path.ref">EI17554 class="5ine" name="L1720941700ref">EI17585 class="5ine" name="L1720s51700t7556 class="5ine" name="L1620961700mnt, strret mnt_root inges/nade=mnt" class="devme=s/f">vfsmountdevme=s/a>);, " clas(ist_first_ef=kernel_devd_path.ref">EI17558 class="5ine" name="L1620s81700mnt, strret ref">EI17559 class="5ine" name="L1720991700ref">EI1755" class="5ine" name="L16211>170020 lass="sref">t758" class="5ine" name="L172111170020  reef">mnt, strret mnt_rootvfsmountdata old_pathref">EI1758" class="5ine" name="L1721t21700mnt, strret ref">EI1758" class="5ine" name="L1721t31700vfsmountout_datat.s=_of_2" clas="sref">ref">EI17554 class="5ine" name="L1721t41700mnt, strret vfsmountdo_>ourees/nac+cod20   >20 ekernel_devd_path.20 ekernel_dird_path.20 ekernel_typed_path.20s_prop586 class="5ine" name="L1721t61700old_pathref">EI1758" class="5ine" name="L1721t71700old_pathold_pathref">EI17589 class="5ine" name="L1721191700vfsmountout_datat.s=:of_2" clas="sref">ref">EI1758" class="5ine" name="L17212>170020  kfreef">vfsmountkfreees/namespace.c#Lucaskernel_devd_path.ref">EI1751" class="5ine" name="L1621 11700.ref">EI1758" class="5ine" name="L1721221700vfsmountpute=s/es/namespace.c#Lucaskernel_dird_path.ref">EI1751" class="5ine" name="L1721231700ref">EI17584 class="5ine" name="L1721 4170020  kfreef">vfsmountkfreees/namespace.c#Lucaskernel_typed_path.ref">EI1751" class="5ine" name="L1721251700out_typed_path.ref">EI17586 class="5ine" name="L1721261700mnt, strret ref">EI1751" class="5ine" name="L1721 7170020 lass="sref">t7518 class="5ine" name="L1721 81700212/*mount.
213   Res> ictioef:mount.
210a* T* sfewrrooe as aput_old must b sdirectories,f=s a must not=b s.n themount.
2127* s170 file  systessas87* scurr >2 processsrooeh T* sput_old  must =b mount.
20 ailunderneathsfewrrooe,f=d.e.aaddingsa non-zer08numbers.c /..s7087* ss> ingesunt.
212" os acseds708byaput_old must yield87* ss170 directory assfewrrooe. No o7* resunt.
213  on'graveyard' sist id="L17576 class="5ine" name="L1720 61700210a* Notef:mount.
2127*  - w0 don't ucve rooe/cwdsic they are not=at87* srooe (reason:sic somethingesunt.
20 aillllcapid enoughs708change thes, it's probably wrongs708force thes elsew* re)esunt.
212" o - it's okay=708pick a rooe thae isn't 7* srooe .c a file systes, e.ghon'graveyard' sist id="L1750" class="5ine" name="L17205>1700213      /n#39myrrooe w* re /n#3 is 7* sucassos acs. It must b sa ucasss acs,mount.
mnt, strSYSCALL_DEFINE2es/namespace.c#Lucaspivosrrooef">vfsmountpivosrrooea>);, coeft"chartde=mnt" class="__userf">mnt, str__userpace"+,=c+cod20   >20 efewrrooef">mnt, strfewrrooehref,a href="+code20tat>20s_prop57" class="5ine" name="L1720551700mnt, str__userpace"+,=c+cod20   >20 eput_oldf">vfsmountput_old ref">EI1757" class="5ine" name="L1720561700vfsmount *ref">EI1756" class="5ine" name="L1720581700 * 20spa>20sef="+codpathf">vfsmountpath     c+cod20   >20 efewf">mnt, strfew vfsmountold 20 epar >2_pathf">vfsmountpar >2_path 20 erooe_par >2f">mnt, strrooe_par >2 20 erooef">mnt, strrooe ref">EI1756" class="5ine" name="L172059170020sef="+coderrorf">mnt, strerror ref">EI1758" class="5ine" name="L17206>170020 lass="sref">t758" class="5ine" name="L172061170020 ecapabled_path.old_path20 lass="sref">t758" class="5ine" name="L1720621700ref">EI1758" class="5ine" name="L1720631700ref">EI1753" class="5ine" name="L172064170020  errorf">mnt, strerror mnt, strfewrrooehref, " clas(ist_first_ef=newf">mnt, strfew ref">EI1753" class="5ine" name="L1720651700mnt, strerror 20 lass="sref">t758" class="5ine" name="L1720661700out0f">vfsmountout0 ref">EI1758" class="5ine" name="L1720 7170020  errorf">mnt, strerror vfsmountput_old vfsmountold ref">EI1753" class="5ine" name="L172069170020 eerrorf">mnt, strerror 20 lass="sref">t756" class="5ine" name="L17207>1700out1f">vfsmountout1 ref">EI1756" class="5ine" name="L172071170020 1"L1756" class="5ine" name="L1720721700mnt, strerror mnt, strsecurity_sb_pivosrooees/na" clas(ist_first_ef=oldf">vfsmountold mnt, strfew ref">EI1755" class="5ine" name="L162073170020 eerrorf">mnt, strerror 20 lass="sref">t756" class="5ine" name="L1720741700mnt, strout2 ref">EI1756" class="5ine" name="L1720751700ref">EI1756" class="5ine" name="L1720761700mnt, strget_fsrrooees/namespace.c#Lucascurr >2d_path.2es/na de=old_path" class>e, struct vfsmountrooet.s=s_of_2" clas="sref">ref">EI1757" class="5ine" name="L1720771700mnt, strerror vfsmountlocl_>osrees/na" clas(ist_first_ef=oldf">vfsmountold ref">EI1757" class="5ine" name="L172078170020 eerrorf">mnt, strerror 20 lass="sref">t756" class="5ine" name="L1720791700mnt, strout3 ref">EI1758" class="5ine" name="L17208>170020 lass="sref">t758" class="5ine" name="L172081170020  errorf">mnt, strerror ;
ref">EI1758" class="5ine" name="L1720 21700;
vfsmountold mnt, struct ref">EI1758" class="5ine" name="L1720831700mnt, strfew mnt, struct mnt, str="srpar >2 ref">EI1758" class="5ine" name="L172084170020 eIS_MNT_SHAREDa>;
vfsmountrooet.s=.s(ist_first_ef=sref">mnt, struct mnt, str="srpar >2 20 lass="sref">t758" class="5ine" name="L1720 51700out4f">mnt, strout4 ref">EI1758" class="5ine" name="L1720 6170020 echecl_>>2d_path.>2es/namespace.c#Lucasrooef">vfsmountrooet.s=.s(ist_first_ef=sref">mnt, struct 20 echecl_>>2d_path.>2es/namespace.c#Lucasnewf">mnt, strfew mnt, struct 20 lass="sref">t758" class="5ine" name="L1720871700out4f">mnt, strout4 ref">EI1758" class="5ine" name="L1720 8170020  errorf">mnt, strerror ;
ref">EI1758" class="5ine" name="L172089170020 ed_unlinkedf">vfsmountd_unlinkedes/namespace.c#Lucasnewf">mnt, strfew 2ryf">vfsmountd >2ry 20 lass="sref">t755" class="5ine" name="L16209>1700out4f">mnt, strout4 ref">EI1759" class="5ine" name="L172091170020 ed_unlinkedf">vfsmountd_unlinkedes/namespace.c#Lucasoldf">vfsmountold 2ryf">vfsmountd >2ry 20 lass="sref">t755" class="5ine" name="L1720921700out4f">mnt, strout4 ref">EI1759" class="5ine" name="L172093170020  errorf">mnt, strerror ;
ref">EI1759" class="5ine" name="L172094170020 enewf">mnt, strfew mnt, struct vfsmountrooet.s=.s(ist_first_ef=sref">mnt, struct ref">EI1759" class="5ine" name="L1720s51700vfsmountold mnt, struct vfsmountrooet.s=.s(ist_first_ef=sref">mnt, struct 20 lass="sref">t755" class="5ine" name="L1620961700out4f">mnt, strout4  */21"pa>210pr loop,s.n the s170 file systess   mount.
20 eerrorf">mnt, strerror ;
ref">EI1758" class="5ine" name="L1620s81700vfsmountrooet.s=.s(ist_first_ef=sref">mnt, struct vfsmount="srrooe     !vfsmountrooet.s=.s(ist_first_ef=d >2ryf">vfsmountd >2ry ref">EI1758" class="5ine" name="L1720991700mnt, strout4  */21"pa>210pr not=a ucasss acs   mount.
170017600if (vfsmountrooet.s=.s(ist_first_ef=sref">mnt, struct mnt, str="srpar >2 vfsmountrooet.s=.s(ist_first_ef=sref">mnt, struct 20 lass="sref">t761" class="6ine" name="L1621011700mnt, strout4  */21"pa>210pr not=attached   mount.
mnt, strfew mnt, struct vfsmount="srrooe     !mnt, strfew 2ryf">vfsmountd >2ry 
mnt, strout4  */21"pa>210pr not=a ucasss acs   mount.
20 enewf">mnt, strfew mnt, struct mnt, str="srpar >2 mnt, strfew mnt, struct 
out4f">mnt, strout4  */21"pa>210pr not=attached   mount.
 */21"pa>210pr make sure w0 cmmereachaput_old fromsfewrrooe   mount.
oldf">vfsmountold mnt, struct ref">EI17658 class="6ine" name="L1620s81700, structtmp mnt, strfew mnt, struct , structtmp mnt, str="srpar >2 mnt, strout4  */21"pa>210pr alreadys>oureeds.n put_old   mount.
, structtmp mnt, str="srpar >2 mnt, strfew mnt, struct 
ref">EI17654 class="6ine" name="L1721t4170020 etmpmnt, structtmp mnt, str="srpar >2 ref">EI17655 class="6ine" name="L1721t51700t7686 class="6ine" name="L1721t6170020 eis_subdird_path., structtmp mnt, str="srucasss acs 20  newf">mnt, strfew 2ryf">vfsmountd >2ry 20 lass="sref">t768" class="6ine" name="L1721t71700      gotodmnt, strout4 ref">EI17688 class="6ine" name="L1721t8170020 eis_subdird_path.vfsmountold 2ryf">vfsmountd >2ry 20  newf">mnt, strfew 2ryf">vfsmountd >2ry 20 lass="sref">t7689 class="6ine" name="L1721191700mnt, strout4 20 lass="sref">t768" class="6ine" name="L17212>170020  br_write_loclf">mnt, strbr_write_locles/namespace.c#Lucas *mnt, str *20 lass="sref">t768" class="6ine" name="L1621 1170020  detach_>>2d_path.>2es/namespace.c#Lucasnewf">mnt, strfew mnt, struct 2_pathf">vfsmountpar >2_path 20 lass="sref">t768" class="6ine" name="L1721221700>2d_path.>2es/namespace.c#Lucasrooef">vfsmountrooet.s=.s(ist_first_ef=sref">mnt, struct 2f">mnt, strrooe_par >2 20 lass="sref">t768" class="6ine" name="L1721231700 */21"pa>210pr mcassoold rooe .n put_old   mount.
vfsmountrooet.s=.s(ist_first_ef=sref">mnt, struct vfsmountold ref">EI1761" class="6ine" name="L1721251700 */21"pa>210pr mcassofewrrooe .n /   mount.
mnt, strfew mnt, struct 2f">mnt, strrooe_par >2 20 lass="sref">t768" class="6ine" name="L1721 71700, structtouch_>>2_lass="srees/namespace.c#Lucascurr >2d_path.2es/na de=old_path" classnsproxyf">vfsmountnsproxy mnt_root20 lass="sref">t7688 class="6ine" name="L1721 8170020  br_write_unloclf">mnt, strbr_write_unlocles/namespace.c#Lucas *mnt, str *20 lass="sref">t7689 class="6ine" name="L1721 9170020  chrooe_fsrre>e, struct ees/na" clas(ist_first_ef=rooef">vfsmountrooet.s=, " clas(ist_first_ef=newf">mnt, strfew ref">EI1765" class="6ine" name="L17213>170020  errorf">mnt, strerror ref">EI1765" class="6ine" name="L1721311700mnt, strout4 ref">EI1765" class="6ine" name="L1721321700osref">vfsmountunlocl_>osrees/na" clas(ist_first_ef=oldf">vfsmountold ref">EI1766" class="6ine" name="L172133170020 eerrorf">mnt, strerror 20 epath_putf">vfsmountpath_putes/na" clas(ist_first_ef=rooe_par >2f">mnt, strrooe_par >2 20 lass="sref">t765" class="6ine" name="L172035170020 epath_putf">vfsmountpath_putes/na" clas(ist_first_ef=par >2_pathf">vfsmountpar >2_path 20 lass="sref">t7656 class="6ine" name="L172036170020 lass="sref">t765" class="6ine" name="L1720371700mnt, strout3 ref">EI17658 class="6ine" name="L172038170020  path_putf">vfsmountpath_putes/na" clas(ist_first_ef=rooef">vfsmountrooet.s=f_    20   >20 lass="sref">t7659 class="6ine" name="L1720391700mnt, strout2 ref">EI1767" class="6ine" name="L17204>170020  path_putf">vfsmountpath_putes/na" clas(ist_first_ef=oldf">vfsmountold ref">EI1767" class="6ine" name="L1720411700vfsmountout1 ref">EI1767" class="6ine" name="L1720421700vfsmountpath_putes/na" clas(ist_first_ef=newf">mnt, strfew ref">EI1767" class="6ine" name="L1720431700vfsmountout0 ref">EI1767" class="6ine" name="L172044170020 ecode=MS_RECf="+errorf">mnt, strerror ref">EI1767" class="6ine" name="L1720 5170020 lass="sref">t7676 class="6ine" name="L1720 61700mnt, str__initif (<"+cod20   >20 einit_s hre_treef">vfsmountinit_s hre_treees/na/namf    20   >20 lass="sref">t7678 class="6ine" name="L1720 81700vfsmount *mnt, struct ref">EI1760" class="6ine" name="L17205>1700 * 20spa>20sef="+codass="s">umount_listmnt_rootref">EI1768" class="6ine" name="L1720511700 * 20spa>20sef="+codpathf">vfsmountpath     c+cod20   >20 erooef">mnt, strrooe ref">EI1768" class="6ine" name="L1620 21700ref">EI1768" class="6ine" name="L1720 3170020  sref">mnt, struct vfsmountdo_kern_>osrees/namcomment"> */s> ing">"rooefs"mount.<, 0, mcomment"> */s> ing">"rooefs"mount.<, ref">EI1766" class="6ine" name="L162054170020 eIS_ERRef">old_pathmnt, struct 20 lass="sref">t767" class="6ine" name="L1720551700vfsmountpanices/namcomment"> */s> ing">"Can't create rooefs"mount.ref">EI17666 class="6ine" name="L172056170020 enf"ef">mnt_rootmnt_rootmnt, struct ref">EI1766" class="6ine" name="L1720581700old_pathmnt_root20 lass="sref">t767" class="6ine" name="L172059170020 " class="panicf">vfsmountpanices/namcomment"> */s> ing">"Can't allocate initial lass="sre"mount.ref">EI1768" class="6ine" name="L17206>170020 lass="sref">t768" class="6ine" name="L172061170020  init_taslf">mnt, strinit_tasl vfsmountnsproxy mnt_rootnf"ef">mnt_rootref">EI1768" class="6ine" name="L1720621700mnt_rootmnt_rootref">EI1768" class="6ine" name="L1720631700ref">EI1763" class="6ine" name="L172064170020  rooef">vfsmountrooet.s=.s(ist_first_ef=sref">mnt, struct mnt_rootmnt, strrooe ref">EI1763" class="6ine" name="L172065170020  rooef">vfsmountrooet.s=.s(ist_first_ef=d >2ryf">vfsmountd >2ry mnt_rootmnt, strrooe vfsmount="srrooe    _of_2" clas="sref">ref">EI17636 class="6ine" name="L172066170020 eset_fsrpwdf">vfsmountset_fsrpwdes/namespace.c#Lucascurr >2d_path.2es/na de=old_path" class>e, struct vfsmountrooet.s=s_of_2" clas="sref">ref">EI1763" class="6ine" name="L172068170020  set_fsrrooef">mnt, strset_fsrrooees/namespace.c#Lucascurr >2d_path.2es/na de=old_path" class>e, struct vfsmountrooet.s=s_of_2" clas="sref">ref">EI1763" class="6ine" name="L172069170020 lass="sref">t766" class="6ine" name="L17207>170020 lass="sref">t766" class="6ine" name="L17207117002__initf">mnt, str__initif (<"+cod20   >20 e="srinitf">mnt, str="srinites/na/namf    20   >20 lass="sref">t766" class="6ine" name="L1720721700vfsmountu    _of_2" clas="sref">ref">EI1766" class="6ine" name="L172074170020sef="+coderrf">mnt, strerr    _of_2" clas="sref">ref">EI1766" class="6ine" name="L1720751700ref">EI1766" class="6ine" name="L1720761700mnt, strinit_rwsemes/na" clas(ist_first_ef=nef">ref"_semf">mnt, strnef">ref"_semt.s=s_of_2" clas="sref">ref">EI1767" class="6ine" name="L1720771700mnt, str="srcache mnt, strkmemrcache_createes/namcomment"> */s> ing">"="srcache"mount.<, sizeof(s> * 20spa>20sef="+code=outlaef">vfsmount *20s_prop66" class="6ine" name="L1720791700old_pathold_pathref">EI1768" class="6ine" name="L17208>170020 lass="sref">t768" class="6ine" name="L172081170020  s hre_hashtabled_path. * 20spa>20sef="+codlise_headf">vfsmountlise_headpace"+)space.c#202__get_free_pagcef">old_pathold_pathref">EI1768" class="6ine" name="L1720 21700ref">EI1768" class="6ine" name="L172083170020 es hre_hashtabled_path.20 lass="sref">t768" class="6ine" name="L172084170020 epanicf">vfsmountpanices/namcomment"> */s> ing">"Failes=708allocate mcassohash table\n"mount.ref">EI1768" class="6ine" name="L1720 51700ref">EI1768" class="6ine" name="L1720 61700mnt, strp intles/namespace.c#LucasKERN_INFOf">mnt, strKERN_INFOif (<"comment"> */s> ing">"Mcass-cacheohash table  >2ries: %lu\n"mount.<, mnt, strHASH_SIZE ref">EI1768" class="6ine" name="L1720871700vfsmountu    
vfsmountu    
< mnt, strHASH_SIZE vfsmountu    ++f    20   >20 lass="sref">t768" class="6ine" name="L172089170020 " class="INIT_LIST_HEADa>;
.vfsmountu    ]f_of_2" clas="sref">ref">EI1765" class="6ine" name="L16209>170020 lass="sref">t769" class="6ine" name="L172091170020  br_loclrinitf">mnt, strbr_loclrinites/namespace.c#Lucas *mnt, str *20 lass="sref">t765" class="6ine" name="L1720921700ref">EI1769" class="6ine" name="L172093170020  errf">mnt, strerr    
mnt, strsysfsrinites/naf_    20   >20 lass="sref">t765" class="6ine" name="L172094170020 eerrf">mnt, strerr    f    20   >20 lass="sref">t769" class="6ine" name="L1720s51700mnt, strp intles/namespace.c#LucasKERN_WARNINGf">mnt, strKERN_WARNINGif (<"comment"> */s> ing">"%s: sysfsrinit error: %d\n"mount.<,    20   >20 lass="sref">t769" class="6ine" name="L1620961700old_pathmnt, strerr    f_    20   >20 lass="sref">t765" class="6ine" name="L1720971700kobject_create_and_addf">vfsmountkobject_create_and_addes/namcomment"> */s> ing">"fs"mount.<, ref">EI1768" class="6ine" name="L1620s8170020 efsrkobj, struct 20 lass="sref">t769" class="6ine" name="L1720991700mnt, strp intles/namespace.c#LucasKERN_WARNINGf">mnt, strKERN_WARNINGif (<"comment"> */s> ing">"%s: kobj create error\n"mount.<, old_pathref">EI1778" class="7ine" name="L1721">17001770         goto 20  init_rooefsf">mnt, strinit_rooefses/naf_    20   >20 lass="sref">t771" class="7ine" name="L162101170020  init_s hre_treef">vfsmountinit_s hre_treees/naf_    20   >20 lass="sref">t7712 class="7ine" name="L172092170020 lass="sref">t7783 class="7ine" name="L1720931700ref">EI17784 class="7ine" name="L17209417002put_="sref"ef">mnt_root * 20spa>20sef="+codass="s">umount_listmnt_root20 lass="sref">t7785 class="7ine" name="L1720s51700;
vfsmountua hre_liset.s=f_of_2" clas="sref">ref">EI17787 class="7ine" name="L172097170020 eatomic_dec_and_tesef">vfsmountatomic_dec_and_tesees/na" clas(ist_first_ef=nf"ef">mnt_rootvfsmountc href="+)f    20   >20 lass="sref">t7789 class="7ine" name="L172099170020 _of_2" clas="sref">ref">EI1775" class="7ine" name="L16211>170020  down_writef">vfsmountdown_writees/na" clas(ist_first_ef=nef">ref"_semf">mnt, strnef">ref"_semt.s=s_of_2" clas="sref">ref">EI1778" class="7ine" name="L172111170020  br_write_loclf">mnt, strbr_write_locles/namespace.c#Lucas *mnt, str *20 lass="sref">t778" class="7ine" name="L1721t21700vfsmountus hre_treees/namnt_rootmnt, strrooe vfsmountua hre_liset.s=f_of_2" clas="sref">ref">EI1778" class="7ine" name="L1721t3170020  br_write_unloclf">mnt, strbr_write_unlocles/namespace.c#Lucas *mnt, str *20 lass="sref">t7754 class="7ine" name="L1721t4170020  up_writef">vfsmountup_writees/na" clas(ist_first_ef=nef">ref"_semf">mnt, strnef">ref"_semt.s=s_of_2" clas="sref">ref">EI17785 class="7ine" name="L1721t5170020  release_s href"ef">mnt_rootvfsmountua hre_liset.s=f_of_2" clas="sref">ref">EI17786 class="7ine" name="L1721t61700vfsmountkfreees/namnt_rootref">EI17787 class="7ine" name="L1721t7170020 lass="sref">t7788 class="7ine" name="L1721t81700put_="sref"ef">mnt_rootref">EI17789 class="7ine" name="L1721191700ref">EI1778" class="7ine" name="L17212>1700 * 20spa>20sef="+code=outlaef">vfsmount *vfsmountkern_>osre_dataes/nas> * 20spa>20sef="+codfile_systes_typef">vfsmountfile_systes_typef="+code=mnt" class="typef">vfsmounttypef="+, /nameode=mnt" class="dataf">vfsmountdataes/nf    20   >20 lass="sref">t778" class="7ine" name="L1621 11700vfsmount *mnt, struct ref">EI1778" class="7ine" name="L172123170020  sref">mnt, struct vfsmountvffrkern_>osrees/navfsmounttypef="+, vfsmounttypef="+a de=old_path" classn170f">mnt, strnef"f="+, vfsmountdataes/nf_of_2" clas="sref">ref">EI17784 class="7ine" name="L1721 4170020 eIS_ERRef">old_pathmnt, struct  */21"pa>210prmount.
mnt, struct ref">EI1775" class="7ine" name="L17213>170020 lass="sref">t775" class="7ine" name="L172131170020 ecode=MS_RECf="+sref">mnt, struct ref">EI1775" class="7ine" name="L172132170020 lass="sref">t776" class="7ine" name="L1721331700vfsmountkern_>osre_dataes/nf_of_2" clas="sref">ref">EI17754 class="7ine" name="L1720341700ref">EI1775" class="7ine" name="L17203517002ref">       mount.h1117t_ef=d >2ryf"> namepppps_2" clas="sref">ref">EI1775" clI1778" class=ss="7href="20   >EXPORT_SYMBO/_GPuntkern_>osre_dataes/nf_of_2" clas="sref">ref">EI17 ="L1764" class="6ine" nam1, struct 
ref">7I17658 class="6ine" name=7L1720731700ol_OR_ol_OR_mnt, struct mnt, struct ref">7I1767" class="6ine" name=7L1720741700mnt, struct 20 ref">ref">7I1767" class="6ine" name=7L172074170020 ref">ref">7I1767" class="6ine" name=7L1720731700       mount.h1117t_ef=/a>, struct ref">EI1767" class="6ine" name=7L1720741700ref">7I1767" class="6ine" name=7L1720751700<713struct >2ourfirs_ef=d >2ryf"> namepppps_2" clas="sref">ref">EI1775" clI1778" class=ss="7href="20   >EXPORT_SYMBO/_GPuntkern_>osre_dataes/nf_of_2"lass="sref7>t7676 class="6ine" name=7L172074 nam1, struct 20 =7L1764" class="6ine" name=7L172074170020 e"+cod20   >20 echecl_>>2d_path.>2es/namespace.c#Lucassref">mnt, struct ref">7>t7678 class="6ine" name=7L172078170020 rass="sref711767" class="6ine" name=7L1720791700<


The original LXR softwawe by>210p71 732http://sourc * wge.net/provfsms/lx=">LXR hrssunitsmount71 732mailto:lx=@s="ux.no">lx=@s="ux.nomoun.
lx=.s="ux.no kindly hospr aby>71 732http://www.ys pill-s="pro.no">Rs pill L="pro ASmount