This is an attempt to fix the issue that some disks' sysfs attributes are not
ready at the time its KOBJ_ADD event is sent.
The symptom is during device hotplug, udev may fail to find certain attributes,
such as serial or wwn, of the disk. As a result the /dev/disk/by-id entries are
not created.
add_disk is now a "convenience" wrapper of device_add_disk. Unwrap it so
that callers can be later converted to handle error and attribute group
more easily.
Callers are converted with coccinelle:
@@
expression x;
@@
- add_disk(x)
+ device_add_disk(NULL, x)
Removal of add_disk and upda
Several operations in register_disk can fail, but the caller currently
cannot check for error due to missing return code. Change the function
return type and return -errno if any error happens.
Also add some documentation.
Signed-off-by: Fam Zheng
---
block/genhd.c | 27 +---
blk_register_region can fail (-ENOMEM), return the error to the caller.
Signed-off-by: Fam Zheng
---
block/genhd.c | 4 ++--
include/linux/genhd.h | 10 +-
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index 3dcecaa..8c7510d 100644
The kobject_init_and_add call in blk_integrity_add can fail, return the
error code in this case, so that it can be handled in the caller.
Signed-off-by: Fam Zheng
---
block/blk-integrity.c | 12
include/linux/genhd.h | 4 ++--
2 files changed, 10 insertions(+), 6 deletions(-)
diff
disk_alloc_events and disk_add_events can fail, return the error code so
the caller can handle it.
Signed-off-by: Fam Zheng
---
block/genhd.c | 24 +++-
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index 8c7510d..4316d2d 100644
There are a number of places in device_add_disk that can fail, and even
more to come as we extend it.
Switch the return type of the function, and return the error code when
error happens.
The WARN_ON is kept because callers are not updated to check the error
yet.
Signed-off-by: Fam Zheng
---
b
The added parameter attr_group, if not NULL, be added to the new disk.
The callers are converted with coccinelle:
@@
expression e1, e2;
@@
- device_add_disk(e1, e2);
+ device_add_disk(e1, e2, NULL);
So there is not behavior change yet.
Signed-off-by: Fam Zheng
---
arch/m68k/emu/nfbl
Previously after device_add_disk returns, the KOBJ_ADD uevent is already
emitted. Adding attributes after that is a poor usage of kobject, and
in practice may result in race conditions with userspace, for
example udev checks availability of certain attributes and initializes
/dev entries conditiona
Previously after device_add_disk returns, the KOBJ_ADD uevent is already
emitted. Adding attributes after that is a poor usage of kobject, and
in practice may result in race conditions with userspace, for
example udev checks availability of certain attributes and initializes
/dev entries conditiona
Previously after device_add_disk returns, the KOBJ_ADD uevent is already
emitted. Adding attributes after that is a poor usage of kobject, and
in practice may result in race conditions with userspace, for
example udev checks availability of certain attributes and initializes
/dev entries conditiona
Previously after device_add_disk returns, the KOBJ_ADD uevent is already
emitted. Adding attributes after that is a poor usage of kobject, and
in practice may result in race conditions with userspace, for
example udev checks availability of certain attributes and initializes
/dev entries conditiona
Previously after device_add_disk returns, the KOBJ_ADD uevent is already
emitted. Adding attributes after that is a poor usage of kobject, and
in practice may result in race conditions with userspace, for
example udev checks availability of certain attributes and initializes
/dev entries conditiona
Previously after device_add_disk returns, the KOBJ_ADD uevent is already
emitted. Adding attributes after that is a poor usage of kobject, and
in practice may result in race conditions with userspace, for
example udev checks availability of certain attributes and initializes
/dev entries conditiona
Previously after device_add_disk returns, the KOBJ_ADD uevent is already
emitted. Adding attributes after that is a poor usage of kobject, and
in practice may result in race conditions with userspace, for
example udev checks availability of certain attributes and initializes
/dev entries conditiona
Done with coccinelle:
@@
expression e1, e2, e3;
identifier rc;
@@
(
rc = device_add_disk(e1, e2, e3);
|
+ /* FIXME: handle error. */
device_add_disk(e1, e2, e3);
)
Signed-off-by: Fam Zheng
---
arch/m68k/emu/nfblock.c | 1 +
arch/um/drivers/ubd_kern.c
On Tue, Aug 2, 2016 at 6:12 AM, Michael Bringmann
wrote:
> Firmware Features: Define new bit flags representing the presence of
> new device tree properties "ibm,drc-info", and "ibm,dynamic-memory-v2".
> These flags are used to tell the front end processor when the Linux
> kernel supports the new
Hi Fam,
[auto build test WARNING on linus/master]
[also build test WARNING on v4.8-rc2 next-20160817]
[cannot apply to linux/master]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system]
url:
https://github.com/0day-ci/linux/commits/Fam-Zheng/Fix
Le 16/08/2016 à 19:36, Dave Hansen a écrit :
On 08/16/2016 10:27 AM, christophe leroy wrote:
If I debug a very small app, it gets stuck quickly after the app has
stopped: indeed, the console seems ok but as soon as I try to execute
something simple, like a ps or top, it get stuck. The target sti
On 15/08/16 21:07, David Gibson wrote:
> On Fri, Aug 12, 2016 at 04:12:17PM +1000, Alexey Kardashevskiy wrote:
>> On 12/08/16 15:46, David Gibson wrote:
>>> On Wed, Aug 10, 2016 at 10:46:30AM -0600, Alex Williamson wrote:
On Wed, 10 Aug 2016 15:37:17 +1000
Alexey Kardashevskiy wrote:
>>>
On Wed, 17 Aug 2016 15:15:06 +0800
Fam Zheng wrote:
> @@ -613,10 +614,8 @@ void device_add_disk(struct device *parent, struct
> gendisk *disk)
> disk->flags |= GENHD_FL_UP;
>
> retval = blk_alloc_devt(&disk->part0, &devt);
> - if (retval) {
> - WARN_ON(1);
> -
On Wed, 08/17 10:49, Cornelia Huck wrote:
> On Wed, 17 Aug 2016 15:15:06 +0800
> Fam Zheng wrote:
>
> > @@ -613,10 +614,8 @@ void device_add_disk(struct device *parent, struct
> > gendisk *disk)
> > disk->flags |= GENHD_FL_UP;
> >
> > retval = blk_alloc_devt(&disk->part0, &devt);
> > -
On Wed, 17 Aug 2016 16:48:23 +0800
Fam Zheng wrote:
> On Wed, 08/17 10:49, Cornelia Huck wrote:
> > On Wed, 17 Aug 2016 15:15:06 +0800
> > Fam Zheng wrote:
> >
> > > @@ -613,10 +614,8 @@ void device_add_disk(struct device *parent, struct
> > > gendisk *disk)
> > > disk->flags |= GENHD_FL_UP;
On Wed, 08/17 11:06, Cornelia Huck wrote:
> On Wed, 17 Aug 2016 16:48:23 +0800
> Fam Zheng wrote:
>
> > On Wed, 08/17 10:49, Cornelia Huck wrote:
> > > On Wed, 17 Aug 2016 15:15:06 +0800
> > > Fam Zheng wrote:
> > >
> > > > @@ -613,10 +614,8 @@ void device_add_disk(struct device *parent, struct
When decoding the perf_regs mask in regs_dump__printf(),
we loop through the mask using find_first_bit and find_next_bit functions.
"mask" is of type "u64", but sent as a "unsigned long *" to
lib functions along with sizeof().
While the exisitng code works fine in most of the case,
the logic is br
When decoding the perf_regs mask in perf_output_sample_regs(),
we loop through the mask using find_first_bit and find_next_bit functions.
While the exisitng code works fine in most of the case,
the logic is broken for 32bit kernel (Big Endian).
When reading u64 mask using (u32 *)(&val)[0], find_*_b
Unsigned type is always non-negative, so the loop could not end in case
condition is never true.
The problem has been detected using semantic patch
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci
Signed-off-by: Andrzej Hajda
---
arch/powerpc/platforms/powernv/pci-ioda.c | 2 +-
1 file
On 2016-08-17 03:44, Stephen Rothwell wrote:
> Hi Michal,
>
> After merging the kbuild tree, today's linux-next build (powerpc
> ppc64_defconfig) produced these warnings:
>
> WARNING: 25 bad relocations
> c0cf2570 R_PPC64_ADDR64__crc___arch_hweight16
[...]
> Introduced by commit
>
>
On 02/08/2016 07:43, Simon Guo wrote:
> Hi Laurent,
> On Fri, Jul 29, 2016 at 11:51:22AM +0200, Laurent Dufour wrote:
>> static int set_user_msr(struct task_struct *task, unsigned long msr)
>> {
>> +#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
>> +if (!(task->thread.regs->msr & MSR_TM)) {
>> +
On 15/08/16 18:19, Dave Hansen wrote:
> On 08/15/2016 07:35 AM, Holger Brunck wrote:
>> I tried this but unfortunately the error only occurs while remote debugging.
>> Locally with gdb everything works fine. BTW we double-checked with a 85xx ppc
>> target which is also 32-bit and it ends up with th
On 17/08/16 00:13, Benjamin Herrenschmidt wrote:
> On Mon, 2016-08-15 at 09:19 -0700, Dave Hansen wrote:
>>
>> Wow, thanks for all the debugging here!
>
> Yup, thanks, that's really odd... I wonder if one of those
> structures is accessed beyond it's boundary, either the sigset
> or the thread s
On 16/08/16 19:27, christophe leroy wrote:
>
>
> Le 15/08/2016 à 18:19, Dave Hansen a écrit :
>> On 08/15/2016 07:35 AM, Holger Brunck wrote:
>>> I tried this but unfortunately the error only occurs while remote debugging.
>>> Locally with gdb everything works fine. BTW we double-checked with a 8
Change {create,remove}_section_mapping() to be inline wrappers around
functions prefixed with "hash__".
This is preparation for the addition of their "radix__" variants. No
functional change.
Signed-off-by: Reza Arbab
---
arch/powerpc/include/asm/book3s/64/hash.h | 5 +
arch/powerpc/includ
Memory hotplug is leading to hash page table calls, even on radix:
...
arch_add_memory
create_section_mapping
htab_bolt_mapping
BUG_ON(!ppc_md.hpte_insert);
Refactor {create,remove}_section_mapping() into hash__ and r
Add radix variants of the memory hotplug mapping functions.
Signed-off-by: Reza Arbab
---
arch/powerpc/include/asm/book3s/64/radix.h | 5 +
arch/powerpc/include/asm/sparsemem.h | 8
arch/powerpc/mm/pgtable-radix.c| 23 +++
3 files changed, 36
Acked-by: Manoj N. Kumar
On 8/9/2016 6:39 PM, Matthew R. Ochs wrote:
Context information structures are protected by a mutex that is held
when accessing/manipulating the context. When the code that manages
these structures was authored, a decision was made to include taking
the mutex as part of
On 17/08/16 13:17, David Gibson wrote:
> On Fri, Aug 12, 2016 at 09:22:01AM -0600, Alex Williamson wrote:
>> On Fri, 12 Aug 2016 15:46:01 +1000
>> David Gibson wrote:
>>
>>> On Wed, Aug 10, 2016 at 10:46:30AM -0600, Alex Williamson wrote:
On Wed, 10 Aug 2016 15:37:17 +1000
Alexey Kardash
On 08/17/2016 05:14 AM, Fam Zheng wrote:
...
Of course, the plan is to write patches on top. I'm not cleaning up anything
here because I'm concerned callers may double free (and I didn't look hard into
that).
Aside from Huck's concerns, the changes looked OK from aoe's perspective.
--
Ed
On Wed, 17 Aug 2016 14:59:59 +0200
Michal Marek wrote:
> On 2016-08-17 03:44, Stephen Rothwell wrote:
> > Hi Michal,
> >
> > After merging the kbuild tree, today's linux-next build (powerpc
> > ppc64_defconfig) produced these warnings:
> >
> > WARNING: 25 bad relocations
> > c0cf2570 R_
Hello,
On (08/17/16 15:15), Fam Zheng wrote:
[..]
> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
> index 20920a2..2331788 100644
> --- a/drivers/block/zram/zram_drv.c
> +++ b/drivers/block/zram/zram_drv.c
> @@ -1298,13 +1298,10 @@ static int zram_add(void)
>
On (08/18/16 10:59), Sergey Senozhatsky wrote:
[..]
> I like the previous "Error creating sysfs group for device" string better,
> than "Error creating disk", because the latter one is much less informative.
>
> do you want to do something like below?
>
> int device_add_disk(struct device *parent
On (08/17/16 15:15), Fam Zheng wrote:
[..]
> (
> rc = device_add_disk(e1, e2, e3);
> |
> + /* FIXME: handle error. */
> device_add_disk(e1, e2, e3);
or use __must_check for device_add_disk() function?
/* which is _attribute__((warn_unused_result)) */
-ss
Hi,
The main line stable 4.8.0-rc2 failed to build on PowerPC with following
build errors. config : pseries_le_defconfig Machine Type : PowerPC Bare
Metal
09:34:22 00:04:59 INFO | make -j 160 vmlinux
09:34:24 00:05:01 ERROR| [stderr] arch/powerpc/mm/hash_low_32.S: Assembler
messages:
09:34:
43 matches
Mail list logo