28 Feb, 2013
40 commits
-
AIX formatted disks do not always have the MSDOS 55aa signature.
This happens e.g. for unbootable AIX disks.Up to now, such disks were not recognized as AIX disks, because of the
missing 55aa. Fix that by inverting the two tests. Let's first
check for the AIX magic strings, and only if that fails check for
the MSDOS magic word.Signed-off-by: Philippe De Muyter
Cc: Andreas Mohr
Cc: OGAWA Hirofumi
Cc: Jens Axboe
Cc: Olaf Hering
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
If the minor number is assigned dynamically, there is no need to search
for misc->minor in misc_list, since misc->minor == MISC_DYNAMIC_MINOR.[akpm@linux-foundation.org: reduce scope of local `c']
Signed-off-by: Dae S. Kim
Cc: Arnd Bergmann
Cc: Greg KH
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add try... parameters to disable pci and platform (openfirmware) device
scanning for IPMI. Also add docs for all the try... parameters.Signed-off-by: Corey Minyard
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
The configuration change building ipmi_si into the kernel precludes the
use of a custom driver that can utilize more than one KCS interface,
multiple IPMBs, and more than one BMC. This capability is important for
fault-tolerant systems.Even if the kernel option ipmi_si.trydefaults=0 is specified, ipmi_si
discovers and claims one of the KCS interfaces on a Stratus server. The
inability to now prevent the kernel from managing this device is a
regression from previous kernels. The regression breaks a capability
fault-tolerant vendors have relied upon.To support both ACPI opregion access and the need to avoid activation of
ipmi_si on some platforms, we've added two new kernel options,
ipmi_si.tryacpi and ipmi_si.trydmi be added to prevent ipmi_si from
initializing when these options are set to 0 on the kernel command line.
With these options at the default value of 1, ipmi_si init proceeds
according to the kernel default.Tested-by: Jim Paradis
Signed-off-by: Robert Evans
Signed-off-by: Jim Paradis
Signed-off-by: Tony Camuso
Signed-off-by: Corey Minyard
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Given the obvious distinction between kernel and userspace supported
by uapi/, it seems unnecessary to comment on that.Signed-off-by: Robert P. J. Day
Signed-off-by: Corey Minyard
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Until recently, when an negative ID is specified, idr functions used to
ignore the sign bit and proceeded with the operation with the rest of
bits, which is bizarre and error-prone. The behavior recently got changed
so that negative IDs are treated as invalid but we're triggering
WARN_ON_ONCE() on negative IDs just in case somebody was depending on the
sign bit being ignored, so that those can be detected and fixed easily.We only need this for a while. Explain why WARN_ON_ONCE()s are there and
that they can be removed later.Signed-off-by: Tejun Heo
Acked-by: Thomas Gleixner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
While idr lookup isn't a particularly heavy operation, it still is too
substantial to use in hot paths without worrying about the performance
implications. With recent changes, each idr_layer covers 256 slots
which should be enough to cover most use cases with single idr_layer
making lookup hint very attractive.This patch adds idr->hint which points to the idr_layer which
allocated an ID most recently and the fast path lookup becomesif (look up target's prefix matches that of the hinted layer)
return hint->ary[ID's offset in the leaf layer];which can be inlined.
idr->hint is set to the leaf node on idr_fill_slot() and cleared from
free_layer().[andriy.shevchenko@linux.intel.com: always do slow path when hint is uninitialized]
Signed-off-by: Tejun Heo
Cc: Kirill A. Shutemov
Cc: Sasha Levin
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add a field which carries the prefix of ID the idr_layer covers. This
will be used to implement lookup hint.This patch doesn't make use of the new field and doesn't introduce any
behavior difference.Signed-off-by: Tejun Heo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
With recent preloading changes, idr no longer keeps full layer cache per
each idr instance (used to be ~6.5k per idr on 64bit) and the previous
patch removed restriction on the bitmap size. Both now allow us to have
larger layers.Increase IDR_BITS to 8 regardless of BITS_PER_LONG. Each layer is
slightly larger than 2k on 64bit and 1k on 32bit and carries 256 entries.
The size isn't too large, especially compared to what we used to waste on
per-idr caches, and 256 entries should be able to serve most use cases
with single layer. The max tree depth is 4 which is much better than the
previous 6 on 64bit and 7 on 32bit.Signed-off-by: Tejun Heo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Currently, idr->bitmap is declared as an unsigned long which restricts
the number of bits an idr_layer can contain. All bitops can handle
arbitrary positive integer bit number and there's no reason for this
restriction.Declare idr_layer->bitmap using DECLARE_BITMAP() instead of a single
unsigned long.* idr_layer->bitmap is now an array. '&' dropped from params to
bitops.* Replaced "== IDR_FULL" tests with bitmap_full() and removed
IDR_FULL.* Replaced find_next_bit() on ~bitmap with find_next_zero_bit().
* Replaced "bitmap = 0" with bitmap_clear().
This patch doesn't (or at least shouldn't) introduce any behavior
changes.[akpm@linux-foundation.org: checkpatch fixes]
Signed-off-by: Tejun Heo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
MAX_IDR_MASK is another weirdness in the idr interface. As idr covers
whole positive integer range, it's defined as 0x7fffffff or INT_MAX.Its usage in idr_find(), idr_replace() and idr_remove() is bizarre.
They basically mask off the sign bit and operate on the rest, so if
the caller, by accident, passes in a negative number, the sign bit
will be masked off and the remaining part will be used as if that was
the input, which is worse than crashing.The constant is visible in idr.h and there are several users in the
kernel.* drivers/i2c/i2c-core.c:i2c_add_numbered_adapter()
Basically used to test if adap->nr is a negative number which isn't
-1 and returns -EINVAL if so. idr_alloc() already has negative
@start checking (w/ WARN_ON_ONCE), so this can go away.* drivers/infiniband/core/cm.c:cm_alloc_id()
drivers/infiniband/hw/mlx4/cm.c:id_map_alloc()Used to wrap cyclic @start. Can be replaced with max(next, 0).
Note that this type of cyclic allocation using idr is buggy. These
are prone to spurious -ENOSPC failure after the first wraparound.* fs/super.c:get_anon_bdev()
The ID allocated from ida is masked off before being tested whether
it's inside valid range. ida allocated ID can never be a negative
number and the masking is unnecessary.Update idr_*() functions to fail with -EINVAL when negative @id is
specified and update other MAX_IDR_MASK users as described above.This leaves MAX_IDR_MASK without any user, remove it and relocate
other MAX_IDR_* constants to lib/idr.c.Signed-off-by: Tejun Heo
Cc: Jean Delvare
Cc: Roland Dreier
Cc: Sean Hefty
Cc: Hal Rosenstock
Cc: "Marciniszyn, Mike"
Cc: Jack Morgenstein
Cc: Or Gerlitz
Cc: Al Viro
Acked-by: Wolfram Sang
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Most functions in idr fail to deal with the high bits when the idr
tree grows to the maximum height.* idr_get_empty_slot() stops growing idr tree once the depth reaches
MAX_IDR_LEVEL - 1, which is one depth shallower than necessary to
cover the whole range. The function doesn't even notice that it
didn't grow the tree enough and ends up allocating the wrong ID
given sufficiently high @starting_id.For example, on 64 bit, if the starting id is 0x7fffff01,
idr_get_empty_slot() will grow the tree 5 layer deep, which only
covers the 30 bits and then proceed to allocate as if the bit 30
wasn't specified. It ends up allocating 0x3fffff01 without the bit
30 but still returns 0x7fffff01.* __idr_remove_all() will not remove anything if the tree is fully
grown.* idr_find() can't find anything if the tree is fully grown.
* idr_for_each() and idr_get_next() can't iterate anything if the tree
is fully grown.Fix it by introducing idr_max() which returns the maximum possible ID
given the depth of tree and replacing the id limit checks in all
affected places.As the idr_layer pointer array pa[] needs to be 1 larger than the
maximum depth, enlarge pa[] arrays by one.While this plugs the discovered issues, the whole code base is
horrible and in desparate need of rewrite. It's fragile like hell,Signed-off-by: Tejun Heo
Cc: Rusty Russell
Cc:Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Cc: Trond Myklebust
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Acked-by: Neil Horman
Acked-by: Vlad Yasevich
Cc: Sridhar Samudrala
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Acked-by: Johannes Berg
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Cc: Eric Van Hensbergen
Cc: Ron Minnich
Cc: Latchesar Ionkov
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Cc: Thomas Gleixner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Cc: Peter Zijlstra
Cc: Paul Mackerras
Cc: Ingo Molnar
Cc: Arnaldo Carvalho de Melo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Acked-by: Li Zefan
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
The new interface doesn't directly translate to the way idr_pre_get()
was used around ipc_addid() as preloading disables preemption. From
my cursory reading, it seems like we should be able to do all
allocation from ipc_addid(), so I moved it there. Can you please
check whether this would be okay? If this is wrong and ipc_addid()
should be allowed to be called from non-sleepable context, I'd suggest
allocating id itself in the outer functions and later install the
pointer using idr_replace().Signed-off-by: Tejun Heo
Reported-by: Sedat Dilek
Tested-by: Sedat Dilek
Cc: Stanislav Kinsbursky
Cc: "Eric W. Biederman"
Cc: James Morris
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Cc: Mark Fasheh
Acked-by: Joel Becker
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Note that the adhoc cyclic id allocation is buggy. If wraparound
happens, the previous code with idr_get_new_above() may segfault and
the converted code will trigger WARN and return -EINVAL. Even if it's
fixed to wrap to zero, the code will be prone to unnecessary -ENOSPC
failures after the first wraparound. We probably need to implement
proper cyclic support in idr.Signed-off-by: Tejun Heo
Cc: John McCutchan
Cc: Robert Love
Cc: Eric Paris
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface. Error return values from
recover_idr_add() mix -1 and -errno. The conversion doesn't change
that but it looks iffy.Signed-off-by: Tejun Heo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Acked-by: Alex Williamson
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Acked-by: Greg Kroah-Hartman
Cc: "Hans J. Koch"
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Cc: Zhang Rui
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Acked-by: James Smart
Cc: James Bottomley
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Cc: Nicholas A. Bellinger
Cc: James Bottomley
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Cc: "James E.J. Bottomley"
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Cc: Krishna C Gudipati
Cc: James Bottomley
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Cc: Ohad Ben-Cohen
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Cc: Ohad Ben-Cohen
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Cc: Rodolfo Giometti
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Acked-by: Anton Vorontsov
Cc: David Woodhouse
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Cc: Paul Mackerras
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Cc: Jason Wang
Cc: Michael S. Tsirkin
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Tested-by: Ezequiel Garcia
Cc: David Woodhouse
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Cc: Chris Ball
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Cc: Arnd Bergmann
Cc: Alex Dubov
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo
Cc: Arnd Bergmann
Cc: Rodolfo Giometti
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds