1. 18 3月, 2011 5 次提交
    • A
      change the locking order for namespace_sem · b12cea91
      Al Viro 提交于
      Have it nested inside ->i_mutex.  Instead of using follow_down()
      under namespace_sem, followed by grabbing i_mutex and checking that
      mountpoint to be is not dead, do the following:
      	grab i_mutex
      	check that it's not dead
      	grab namespace_sem
      	see if anything is mounted there
      	if not, we've won
      	otherwise
      		drop locks
      		put_path on what we had
      		replace with what's mounted
      		retry everything with new mountpoint to be
      
      New helper (lock_mount()) does that.  do_add_mount(), do_move_mount(),
      do_loopback() and pivot_root() switched to it; in case of the last
      two that eliminates a race we used to have - original code didn't
      do follow_down().
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      b12cea91
    • A
      fix deadlock in pivot_root() · 27cb1572
      Al Viro 提交于
      Don't hold vfsmount_lock over the loop traversing ->mnt_parent;
      do check_mnt(new.mnt) under namespace_sem instead; combined with
      namespace_sem held over all that code it'll guarantee the stability
      of ->mnt_parent chain all the way to the root.
      
      Doing check_mnt() outside of namespace_sem in case of pivot_root()
      is wrong anyway.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      27cb1572
    • A
      vfs: split off vfsmount-related parts of vfs_kern_mount() · 9d412a43
      Al Viro 提交于
      new function: mount_fs().  Does all work done by vfs_kern_mount()
      except the allocation and filling of vfsmount; returns root dentry
      or ERR_PTR().
      
      vfs_kern_mount() switched to using it and taken to fs/namespace.c,
      along with its wrappers.
      
      alloc_vfsmnt()/free_vfsmnt() made static.
      
      functions in namespace.c slightly reordered.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      9d412a43
    • T
      Some fixes for pstore · fbe0aa1f
      Tony Luck 提交于
      1) Change from ->get_sb() to ->mount()
      2) Use mount_single() instead of mount_nodev()
      3) Pulled in ramfs_get_inode() & trimmed to what I need for pstore
      4) Drop the ugly pstore_writefile() Just save data using kmalloc() and
         provide a pstore_file_read() that uses simple_read_from_buffer().
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      fbe0aa1f
    • A
      kill simple_set_mnt() · 474a00ee
      Al Viro 提交于
      not needed anymore, since all users (->get_sb() instances) are gone.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      474a00ee
  2. 17 3月, 2011 35 次提交