1. 12 7月, 2007 6 次提交
  2. 13 6月, 2007 3 次提交
  3. 22 5月, 2007 1 次提交
    • A
      Detach sched.h from mm.h · e8edc6e0
      Alexey Dobriyan 提交于
      First thing mm.h does is including sched.h solely for can_do_mlock() inline
      function which has "current" dereference inside. By dealing with can_do_mlock()
      mm.h can be detached from sched.h which is good. See below, why.
      
      This patch
      a) removes unconditional inclusion of sched.h from mm.h
      b) makes can_do_mlock() normal function in mm/mlock.c
      c) exports can_do_mlock() to not break compilation
      d) adds sched.h inclusions back to files that were getting it indirectly.
      e) adds less bloated headers to some files (asm/signal.h, jiffies.h) that were
         getting them indirectly
      
      Net result is:
      a) mm.h users would get less code to open, read, preprocess, parse, ... if
         they don't need sched.h
      b) sched.h stops being dependency for significant number of files:
         on x86_64 allmodconfig touching sched.h results in recompile of 4083 files,
         after patch it's only 3744 (-8.3%).
      
      Cross-compile tested on
      
      	all arm defconfigs, all mips defconfigs, all powerpc defconfigs,
      	alpha alpha-up
      	arm
      	i386 i386-up i386-defconfig i386-allnoconfig
      	ia64 ia64-up
      	m68k
      	mips
      	parisc parisc-up
      	powerpc powerpc-up
      	s390 s390-up
      	sparc sparc-up
      	sparc64 sparc64-up
      	um-x86_64
      	x86_64 x86_64-up x86_64-defconfig x86_64-allnoconfig
      
      as well as my two usual configs.
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e8edc6e0
  4. 10 5月, 2007 1 次提交
  5. 03 5月, 2007 2 次提交
  6. 28 4月, 2007 3 次提交
  7. 16 3月, 2007 2 次提交
    • A
      [PATCH] sysfs: reinstate exclusion between method calls and attribute unregistration · e7b0d26a
      Alan Stern 提交于
      This patch (as869) reinstates the mutual exclusion between sysfs
      attribute method calls and attribute unregistration.  The
      previously-reported deadlocks have been fixed, and this exclusion is
      by far the simplest way to avoid races during driver unbinding.
      
      The check for orphaned read-buffers has been moved down slightly, so
      that the remainder of a partially-read buffer will still be available
      to userspace even after the attribute has been unregistered.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: Hugh Dickins <hugh@veritas.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Oliver Neukum <oneukum@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e7b0d26a
    • A
      [PATCH] sysfs and driver core: add callback helper, used by SCSI and S390 · d9a9cdfb
      Alan Stern 提交于
      This patch (as868) adds a helper routine for device drivers that need
      to set up a callback to perform some action in a different process's
      context.  This is intended for use by attribute methods that want to
      unregister themselves or their parent device.  Attribute method calls
      are mutually exclusive with unregistration, so such actions cannot be
      taken directly.
      
      Two attribute methods are converted to use the new helper routine: one
      for SCSI device deletion and one for System/390 ccwgroup devices.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: Hugh Dickins <hugh@veritas.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Oliver Neukum <oneukum@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d9a9cdfb
  8. 07 3月, 2007 2 次提交
    • H
      [PATCH] suspend regression: sysfs deadlock · 266d4f40
      Hugh Dickins 提交于
      Suspend deadlocks when trying to unregister /sys/block/sr0.
      
      This comes from Oliver's commit 94bebf4d
      "Driver core: fix race in sysfs between sysfs_remove_file() and
      read()/write()".
      
      sysfs_write_file downs buffer->sem while calling flush_write_buffer, and
      flushing that particular write buffer entails downing buffer->sem in
      orphan_all_buffers, resulting in the obvious self-deadlock.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      266d4f40
    • M
      [PATCH] Fix 2.6.21 rfcomm lockups · 0de1517e
      Mark Lord 提交于
      Any attempt to open/use a bluetooth rfcomm device locks up
      scheduling completely on my machine.
      
      Interrupts (ping, alt-sysrq) seem to be alive, but nothing else.
      
      This was working fine in 2.6.20, broken now in 2.6.21-rc2-git*
      
      Reverting this change (below) fixes it:
      
      | author    Marcel Holtmann <marcel@holtmann.org>
      |      Sat, 17 Feb 2007 22:58:57 +0000 (23:58 +0100)
      | committer    David S. Miller <davem@sunset.davemloft.net>
      |      Mon, 26 Feb 2007 19:42:41 +0000 (11:42 -0800)
      | commit    c1a33136
      | tree    337a876f727061362b6a169f8759849c105b8f7a    tree | snapshot
      | parent    f5ffd462    commit | diff
      | | [Bluetooth] Make use of device_move() for RFCOMM TTY devices
      | | In the case of bound RFCOMM TTY devices the parent is not available
      | before its usage. So when opening a RFCOMM TTY device, move it to
      | the corresponding ACL device as a child. When closing the device,
      | move it back to the virtual device tree.
      | Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
      
      The simplest fix for this bug is to prevent sysfs_move_dir()
      from self-deadlocking when (old_parent == new_parent).
      
      This patch prevents total system lockup when using rfcomm devices.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Acked-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0de1517e
  9. 24 2月, 2007 2 次提交
  10. 17 2月, 2007 1 次提交
  11. 13 2月, 2007 2 次提交
  12. 12 2月, 2007 1 次提交
  13. 08 2月, 2007 6 次提交
    • E
      sysfs: Shadow directory support · b592fcfe
      Eric W. Biederman 提交于
      The problem.  When implementing a network namespace I need to be able
      to have multiple network devices with the same name.  Currently this
      is a problem for /sys/class/net/*. 
      
      What I want is a separate /sys/class/net directory in sysfs for each
      network namespace, and I want to name each of them /sys/class/net.
      
      I looked and the VFS actually allows that.  All that is needed is
      for /sys/class/net to implement a follow link method to redirect
      lookups to the real directory you want. 
      
      Implementing a follow link method that is sensitive to the current
      network namespace turns out to be 3 lines of code so it looks like a
      clean approach.  Modifying sysfs so it doesn't get in my was is a bit
      trickier. 
      
      I am calling the concept of multiple directories all at the same path
      in the filesystem shadow directories.  With the directory entry really
      at that location the shadow master. 
      
      The following patch modifies sysfs so it can handle a directory
      structure slightly different from the kobject tree so I can implement
      the shadow directories for handling /sys/class/net/.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Cc: Maneesh Soni <maneesh@in.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b592fcfe
    • O
      sysfs: error handling in sysfs, fill_read_buffer() · 82244b16
      Oliver Neukum 提交于
      if a driver returns an error in fill_read_buffer(), the buffer will be
      marked as filled. Subsequent reads will return eof. But there is
      no data because of an error, not because it has been read.
      Not marking the buffer filled is the obvious fix.
      Signed-off-by: NOliver Neukum <oliver@neukum.name>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      82244b16
    • M
      sysfs: kobject_put cleanup · f7506536
      Mariusz Kozlowski 提交于
      This patch removes redundant argument checks for kobject_put().
      Signed-off-by: NMariusz Kozlowski <m.kozlowski@tuxland.pl>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      f7506536
    • F
      sysfs: suppress lockdep warnings · d3fc373a
      Frederik Deweerdt 提交于
      Lockdep issues the following warning:
      [    9.064000] =============================================
      [    9.064000] [ INFO: possible recursive locking detected ]
      [    9.064000] 2.6.20-rc3-mm1 #3
      [    9.064000] ---------------------------------------------
      [    9.064000] init/1 is trying to acquire lock:
      [    9.064000]  (&sysfs_inode_imutex_key){--..}, at: [<c03e6afc>] mutex_lock+0x1c/0x1f
      [    9.064000]
      [    9.064000] but task is already holding lock:
      [    9.064000]  (&sysfs_inode_imutex_key){--..}, at: [<c03e6afc>] mutex_lock+0x1c/0x1f
      [    9.065000]
      [    9.065000] other info that might help us debug this:
      [    9.065000] 2 locks held by init/1:
      [    9.065000]  #0:  (tty_mutex){--..}, at: [<c03e6afc>] mutex_lock+0x1c/0x1f
      [    9.065000]  #1:  (&sysfs_inode_imutex_key){--..}, at: [<c03e6afc>] mutex_lock+0x1c/0x1f
      [    9.065000]
      [    9.065000] stack backtrace:
      [    9.065000]  [<c010390d>] show_trace_log_lvl+0x1a/0x30
      [    9.066000]  [<c0103935>] show_trace+0x12/0x14
      [    9.066000]  [<c0103a2f>] dump_stack+0x16/0x18
      [    9.066000]  [<c0138cb8>] print_deadlock_bug+0xb9/0xc3
      [    9.066000]  [<c0138d17>] check_deadlock+0x55/0x5a
      [    9.066000]  [<c013a953>] __lock_acquire+0x371/0xbf0
      [    9.066000]  [<c013b7a9>] lock_acquire+0x69/0x83
      [    9.066000]  [<c03e6b7e>] __mutex_lock_slowpath+0x75/0x2d1
      [    9.066000]  [<c03e6afc>] mutex_lock+0x1c/0x1f
      [    9.066000]  [<c01b249c>] sysfs_drop_dentry+0xb1/0x133
      [    9.066000]  [<c01b25d1>] sysfs_hash_and_remove+0xb3/0x142
      [    9.066000]  [<c01b30ed>] sysfs_remove_file+0xd/0x10
      [    9.067000]  [<c02849e0>] device_remove_file+0x23/0x2e
      [    9.067000]  [<c02850b2>] device_del+0x188/0x1e6
      [    9.067000]  [<c028511b>] device_unregister+0xb/0x15
      [    9.067000]  [<c0285318>] device_destroy+0x9c/0xa9
      [    9.067000]  [<c0261431>] vcs_remove_sysfs+0x1c/0x3b
      [    9.067000]  [<c0267a08>] con_close+0x5e/0x6b
      [    9.067000]  [<c02598f2>] release_dev+0x4c4/0x6e5
      [    9.067000]  [<c0259faa>] tty_release+0x12/0x1c
      [    9.067000]  [<c0174872>] __fput+0x177/0x1a0
      [    9.067000]  [<c01746f5>] fput+0x3b/0x41
      [    9.068000]  [<c0172ee1>] filp_close+0x36/0x65
      [    9.068000]  [<c0172f73>] sys_close+0x63/0xa4
      [    9.068000]  [<c0102a96>] sysenter_past_esp+0x5f/0x99
      [    9.068000]  =======================
      
      This is due to sysfs_hash_and_remove() holding dir->d_inode->i_mutex
      before calling sysfs_drop_dentry() which calls orphan_all_buffers()
      which in turn takes node->i_mutex.
      Signed-off-by: NFrederik Deweerdt <frederik.deweerdt@gmail.com>
      Cc: Oliver Neukum <oliver@neukum.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d3fc373a
    • O
      Driver core: fix race in sysfs between sysfs_remove_file() and read()/write() · 94bebf4d
      Oliver Neukum 提交于
      This patch prevents a race between IO and removing a file from sysfs.
      It introduces a list of sysfs_buffers associated with a file at the inode.
      Upon removal of a file the list is walked and the buffers marked orphaned.
      IO to orphaned buffers fails with -ENODEV. The driver can safely free
      associated data structures or be unloaded.
      Signed-off-by: NOliver Neukum <oliver@neukum.name>
      Acked-by: NManeesh Soni <maneesh@in.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      94bebf4d
    • C
      driver core: Allow device_move(dev, NULL). · c744aeae
      Cornelia Huck 提交于
      If we allow NULL as the new parent in device_move(), we need to make sure
      that the device is placed into the same place as it would if it was
      newly registered:
      
      - Consider the device virtual tree. In order to be able to reuse code,
        setup_parent() has been tweaked a bit.
      - kobject_move() can fall back to the kset's kobject.
      - sysfs_move_dir() uses the sysfs root dir as fallback.
      Signed-off-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c744aeae
  14. 09 12月, 2006 1 次提交
  15. 08 12月, 2006 1 次提交
  16. 02 12月, 2006 2 次提交
  17. 19 10月, 2006 2 次提交
    • H
      sysfs: update obsolete comment in sysfs_update_file · 97a50184
      Hidetoshi Seto 提交于
      And the obsolete comment should be updated (or totally removed).
      Signed-off-by: NHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      97a50184
    • H
      sysfs: remove duplicated dput in sysfs_update_file · e4234451
      Hidetoshi Seto 提交于
      Following function can drops d_count twice against one reference
      by lookup_one_len.
      
      <SOURCE>
      /**
       * sysfs_update_file - update the modified timestamp on an object attribute.
       * @kobj: object we're acting for.
       * @attr: attribute descriptor.
       */
      int sysfs_update_file(struct kobject * kobj, const struct attribute * attr)
      {
              struct dentry * dir = kobj->dentry;
              struct dentry * victim;
              int res = -ENOENT;
      
              mutex_lock(&dir->d_inode->i_mutex);
              victim = lookup_one_len(attr->name, dir, strlen(attr->name));
              if (!IS_ERR(victim)) {
                      /* make sure dentry is really there */
                      if (victim->d_inode &&
                          (victim->d_parent->d_inode == dir->d_inode)) {
                              victim->d_inode->i_mtime = CURRENT_TIME;
                              fsnotify_modify(victim);
      
                              /**
                               * Drop reference from initial sysfs_get_dentry().
                               */
                              dput(victim);
                              res = 0;
                      } else
                              d_drop(victim);
      
                      /**
                       * Drop the reference acquired from sysfs_get_dentry() above.
                       */
                      dput(victim);
              }
              mutex_unlock(&dir->d_inode->i_mutex);
      
              return res;
      }
      </SOURCE>
      
      PCI-hotplug (drivers/pci/hotplug/pci_hotplug_core.c) is only user of
      this function. I confirmed that dentry of /sys/bus/pci/slots/XXX/*
      have negative d_count value.
      
      This patch removes unnecessary dput().
      Signed-off-by: NHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
      Acked-by: NManeesh Soni <maneesh@in.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e4234451
  18. 03 10月, 2006 1 次提交
  19. 01 10月, 2006 1 次提交