1. 23 7月, 2012 6 次提交
  2. 22 7月, 2012 4 次提交
  3. 19 7月, 2012 2 次提交
    • L
      Make wait_for_device_probe() also do scsi_complete_async_scans() · eea03c20
      Linus Torvalds 提交于
      Commit a7a20d10 ("sd: limit the scope of the async probe domain")
      make the SCSI device probing run device discovery in it's own async
      domain.
      
      However, as a result, the partition detection was no longer synchronized
      by async_synchronize_full() (which, despite the name, only synchronizes
      the global async space, not all of them).  Which in turn meant that
      "wait_for_device_probe()" would not wait for the SCSI partitions to be
      parsed.
      
      And "wait_for_device_probe()" was what the boot time init code relied on
      for mounting the root filesystem.
      
      Now, most people never noticed this, because not only is it
      timing-dependent, but modern distributions all use initrd.  So the root
      filesystem isn't actually on a disk at all.  And then before they
      actually mount the final disk filesystem, they will have loaded the
      scsi-wait-scan module, which not only does the expected
      wait_for_device_probe(), but also does scsi_complete_async_scans().
      
      [ Side note: scsi_complete_async_scans() had also been partially broken,
        but that was fixed in commit 43a8d39d ("fix async probe
        regression"), so that same commit a7a20d10 had actually broken
        setups even if you used scsi-wait-scan explicitly ]
      
      Solve this problem by just moving the scsi_complete_async_scans() call
      into wait_for_device_probe().  Everybody who wants to wait for device
      probing to finish really wants the SCSI probing to complete, so there's
      no reason not to do this.
      
      So now "wait_for_device_probe()" really does what the name implies, and
      properly waits for device probing to finish.  This also removes the now
      unnecessary extra calls to scsi_complete_async_scans().
      Reported-and-tested-by: NArtem S. Tashkinov <t.artem@mailcity.com>
      Cc: Dan Williams <dan.j.williams@gmail.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: James Bottomley <jbottomley@parallels.com>
      Cc: Borislav Petkov <bp@amd64.org>
      Cc: linux-scsi <linux-scsi@vger.kernel.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      eea03c20
    • R
      PM / Sleep: Require CAP_BLOCK_SUSPEND to use wake_lock/wake_unlock · 11388c87
      Rafael J. Wysocki 提交于
      Require processes wanting to use the wake_lock/wake_unlock sysfs
      files to have the CAP_BLOCK_SUSPEND capability, which also is
      required for the eventpoll EPOLLWAKEUP flag to be effective, so that
      all interfaces related to blocking autosleep depend on the same
      capability.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Cc: stable@vger.kernel.org
      Acked-by: NMichael Kerrisk <mtk.man-pages@gmail.com>
      11388c87
  4. 17 7月, 2012 1 次提交
  5. 15 7月, 2012 8 次提交
  6. 14 7月, 2012 4 次提交
    • D
      VFS: Pass mount flags to sget() · 9249e17f
      David Howells 提交于
      Pass mount flags to sget() so that it can use them in initialising a new
      superblock before the set function is called.  They could also be passed to the
      compare function.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      9249e17f
    • D
      VFS: Make clone_mnt()/copy_tree()/collect_mounts() return errors · be34d1a3
      David Howells 提交于
      copy_tree() can theoretically fail in a case other than ENOMEM, but always
      returns NULL which is interpreted by callers as -ENOMEM.  Change it to return
      an explicit error.
      
      Also change clone_mnt() for consistency and because union mounts will add new
      error cases.
      
      Thanks to Andreas Gruenbacher <agruen@suse.de> for a bug fix.
      [AV: folded braino fix by Dan Carpenter]
      
      Original-author: Valerie Aurora <vaurora@redhat.com>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Cc: Valerie Aurora <valerie.aurora@gmail.com>
      Cc: Andreas Gruenbacher <agruen@suse.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      be34d1a3
    • A
      get rid of kern_path_parent() · 79714f72
      Al Viro 提交于
      all callers want the same thing, actually - a kinda-sorta analog of
      kern_path_create().  I.e. they want parent vfsmount/dentry (with
      ->i_mutex held, to make sure the child dentry is still their child)
      + the child dentry.
      
      Signed-off-by Al Viro <viro@zeniv.linux.org.uk>
      79714f72
    • A
      stop passing nameidata to ->lookup() · 00cd8dd3
      Al Viro 提交于
      Just the flags; only NFS cares even about that, but there are
      legitimate uses for such argument.  And getting rid of that
      completely would require splitting ->lookup() into a couple
      of methods (at least), so let's leave that alone for now...
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      00cd8dd3
  7. 12 7月, 2012 8 次提交
  8. 10 7月, 2012 2 次提交
  9. 08 7月, 2012 2 次提交
    • T
      cgroup: fix cgroup hierarchy umount race · 5db9a4d9
      Tejun Heo 提交于
      48ddbe19 "cgroup: make css->refcnt clearing on cgroup removal
      optional" allowed a css to linger after the associated cgroup is
      removed.  As a css holds a reference on the cgroup's dentry, it means
      that cgroup dentries may linger for a while.
      
      Destroying a superblock which has dentries with positive refcnts is a
      critical bug and triggers BUG() in vfs code.  As each cgroup dentry
      holds an s_active reference, any lingering cgroup has both its dentry
      and the superblock pinned and thus preventing premature release of
      superblock.
      
      Unfortunately, after 48ddbe19, there's a small window while
      releasing a cgroup which is directly under the root of the hierarchy.
      When a cgroup directory is released, vfs layer first deletes the
      corresponding dentry and then invokes dput() on the parent, which may
      recurse further, so when a cgroup directly below root cgroup is
      released, the cgroup is first destroyed - which releases the s_active
      it was holding - and then the dentry for the root cgroup is dput().
      
      This creates a window where the root dentry's refcnt isn't zero but
      superblock's s_active is.  If umount happens before or during this
      window, vfs will see the root dentry with non-zero refcnt and trigger
      BUG().
      
      Before 48ddbe19, this problem didn't exist because the last dentry
      reference was guaranteed to be put synchronously from rmdir(2)
      invocation which holds s_active around the whole process.
      
      Fix it by holding an extra superblock->s_active reference across
      dput() from css release, which is the dput() path added by 48ddbe19
      and the only one which doesn't hold an extra s_active ref across the
      final cgroup dput().
      Signed-off-by: NTejun Heo <tj@kernel.org>
      LKML-Reference: <4FEEA5CB.8070809@huawei.com>
      Reported-by: Nshyju pv <shyju.pv@huawei.com>
      Tested-by: Nshyju pv <shyju.pv@huawei.com>
      Cc: Sasha Levin <levinsasha928@gmail.com>
      Acked-by: NLi Zefan <lizefan@huawei.com>
      5db9a4d9
    • T
      Revert "cgroup: superblock can't be released with active dentries" · 7db5b3ca
      Tejun Heo 提交于
      This reverts commit fa980ca8.  The
      commit was an attempt to fix a race condition where a cgroup hierarchy
      may be unmounted with positive dentry reference on root cgroup.  While
      the commit made the race condition slightly more difficult to trigger,
      the race was still there and could be reliably triggered using a
      different test case.
      
      Revert the incorrect fix.  The next commit will describe the race and
      fix it correctly.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      LKML-Reference: <4FEEA5CB.8070809@huawei.com>
      Reported-by: Nshyju pv <shyju.pv@huawei.com>
      Cc: Sasha Levin <levinsasha928@gmail.com>
      Acked-by: NLi Zefan <lizefan@huawei.com>
      7db5b3ca
  10. 07 7月, 2012 3 次提交
    • K
      kmsg: make sure all messages reach a newly registered boot console · 68b6507d
      Kay Sievers 提交于
      We suppress printing kmsg records to the console, which are already printed
      immediately while we have received their fragments.
      
      Newly registered boot consoles print the entire kmsg buffer during
      registration. Clear the console-suppress flag after we skipped the record
      during its first storage, so any later print will see these records as usual.
      Signed-off-by: NKay Sievers <kay@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      68b6507d
    • K
      kmsg: properly handle concurrent non-blocking read() from /proc/kmsg · cb424ffe
      Kay Sievers 提交于
      The /proc/kmsg read() interface is internally simply wired up to a sequence
      of syslog() syscalls, which might are racy between their checks and actions,
      regarding concurrency.
      
      In the (very uncommon) case of concurrent readers of /dev/kmsg, relying on
      usual O_NONBLOCK behavior, the recently introduced mutex might block an
      O_NONBLOCK reader in read(), when poll() returns for it, but another process
      has already read the data in the meantime. We've seen that while running
      artificial test setups and tools that "fight" about /proc/kmsg data.
      
      This restores the original /proc/kmsg behavior, where in case of concurrent
      read()s, poll() might wake up but the read() syscall will just return 0 to
      the caller, while another process has "stolen" the data.
      
      This is in the general case not the expected behavior, but it is the exact
      same one, that can easily be triggered with a 3.4 kernel, and some tools
      might just rely on it.
      
      The mutex is not needed, the original integrity issue which introduced it,
      is in the meantime covered by:
        "fill buffer with more than a single message for SYSLOG_ACTION_READ"
        116e90b2
      
      Cc: Yuanhan Liu <yuanhan.liu@linux.intel.com>
      Acked-by: NJan Beulich <jbeulich@suse.com>
      Signed-off-by: NKay Sievers <kay@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cb424ffe
    • K
      kmsg: add the facility number to the syslog prefix · 43a73a50
      Kay Sievers 提交于
      After the recent split of facility and level into separate variables,
      we miss the facility value (always 0 for kernel-originated messages)
      in the syslog prefix.
      
      On Tue, Jul 3, 2012 at 12:45 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
      > Static checkers complain about the impossible condition here.
      >
      > In 084681d1 ('printk: flush continuation lines immediately to
      > console'), we changed msg->level from being a u16 to being an unsigned
      > 3 bit bitfield.
      
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NKay Sievers <kay@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      43a73a50