1. 22 3月, 2011 1 次提交
  2. 21 3月, 2011 11 次提交
  3. 18 3月, 2011 8 次提交
    • J
      fs: call security_d_instantiate in d_obtain_alias V2 · 24ff6663
      Josef Bacik 提交于
      While trying to track down some NFS problems with BTRFS, I kept noticing I was
      getting -EACCESS for no apparent reason.  Eric Paris and printk() helped me
      figure out that it was SELinux that was giving me grief, with the following
      denial
      
      type=AVC msg=audit(1290013638.413:95): avc:  denied  { 0x800000 } for  pid=1772
      comm="nfsd" name="" dev=sda1 ino=256 scontext=system_u:system_r:kernel_t:s0
      tcontext=system_u:object_r:unlabeled_t:s0 tclass=file
      
      Turns out this is because in d_obtain_alias if we can't find an alias we create
      one and do all the normal instantiation stuff, but we don't do the
      security_d_instantiate.
      
      Usually we are protected from getting a hashed dentry that hasn't yet run
      security_d_instantiate() by the parent's i_mutex, but obviously this isn't an
      option there, so in order to deal with the case that a second thread comes in
      and finds our new dentry before we get to run security_d_instantiate(), we go
      ahead and call it if we find a dentry already.  Eric assures me that this is ok
      as the code checks to see if the dentry has been initialized already so calling
      security_d_instantiate() against the same dentry multiple times is ok.  With
      this patch I'm no longer getting errant -EACCESS values.
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      24ff6663
    • A
      lose 'mounting_here' argument in ->d_manage() · 1aed3e42
      Al Viro 提交于
      it's always false...
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      1aed3e42
    • A
      don't pass 'mounting_here' flag to follow_down() · 7cc90cc3
      Al Viro 提交于
      it's always false now
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      7cc90cc3
    • 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
  4. 17 3月, 2011 10 次提交
  5. 16 3月, 2011 10 次提交
    • L
      Increase OSF partition limit from 8 to 18 · 34d211a2
      Linus Torvalds 提交于
      It turns out that while a maximum of 8 partitions may be what people
      "should" have had, you can actually fit up to 18 entries(*) in a sector.
      
      And some people clearly were taking advantage of that, like Michael
      Cree, who had ten partitions on one of his OSF disks.
      
      (*) The OSF partition data starts at byte offset 64 in the first sector,
          and the array of 16-byte partition entries start at offset 148 in
          the on-disk partition structure.
      Reported-by: NMichael Cree <mcree@orcon.net.nz>
      Cc: stable@kernel.org (v2.6.38)
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      34d211a2
    • C
      prune back iprune_sem · bab1d944
      Christoph Hellwig 提交于
      iprune_sem is continously giving us lockdep warnings because we do take it in
      read mode in the reclaim path, but we're also doing non-NOFS allocations under
      it taken in write mode.
      
      Taking a bit deeper look at it I think it's fixable quite trivially:
      
       - for invalidate_inodes we do not need iprune_sem at all.  We have an active
         reference on the superblock, so the filesystem is not going away until it
         has finished.
       - for evict_inodes we do need it, to make sure prune_icache has done it's
         work before we tear down the superblock.  But there is no reason to
         hold it over the actual reclaim operation - it's enough to cycle through
         it after the actual reclaim to make sure we wait for any pending
         prune_icache to complete.  We just have to remove the WARN_ON for
         otherwise busy inodes as they can actually happen now.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      bab1d944
    • A
      UBIFS: clean-up commentaries · 5d630e43
      Artem Bityutskiy 提交于
      Clean-up commentaries in debug.h and remove references to non-existing
      symblols.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      5d630e43
    • A
      UBIFS: save 128KiB or more RAM · 7c83cc91
      Artem Bityutskiy 提交于
      When debugging is enabled, we allocate a buffer of PEB size for
      various debugging purposes. However, now all users of this buffer
      are gone and we can safely remove it and save 128KiB or more RAM.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      7c83cc91
    • A
      UBIFS: allocate orphans scan buffer on demand · f5cf319c
      Artem Bityutskiy 提交于
      Instead of using pre-allocated 'c->dbg->buf' buffer in
      'dbg_scan_orphans()', dynamically allocate it when needed. The intend
      is to get rid of the pre-allocated 'c->dbg->buf' buffer and save
      128KiB of RAM (or more if PEB size is larger). Indeed, currently we
      allocate this memory even if the user never enables any self-check,
      which is wasteful.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      f5cf319c
    • A
      UBIFS: allocate lpt dump buffer on demand · cab95d44
      Artem Bityutskiy 提交于
      Instead of using pre-allocated 'c->dbg->buf' buffer in
      'dump_lpt_leb()', dynamically allocate it when needed. The intend
      is to get rid of the pre-allocated 'c->dbg->buf' buffer and save
      128KiB of RAM (or more if PEB size is larger). Indeed, currently we
      allocate this memory even if the user never enables any self-check,
      which is wasteful.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      cab95d44
    • A
      UBIFS: allocate ltab checking buffer on demand · 6fb324a4
      Artem Bityutskiy 提交于
      Instead of using pre-allocated 'c->dbg->buf' buffer in
      'dbg_check_ltab_lnum()', dynamically allocate it when needed. The
      intend is to get rid of the pre-allocated 'c->dbg->buf' buffer and
      save 128KiB of RAM (or more if PEB size is larger). Indeed,
      currently we allocate this memory even if the user never enables
      any self-check, which is wasteful.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      6fb324a4
    • A
      UBIFS: allocate scanning buffer on demand · cd5f7485
      Artem Bityutskiy 提交于
      Instead of using pre-allocated 'c->dbg->buf' buffer in
      'scan_check_cb()', dynamically allocate it when needed. The intend
      is to get rid of the pre-allocated 'c->dbg->buf' buffer and save
      128KiB of RAM (or more if PEB size is larger). Indeed, currently we
      allocate this memory even if the user never enables any self-check,
      which is wasteful.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      cd5f7485
    • A
      UBIFS: allocate dump buffer on demand · 73d9aec3
      Artem Bityutskiy 提交于
      Instead of using pre-allocated 'c->dbg->buf' buffer in
      'dbg_dump_leb()', dynamically allocate it when needed. The intend
      is to get rid of the pre-allocated 'c->dbg->buf' buffer and save
      128KiB of RAM (or more if PEB size is larger). Indeed, currently we
      allocate this memory even if the user never enables any self-check,
      which is wasteful.
      Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      73d9aec3
    • A
      fix follow_link() breakage · 0e794589
      Al Viro 提交于
      commit 574197e0 had a missing
      piece, breaking the loop detection ;-/
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      0e794589