1. 07 1月, 2009 1 次提交
    • I
      autofs4: make autofs type usage explicit · a92daf6b
      Ian Kent 提交于
      - the type assigned at mount when no type is given is changed
        from 0 to AUTOFS_TYPE_INDIRECT. This was done because 0 and
        AUTOFS_TYPE_INDIRECT were being treated implicitly as the same
        type.
      
      - previously, an offset mount had it's type set to
        AUTOFS_TYPE_DIRECT|AUTOFS_TYPE_OFFSET but the mount control
        re-implementation needs to be able distinguish all three types.
        So this was changed to make the type setting explicit.
      
      - a type AUTOFS_TYPE_ANY was added for use by the re-implementation
        when checking if a given path is a mountpoint. It's not really a
        type as we use this to ask if a given path is a mountpoint in the
        autofs_dev_ioctl_ismountpoint() function.
      
      - functions to set and test the autofs mount types have been added to
        improve readability and make the type usage explicit.
      
      - the mount type is used from user space for the mount control
        re-implementtion so, for consistency, all the definitions have
        been moved to the user space include file include/linux/auto_fs4.h.
      Signed-off-by: NIan Kent <raven@themaw.net>
      Signed-off-by: NJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a92daf6b
  2. 06 1月, 2009 1 次提交
  3. 14 11月, 2008 1 次提交
  4. 17 10月, 2008 2 次提交
  5. 14 10月, 2008 1 次提交
  6. 25 7月, 2008 3 次提交
    • I
      autofs4: fix waitq locking · 5a11d4d0
      Ian Kent 提交于
      The autofs4_catatonic_mode() function accesses the wait queue without any
      locking but can be called at any time.  This could lead to a possible
      double free of the name field of the wait and a double fput of the daemon
      communication pipe or an fput of a NULL file pointer.
      Signed-off-by: NIan Kent <raven@themaw.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5a11d4d0
    • I
      autofs4: use look aside list for lookups · 25767378
      Ian Kent 提交于
      A while ago a patch to resolve a deadlock during directory creation was
      merged.  This delayed the hashing of lookup dentrys until the ->mkdir()
      (or ->symlink()) operation completed to ensure we always went through
      ->lookup() instead of also having processes go through ->revalidate() so
      our VFS locking remained consistent.
      
      Now we are seeing a couple of side affects of that change in situations
      with heavy mount activity.
      
      Two cases have been identified:
      
      1) When a mount request is triggered, due to the delayed hashing, the
         directory created by user space for the mount point doesn't have the
         DCACHE_AUTOFS_PENDING flag set.  In the case of an autofs multi-mount
         where a tree of mount point directories are created this can lead to
         the path walk continuing rather than the dentry being sent to the wait
         queue to wait for request completion.  This is because, if the pending
         flag isn't set, the criteria for deciding this is a mount in progress
         fails to hold, namely that the dentry is not a mount point and has no
         subdirectories.
      
      2) A mount request dentry is initially created negative and unhashed.
         It remains this way until the ->mkdir() callback completes.  Since it
         is unhashed a fresh dentry is used when the user space mount request
         creates the mount point directory.  This leaves the original dentry
         negative and unhashed.  But revalidate has no way to tell the VFS that
         the dentry has changed, other than to force another ->lookup() by
         returning false, which is at best wastefull and at worst not possible.
         This results in an -ENOENT return from the original path walk when in
         fact the mount succeeded.
      
      To resolve this we need to ensure that the same dentry is used in all
      calls to ->lookup() during the course of a mount request.  This patch
      achieves that by adding the initial dentry to a look aside list and
      removes it at ->mkdir() or ->symlink() completion (or when the dentry is
      released), since these are the only create operations autofs4 supports.
      Signed-off-by: NIan Kent <raven@themaw.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      25767378
    • I
      autofs4: don't make expiring dentry negative · 5f6f4f28
      Ian Kent 提交于
      Correct the error of making a positive dentry negative after it has been
      instantiated.
      
      The code that makes this error attempts to re-use the dentry from a
      concurrent expire and mount to resolve a race and the dentry used for the
      lookup must be negative for mounts to trigger in the required cases.  The
      fact is that the dentry doesn't need to be re-used because all that is
      needed is to preserve the flag that indicates an expire is still
      incomplete at the time of the mount request.
      
      This change uses the the dentry to check the flag and wait for the expire
      to complete then discards it instead of attempting to re-use it.
      Signed-off-by: NIan Kent <raven@themaw.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5f6f4f28
  7. 09 2月, 2008 1 次提交
  8. 20 10月, 2007 1 次提交
    • P
      pid namespaces: round up the API · a47afb0f
      Pavel Emelianov 提交于
      The set of functions process_session, task_session, process_group and
      task_pgrp is confusing, as the names can be mixed with each other when looking
      at the code for a long time.
      
      The proposals are to
      * equip the functions that return the integer with _nr suffix to
        represent that fact,
      * and to make all functions work with task (not process) by making
        the common prefix of the same name.
      
      For monotony the routines signal_session() and set_signal_session() are
      replaced with task_session_nr() and set_task_session(), especially since they
      are only used with the explicit task->signal dereference.
      Signed-off-by: NPavel Emelianov <xemul@openvz.org>
      Acked-by: NSerge E. Hallyn <serue@us.ibm.com>
      Cc: Kirill Korotaev <dev@openvz.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Cedric Le Goater <clg@fr.ibm.com>
      Cc: Herbert Poetzl <herbert@13thfloor.at>
      Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a47afb0f
  9. 17 10月, 2007 1 次提交
  10. 11 5月, 2007 1 次提交
  11. 09 5月, 2007 1 次提交
  12. 21 2月, 2007 1 次提交
    • I
      [PATCH] autofs4: fix another race between mount and expire · f50b6f86
      Ian Kent 提交于
      Jeff Moyer has identified a race between mount and expire.
      
      What happens is that during an expire the situation can arise that a directory
      is removed and another lookup is done before the expire issues a completion
      status to the kernel module.  In this case, since the the lookup gets a new
      dentry, it doesn't know that there is an expire in progress and when it posts
      its mount request, matches the existing expire request and waits for its
      completion.  ENOENT is then returned to user space from lookup (as the dentry
      passed in is now unhashed) without having performed the mount request.
      
      The solution used here is to keep track of dentrys in this unhashed state and
      reuse them, if possible, in order to preserve the flags.  Additionally, this
      infrastructure will provide the framework for the reintroduction of caching of
      mount fails removed earlier in development.
      Signed-off-by: NIan Kent <raven@themaw.net>
      Acked-by: NJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f50b6f86
  13. 13 2月, 2007 1 次提交
  14. 14 12月, 2006 1 次提交
    • R
      [PATCH] getting rid of all casts of k[cmz]alloc() calls · 5cbded58
      Robert P. J. Day 提交于
      Run this:
      
      	#!/bin/sh
      	for f in $(grep -Erl "\([^\)]*\) *k[cmz]alloc" *) ; do
      	  echo "De-casting $f..."
      	  perl -pi -e "s/ ?= ?\([^\)]*\) *(k[cmz]alloc) *\(/ = \1\(/" $f
      	done
      
      And then go through and reinstate those cases where code is casting pointers
      to non-pointers.
      
      And then drop a few hunks which conflicted with outstanding work.
      
      Cc: Russell King <rmk@arm.linux.org.uk>, Ian Molton <spyro@f2s.com>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Greg KH <greg@kroah.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Cc: Paul Fulghum <paulkf@microgate.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Karsten Keil <kkeil@suse.de>
      Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
      Cc: Jeff Garzik <jeff@garzik.org>
      Cc: James Bottomley <James.Bottomley@steeleye.com>
      Cc: Ian Kent <raven@themaw.net>
      Cc: Steven French <sfrench@us.ibm.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Neil Brown <neilb@cse.unsw.edu.au>
      Cc: Jaroslav Kysela <perex@suse.cz>
      Cc: Takashi Iwai <tiwai@suse.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      5cbded58
  15. 08 12月, 2006 1 次提交
    • J
      [PATCH] autofs: fix error code path in autofs_fill_sb() · c949d4eb
      Jiri Kosina 提交于
      When kernel is compiled with old version of autofs (CONFIG_AUTOFS_FS), and
      new (observed at least with 5.x.x) automount deamon is started, kernel
      correctly reports incompatible version of kernel and userland daemon, but
      then screws things up instead of correct handling of the error:
      
       autofs: kernel does not match daemon version
       =====================================
       [ BUG: bad unlock balance detected! ]
       -------------------------------------
       automount/4199 is trying to release lock (&type->s_umount_key) at:
       [<c0163b9e>] get_sb_nodev+0x76/0xa4
       but there are no more locks to release!
      
       other info that might help us debug this:
       no locks held by automount/4199.
      
       stack backtrace:
        [<c0103b15>] dump_trace+0x68/0x1b2
        [<c0103c77>] show_trace_log_lvl+0x18/0x2c
        [<c01041db>] show_trace+0xf/0x11
        [<c010424d>] dump_stack+0x12/0x14
        [<c012e02c>] print_unlock_inbalance_bug+0xe7/0xf3
        [<c012fd4f>] lock_release+0x8d/0x164
        [<c012b452>] up_write+0x14/0x27
        [<c0163b9e>] get_sb_nodev+0x76/0xa4
        [<c0163689>] vfs_kern_mount+0x83/0xf6
        [<c016373e>] do_kern_mount+0x2d/0x3e
        [<c017513f>] do_mount+0x607/0x67a
        [<c0175224>] sys_mount+0x72/0xa4
        [<c0102b96>] sysenter_past_esp+0x5f/0x99
       DWARF2 unwinder stuck at sysenter_past_esp+0x5f/0x99
       Leftover inexact backtrace:
        =======================
      
      and then deadlock comes.
      
      The problem: autofs_fill_super() returns EINVAL to get_sb_nodev(), but
      before that, it calls kill_anon_super() to destroy the superblock which
      won't be needed.  This is however way too soon to call kill_anon_super(),
      because get_sb_nodev() has to perform its own cleanup of the superblock
      first (deactivate_super(), etc.).  The correct time to call
      kill_anon_super() is in the autofs_kill_sb() callback, which is called by
      deactivate_super() at proper time, when the superblock is ready to be
      killed.
      
      I can see the same faulty codepath also in autofs4.  This patch solves
      issues in both filesystems in a same way - it postpones the
      kill_anon_super() until the proper time is signalized by deactivate_super()
      calling the kill_sb() callback.
      
      [raven@themaw.net: update comment]
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      Acked-by: NIan Kent <raven@themaw.net>
      Cc: <stable@kernel.org>
      Signed-off-by: NIan Kent <raven@themaw.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      c949d4eb
  16. 15 11月, 2006 1 次提交
  17. 12 10月, 2006 1 次提交
  18. 27 9月, 2006 1 次提交
  19. 24 9月, 2006 1 次提交
  20. 29 3月, 2006 1 次提交
  21. 28 3月, 2006 5 次提交
  22. 23 3月, 2006 1 次提交
  23. 09 1月, 2006 1 次提交
    • E
      [PATCH] shrink dentry struct · 5160ee6f
      Eric Dumazet 提交于
      Some long time ago, dentry struct was carefully tuned so that on 32 bits
      UP, sizeof(struct dentry) was exactly 128, ie a power of 2, and a multiple
      of memory cache lines.
      
      Then RCU was added and dentry struct enlarged by two pointers, with nice
      results for SMP, but not so good on UP, because breaking the above tuning
      (128 + 8 = 136 bytes)
      
      This patch reverts this unwanted side effect, by using an union (d_u),
      where d_rcu and d_child are placed so that these two fields can share their
      memory needs.
      
      At the time d_free() is called (and d_rcu is really used), d_child is known
      to be empty and not touched by the dentry freeing.
      
      Lockless lookups only access d_name, d_parent, d_lock, d_op, d_flags (so
      the previous content of d_child is not needed if said dentry was unhashed
      but still accessed by a CPU because of RCU constraints)
      
      As dentry cache easily contains millions of entries, a size reduction is
      worth the extra complexity of the ugly C union.
      Signed-off-by: NEric Dumazet <dada1@cosmosbay.com>
      Cc: Dipankar Sarma <dipankar@in.ibm.com>
      Cc: Maneesh Soni <maneesh@in.ibm.com>
      Cc: Miklos Szeredi <miklos@szeredi.hu>
      Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
      Cc: Ian Kent <raven@themaw.net>
      Cc: Paul Jackson <pj@sgi.com>
      Cc: Al Viro <viro@ftp.linux.org.uk>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Cc: Neil Brown <neilb@cse.unsw.edu.au>
      Cc: James Morris <jmorris@namei.org>
      Cc: Stephen Smalley <sds@epoch.ncsc.mil>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      5160ee6f
  24. 07 11月, 2005 1 次提交
  25. 28 7月, 2005 1 次提交
  26. 01 5月, 2005 1 次提交
  27. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4