1. 15 5月, 2008 2 次提交
    • E
      9p: Documentation updates · ee443996
      Eric Van Hensbergen 提交于
      The kernel-doc comments of much of the 9p system have been in disarray since
      reorganization.  This patch fixes those problems, adds additional documentation
      and a template book which collects the 9p information.
      Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
      ee443996
    • M
      add match_strlcpy() us it to make v9fs make uname and remotename parsing more robust · b32a09db
      Markus Armbruster 提交于
      match_strcpy() is a somewhat creepy function: the caller needs to make sure
      that the destination buffer is big enough, and when he screws up or
      forgets, match_strcpy() happily overruns the buffer.
      
      There's exactly one customer: v9fs_parse_options().  I believe it currently
      can't overflow its buffer, but that's not exactly obvious.
      
      The source string is a substing of the mount options.  The kernel silently
      truncates those to PAGE_SIZE bytes, including the terminating zero.  See
      compat_sys_mount() and do_mount().
      
      The destination buffer is obtained from __getname(), which allocates from
      name_cachep, which is initialized by vfs_caches_init() for size PATH_MAX.
      
      We're safe as long as PATH_MAX <= PAGE_SIZE.  PATH_MAX is 4096.  As far as
      I know, the smallest PAGE_SIZE is also 4096.
      
      Here's a patch that makes the code a bit more obviously correct.  It
      doesn't depend on PATH_MAX <= PAGE_SIZE.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Cc: Latchesar Ionkov <lucho@ionkov.net>
      Cc: Jim Meyering <meyering@redhat.com>
      Cc: "Randy.Dunlap" <rdunlap@xenotime.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NEric Van Hensbergen <ericvh@gmail.com>
      b32a09db
  2. 13 5月, 2008 11 次提交
  3. 12 5月, 2008 5 次提交
    • L
      Add new 'cond_resched_bkl()' helper function · c3921ab7
      Linus Torvalds 提交于
      It acts exactly like a regular 'cond_resched()', but will not get
      optimized away when CONFIG_PREEMPT is set.
      
      Normal kernel code is already preemptable in the presense of
      CONFIG_PREEMPT, so cond_resched() is optimized away (see commit
      02b67cc3 "sched: do not do
      cond_resched() when CONFIG_PREEMPT").
      
      But when wanting to conditionally reschedule while holding a lock, you
      need to use "cond_sched_lock(lock)", and the new function is the BKL
      equivalent of that.
      
      Also make fs/locks.c use it.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c3921ab7
    • S
      [CIFS] don't allow demultiplex thread to exit until kthread_stop is called · e691b9d1
      Steve French 提交于
      cifs_demultiplex_thread can exit under several conditions:
      
      1) if it's signaled
      2) if there's a problem with session setup
      3) if kthread_stop is called on it
      
      The first two are problems. If kthread_stop is called on the thread,
      there is no guarantee that it will still be up. We need to have the
      thread stay up until kthread_stop is called on it.
      
      One option would be to not even try to tear things down until after
      kthread_stop is called. However, in the case where there is a problem
      setting up the session, there's no real reason to try continuing the
      loop.
      
      This patch allows the thread to clean up and prepare for exit under all
      three conditions, but it has the thread go to sleep until kthread_stop
      is called. This allows us to simplify the shutdown code somewhat since
      we can be reasonably sure that the thread won't exit after being
      signaled but before kthread_stop is called.
      
      It also removes the places where the thread itself set the tsk variable
      since it appeared that it could have a potential race where the thread
      might never be shut down.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Acked-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      e691b9d1
    • J
      [CIFS] when not using unix extensions, check for and set ATTR_READONLY on create and mkdir · 67750fb9
      Jeff Layton 提交于
      When creating a directory on a CIFS share without POSIX extensions,
      and the given mode has no write bits set, set the ATTR_READONLY bit.
      
      When creating a file, set ATTR_READONLY if the create mode has no write
      bits set and we're not using unix extensions.
      
      There are some comments about this being problematic due to the VFS
      splitting creates into 2 parts. I'm not sure what that's actually
      talking about, but I'm assuming that it has something to do with how
      mknod is implemented. In the simple case where we have no unix
      extensions and we're just creating a regular file, there's no reason
      we can't set ATTR_READONLY.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      67750fb9
    • J
      [CIFS] add local struct inode pointer to cifs_setattr · 02eadeff
      Jeff Layton 提交于
      Clean up cifs_setattr a bit by adding a local inode pointer, and
      changing all of the direntry->d_inode references to it. This also adds a
      bit of micro-optimization. d_inode shouldn't change over the life of
      this function, so we only need to dereference it once.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      02eadeff
    • C
      [CIFS] cifs_find_tcp_session cleanup · 1b20d672
      Cyrill Gorcunov 提交于
      This patch cleans up cifs_find_tcp_session so it become
      less indented. Also the error of skipping IPv6 matched
      addresses fixed.
      Signed-off-by: NCyrill Gorcunov <gorcunov@gmail.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      1b20d672
  4. 09 5月, 2008 4 次提交
  5. 08 5月, 2008 2 次提交
  6. 07 5月, 2008 10 次提交
  7. 05 5月, 2008 1 次提交
  8. 04 5月, 2008 1 次提交
    • U
      unified (weak) sys_pipe implementation · d35c7b0e
      Ulrich Drepper 提交于
      This replaces the duplicated arch-specific versions of "sys_pipe()" with
      one unified implementation.  This removes almost 250 lines of duplicated
      code.
      
      It's marked __weak, so that *if* an architecture wants to override the
      default implementation it can do so by simply having its own replacement
      version, since many architectures use alternate calling conventions for
      the 'pipe()' system call for legacy reasons (ie traditional UNIX
      implementations often return the two file descriptors in registers)
      
      I still haven't changed the cris version even though Linus says the BKL
      isn't needed.  The arch maintainer can easily do it if there are really
      no obstacles.
      Signed-off-by: NUlrich Drepper <drepper@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d35c7b0e
  9. 03 5月, 2008 1 次提交
  10. 02 5月, 2008 3 次提交