1. 02 10月, 2006 7 次提交
    • E
      [PATCH] proc: Remove the hard coded inode numbers · 61a28784
      Eric W. Biederman 提交于
      The hard coded inode numbers in proc currently limit its maintainability,
      its flexibility, and what can be done with the rest of system.  /proc limits
      pid-max to 32768 on 32 bit systems it limits fd-max to 32768 on all systems,
      and placing the pid in the inode number really gets in the way of implementing
      subdirectories of per process information.
      
      Ever since people started adding to the middle of the file type enumeration we
      haven't been maintaing the historical inode numbers, all we have really
      succeeded in doing is keeping the pid in the proc inode number.  The pid is
      already available in the directory name so no information is lost removing it
      from the inode number.
      
      So if something in user space cares if we remove the inode number from the
      /proc inode it is almost certainly broken.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      61a28784
    • E
      [PATCH] proc: Factor out an instantiate method from every lookup method · 444ceed8
      Eric W. Biederman 提交于
      To remove the hard coded proc inode numbers it is necessary to be able to
      create the proc inodes during readdir.  The instantiate methods are the subset
      of lookup that is needed to accomplish that.
      
      This first step just splits the lookup methods into 2 functions.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      444ceed8
    • E
      [PATCH] proc: Make the generation of the self symlink table driven · 801199ce
      Eric W. Biederman 提交于
      This patch generalizes the concept of files in /proc that are related to
      processes but live in the root directory of /proc
      
      Ideally this would reuse infrastructure from the rest of the process specific
      parts of proc but unfortunately security_task_to_inode must not be called on
      files that are not strictly per process.  security_task_to_inode really needs
      to be reexamined as the security label can change in important places that we
      are not currently catching, but I'm not certain that simplifies this problem.
      
      By at least matching the structure of the rest of proc we get more idiom reuse
      and it becomes easier to spot problems in the way things are put together.
      
      Later things like /proc/mounts are likely to be moved into proc_base as well.
      If union mounts are ever supported we may be able to make /proc a union mount,
      and properly split it into 2 filesystems.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      801199ce
    • S
      [PATCH] namespaces: incorporate fs namespace into nsproxy · 1651e14e
      Serge E. Hallyn 提交于
      This moves the mount namespace into the nsproxy.  The mount namespace count
      now refers to the number of nsproxies point to it, rather than the number of
      tasks.  As a result, the unshare_namespace() function in kernel/fork.c no
      longer checks whether it is being shared.
      Signed-off-by: NSerge Hallyn <serue@us.ibm.com>
      Cc: Kirill Korotaev <dev@openvz.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Herbert Poetzl <herbert@13thfloor.at>
      Cc: Andrey Savochkin <saw@sw.ru>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      1651e14e
    • E
      [PATCH] proc: modify proc_pident_lookup to be completely table driven · 20cdc894
      Eric W. Biederman 提交于
      Currently proc_pident_lookup gets the names and types from a table and then
      has a huge switch statement to get the inode and file operations it needs.
      That is silly and is becoming increasingly hard to maintain so I just put all
      of the information in the table.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      20cdc894
    • E
      [PATCH] proc: reorder the functions in base.c · 28a6d671
      Eric W. Biederman 提交于
      There were enough changes in my last round of cleaning up proc I had to break
      up the patch series into smaller chunks, and my last chunk never got resent.
      
      This patchset gives proc dynamic inode numbers (the static inode numbers were
      a pain to maintain and prevent all kinds of things), and removes the horrible
      switch statements that had to be kept in sync with everything else.  Being
      fully table driver takes us 90% of the way of being able to register new
      process specific attributes in proc.
      
      This patch:
      
      Group the functions by what they implement instead of by type of operation.
      As it existed base.c was quickly approaching the point where it could not be
      followed.
      
      No functionality or code changes asside from adding/removing forward
      declartions are implemented in this patch.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      28a6d671
    • E
      [PATCH] proc: readdir race fix (take 3) · 0804ef4b
      Eric W. Biederman 提交于
      The problem: An opendir, readdir, closedir sequence can fail to report
      process ids that are continually in use throughout the sequence of system
      calls.  For this race to trigger the process that proc_pid_readdir stops at
      must exit before readdir is called again.
      
      This can cause ps to fail to report processes, and it is in violation of
      posix guarantees and normal application expectations with respect to
      readdir.
      
      Currently there is no way to work around this problem in user space short
      of providing a gargantuan buffer to user space so the directory read all
      happens in on system call.
      
      This patch implements the normal directory semantics for proc, that
      guarantee that a directory entry that is neither created nor destroyed
      while reading the directory entry will be returned.  For directory that are
      either created or destroyed during the readdir you may or may not see them.
       Furthermore you may seek to a directory offset you have previously seen.
      
      These are the guarantee that ext[23] provides and that posix requires, and
      more importantly that user space expects.  Plus it is a simple semantic to
      implement reliable service.  It is just a matter of calling readdir a
      second time if you are wondering if something new has show up.
      
      These better semantics are implemented by scanning through the pids in
      numerical order and by making the file offset a pid plus a fixed offset.
      
      The pid scan happens on the pid bitmap, which when you look at it is
      remarkably efficient for a brute force algorithm.  Given that a typical
      cache line is 64 bytes and thus covers space for 64*8 == 200 pids.  There
      are only 40 cache lines for the entire 32K pid space.  A typical system
      will have 100 pids or more so this is actually fewer cache lines we have to
      look at to scan a linked list, and the worst case of having to scan the
      entire pid bitmap is pretty reasonable.
      
      If we need something more efficient we can go to a more efficient data
      structure for indexing the pids, but for now what we have should be
      sufficient.
      
      In addition this takes no additional locks and is actually less code than
      what we are doing now.
      
      Also another very subtle bug in this area has been fixed.  It is possible
      to catch a task in the middle of de_thread where a thread is assuming the
      thread of it's thread group leader.  This patch carefully handles that case
      so if we hit it we don't fail to return the pid, that is undergoing the
      de_thread dance.
      
      Thanks to KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> for
      providing the first fix, pointing this out and working on it.
      
      [oleg@tv-sign.ru: fix it]
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Acked-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Cc: Jean Delvare <jdelvare@suse.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      0804ef4b
  2. 30 9月, 2006 1 次提交
  3. 16 7月, 2006 1 次提交
  4. 15 7月, 2006 2 次提交
  5. 01 7月, 2006 1 次提交
  6. 27 6月, 2006 27 次提交
  7. 20 6月, 2006 1 次提交