From patchwork Thu Sep 29 13:03:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Wang X-Patchwork-Id: 9356415 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EDE8F6077A for ; Thu, 29 Sep 2016 13:03:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFC87298B3 for ; Thu, 29 Sep 2016 13:03:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D439F299DD; Thu, 29 Sep 2016 13:03:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_TVD_MIME_EPI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BBFE298B3 for ; Thu, 29 Sep 2016 13:03:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754995AbcI2NDf (ORCPT ); Thu, 29 Sep 2016 09:03:35 -0400 Received: from mail-lf0-f41.google.com ([209.85.215.41]:36547 "EHLO mail-lf0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754764AbcI2NDd (ORCPT ); Thu, 29 Sep 2016 09:03:33 -0400 Received: by mail-lf0-f41.google.com with SMTP id g62so78722918lfe.3 for ; Thu, 29 Sep 2016 06:03:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=profitbricks-com.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version; bh=JVi8J4zaWiByrXz8O0bKnXScG7CkgxyXfsMIFG3iNdI=; b=O8XR7pUqpzR3gcDzhA9mTcBDRuawZDtHGGz2vqCjCKqA23gz0Ptv6SuQWa1pUFGbeB f6WLx/Oa+GfpD+Yr6Cy0co9lOktvh1kLJ76ddHPyjMf1OmFm51m97w9l1jP/OJ6pLcKo 0iKxwxVu7Ppj8Z7ryJdySyfd5YHY4HvCZ4iV7EEyK/FxDyATi2BTjs5x9vNq6JDRbCZZ B+DXmqGdU3sMeQK8xmvK+VAeoTsWC2MKFOos6yT/ss/WgPEBHUEK2Il4L6flqm+MkVws ZxTvlRXVB2FVDP5M7eG8fulTjiypUQUwxIUu51QZuJtxom+b07ve8z7b21j+UzzQDoOi 9N6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version; bh=JVi8J4zaWiByrXz8O0bKnXScG7CkgxyXfsMIFG3iNdI=; b=N6Wb1+cKRFW4OJrRocFq+hWKZpGGQaQatUJYfI9CQbqk+d7h7/3lhufRUf/wbf2OqZ E65CqhDhjr0t0+Z0H5it33raLvd1fcxz8LU6aKBJJEeQNdq7rTK5hDfN0eiJlmI2AiBX fnco5SclVf+35fzEgA1L4edn1DqiWGJlZ1Q5R+aHzBuws41lu4jPrl1lESXcnl6R4ckb kIQJ7yW5DYaf8RmIWmCBng7iqbE5wnCLtyxdv0nQFsFd/fB/+dSJxY3+6PW86SAcLKmS VOpekJViO59NAqRsKtxp0GZJqk/CFfeECtJSgmrEIES11zqjZrG/U7w/OqogKITkYTfo Crgw== X-Gm-Message-State: AA6/9Rm6xqhZV9IDJIaaafao46qHh3oEujdl7Q5pIz8TPkCwWTkEfs/eLFHRgdPeSYII/0QX X-Received: by 10.194.173.168 with SMTP id bl8mr1349611wjc.105.1475154210851; Thu, 29 Sep 2016 06:03:30 -0700 (PDT) Received: from [192.168.71.52] ([62.217.45.26]) by smtp.googlemail.com with ESMTPSA id n131sm28202520wmd.3.2016.09.29.06.03.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Sep 2016 06:03:30 -0700 (PDT) To: linux-block@vger.kernel.org, "linux-kernel@vger.kernel.org" , axboe@fb.com From: Michael Wang Subject: [BUG] block: bdi_register_owner() failure cause NULL pointer dereference Message-ID: <7628cae1-f724-329c-f8a7-174731c67bd9@profitbricks.com> Date: Thu, 29 Sep 2016 15:03:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, Folks We observed the hard lockup while trying raid assemble with sas3ircu, it was start with the failure inside bdi_register_owner() with duplicated kobj path, and later comeup the NULL pointer dereference, after that system hang and we saw hard lockup on screen. The duplicated issue could be with the scsi controller driver and we are going to upgrade it anyway, but my question is why we don't do some error handling like: to prevent the following NULL pointer dereference and hard lockup? Regards, Michael Wang Sep 29 09:53:28 st401b-3 systemd[1]: Starting Update UTMP about System Runlevel Changes... Sep 29 09:53:28 st401b-3 ntpd[4970]: Listen and drop on 1 v6wildcard :: UDP 123 Sep 29 09:53:28 st401b-3 ntpd[4970]: Listen normally on 2 lo 127.0.0.1 UDP 123 Sep 29 09:53:28 st401b-3 ntpd[4970]: Listen normally on 3 eth0 10.41.12.3 UDP 123 Sep 29 09:53:28 st401b-3 ntpd[4970]: Listen normally on 4 lo ::1 UDP 123 Sep 29 09:53:28 st401b-3 ntpd[4970]: Listen normally on 5 eth0 fe80::ec4:7aff:feab:6b0 UDP 123 Sep 29 09:53:28 st401b-3 ntpd[4970]: peers refreshed Sep 29 09:53:28 st401b-3 ntpd[4970]: Listening on routing socket on fd #22 for interface updates Sep 29 09:53:28 st401b-3 systemd[1]: Started Update UTMP about System Runlevel Changes. Sep 29 09:53:28 st401b-3 systemd[1]: Startup finished in 18.720s (kernel) + 39.513s (userspace) = 58.233s. Sep 29 09:55:01 st401b-3 CRON[5433]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1) Sep 29 09:55:01 st401b-3 CRON[5434]: (root) CMD (test -x /opt/profitbricks/bin/check_memory && /opt/profitbricks/bin/check_memory) Sep 29 09:55:17 st401b-3 kernel: [ 167.693658] scsi 0:1:0:0: Direct-Access LSI Logical Volume 3000 PQ: 0 ANSI: 6 Sep 29 09:55:17 st401b-3 kernel: [ 167.693795] scsi 0:1:0:0: RAID1: handle(0x0143), wwid(0x02f7ec7949091b05), pd_count(2), type(SSP) Sep 29 09:55:17 st401b-3 kernel: [ 167.694042] sd 0:1:0:0: [sdam] 5859373056 512-byte logical blocks: (3.00 TB/2.73 TiB) Sep 29 09:55:17 st401b-3 kernel: [ 167.694044] sd 0:1:0:0: [sdam] 4096-byte physical blocks Sep 29 09:55:17 st401b-3 kernel: [ 167.694057] sd 0:1:0:0: Attached scsi generic sg40 type 0 Sep 29 09:55:17 st401b-3 kernel: [ 167.694129] sd 0:1:0:0: [sdam] Write Protect is off Sep 29 09:55:17 st401b-3 kernel: [ 167.694131] sd 0:1:0:0: [sdam] Mode Sense: 03 00 00 08 Sep 29 09:55:17 st401b-3 kernel: [ 167.694166] sd 0:1:0:0: [sdam] No Caching mode page found Sep 29 09:55:17 st401b-3 kernel: [ 167.694282] sd 0:0:4:0: hidding raid component Sep 29 09:55:17 st401b-3 kernel: [ 167.694589] sd 0:1:0:0: [sdam] Assuming drive cache: write through Sep 29 09:55:17 st401b-3 kernel: [ 167.703346] sd 0:1:0:0: [sdam] Attached SCSI disk Sep 29 09:55:17 st401b-3 kernel: [ 167.703653] sd 0:0:5:0: hidding raid component Sep 29 09:55:39 st401b-3 check_backup_lvm_push: critical: local git command rev-parse HEAD failed, retval: 0, fatal: Not a git repository: '/var/lib/backup-lvm/.git/' Sep 29 09:56:03 st401b-3 kernel: [ 213.684812] scsi 0:1:1:0: Direct-Access LSI Logical Volume 3000 PQ: 0 ANSI: 6 Sep 29 09:56:03 st401b-3 kernel: [ 213.684946] scsi 0:1:1:0: RAID1: handle(0x0142), wwid(0x0ab3eca651cd1b58), pd_count(2), type(SSP) Sep 29 09:56:03 st401b-3 kernel: [ 213.685189] sd 0:1:1:0: [sde] 5859373056 512-byte logical blocks: (3.00 TB/2.73 TiB) Sep 29 09:56:03 st401b-3 kernel: [ 213.685192] sd 0:1:1:0: [sde] 4096-byte physical blocks Sep 29 09:56:03 st401b-3 kernel: [ 213.685204] sd 0:1:1:0: Attached scsi generic sg41 type 0 Sep 29 09:56:03 st401b-3 kernel: [ 213.685275] sd 0:1:1:0: [sde] Write Protect is off Sep 29 09:56:03 st401b-3 kernel: [ 213.685277] sd 0:1:1:0: [sde] Mode Sense: 03 00 00 08 Sep 29 09:56:03 st401b-3 kernel: [ 213.685307] sd 0:1:1:0: [sde] No Caching mode page found Sep 29 09:56:03 st401b-3 kernel: [ 213.685423] sd 0:0:6:0: hidding raid component Sep 29 09:56:03 st401b-3 kernel: [ 213.685698] sd 0:1:1:0: [sde] Assuming drive cache: write through Sep 29 09:56:03 st401b-3 kernel: [ 213.686226] ------------[ cut here ]------------ Sep 29 09:56:03 st401b-3 kernel: [ 213.686232] WARNING: CPU: 2 PID: 2061 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x64/0x80() Sep 29 09:56:03 st401b-3 kernel: [ 213.686233] sysfs: cannot create duplicate filename '/devices/virtual/bdi/8:64' Sep 29 09:56:03 st401b-3 kernel: [ 213.686234] Modules linked in: ipmi_devintf rdma_ucm ib_ucm rdma_cm iw_cm ib_uverbs mlx5_ib mlx5_core x86_pkg_temp_thermal crct10dif_pclmul crc32_pclmul sha256_ssse3 sha256_generic hmac drbg ansi_cprng ib_ipoib aesni_intel sb_edac aes_x86_64 glue_helper ablk_helper ib_cm cryptd edac_core i2c_i801 ioatdma ipmi_si ipmi_msghandler acpi_power_meter acpi_pad button mlx4_ib ib_sa ib_umad ib_mad ib_core ib_addr ipv6 hid_generic usbhid crc32c_intel igb xhci_pci ehci_pci hwmon ahci ehci_hcd xhci_hcd i2c_algo_bit libahci i2c_core mlx4_core dca mlx_compat sg Sep 29 09:56:03 st401b-3 kernel: [ 213.686264] CPU: 2 PID: 2061 Comm: kworker/u32:33 Not tainted 4.4.21-1-storage #1 Sep 29 09:56:03 st401b-3 kernel: [ 213.686266] Hardware name: Supermicro SSG-5048R-E1CR36L/X10SRH-CLN4F, BIOS 2.0 12/17/2015 Sep 29 09:56:03 st401b-3 kernel: [ 213.686270] Workqueue: events_unbound async_run_entry_fn Sep 29 09:56:03 st401b-3 kernel: [ 213.686272] 0000000000000000 ffff881034863a88 ffffffff812f27c8 ffff881034863ad0 Sep 29 09:56:03 st401b-3 kernel: [ 213.686274] ffffffff818090f7 ffff881034863ac0 ffffffff81055e26 ffff88103801b000 Sep 29 09:56:03 st401b-3 kernel: [ 213.686276] ffff8810387f1468 ffff8810381ff528 ffff881034884200 0000000000000000 Sep 29 09:56:03 st401b-3 kernel: [ 213.686278] Call Trace: Sep 29 09:56:03 st401b-3 kernel: [ 213.686284] [] dump_stack+0x4d/0x65 Sep 29 09:56:03 st401b-3 kernel: [ 213.686289] [] warn_slowpath_common+0x86/0xc0 Sep 29 09:56:03 st401b-3 kernel: [ 213.686291] [] warn_slowpath_fmt+0x4c/0x50 Sep 29 09:56:03 st401b-3 kernel: [ 213.686296] [] ? kernfs_path+0x48/0x60 Sep 29 09:56:03 st401b-3 kernel: [ 213.686298] [] sysfs_warn_dup+0x64/0x80 Sep 29 09:56:03 st401b-3 kernel: [ 213.686300] [] sysfs_create_dir_ns+0x77/0x90 Sep 29 09:56:03 st401b-3 kernel: [ 213.686302] [] kobject_add_internal+0xb1/0x340 Sep 29 09:56:03 st401b-3 kernel: [ 213.686305] [] ? vsnprintf+0x347/0x510 Sep 29 09:56:03 st401b-3 kernel: [ 213.686307] [] kobject_add+0x68/0xb0 Sep 29 09:56:03 st401b-3 kernel: [ 213.686311] [] ? device_private_init+0x23/0x70 Sep 29 09:56:03 st401b-3 kernel: [ 213.686315] [] ? mutex_lock+0x12/0x30 Sep 29 09:56:03 st401b-3 kernel: [ 213.686317] [] device_add+0x266/0x640 Sep 29 09:56:03 st401b-3 kernel: [ 213.686319] [] ? kfree_const+0x22/0x30 Sep 29 09:56:03 st401b-3 kernel: [ 213.686321] [] device_create_groups_vargs+0xe0/0xf0 Sep 29 09:56:03 st401b-3 kernel: [ 213.686323] [] device_create_vargs+0x1c/0x20 Sep 29 09:56:03 st401b-3 kernel: [ 213.686326] [] bdi_register+0x68/0x160 Sep 29 09:56:03 st401b-3 kernel: [ 213.686328] [] bdi_register_owner+0x38/0x60 Sep 29 09:56:03 st401b-3 kernel: [ 213.686331] [] add_disk+0x15d/0x470 Sep 29 09:56:03 st401b-3 kernel: [ 213.686333] [] sd_probe_async+0x107/0x1b0 Sep 29 09:56:03 st401b-3 kernel: [ 213.686336] [] async_run_entry_fn+0x48/0x150 Sep 29 09:56:03 st401b-3 kernel: [ 213.686340] [] process_one_work+0x14d/0x410 Sep 29 09:56:03 st401b-3 kernel: [ 213.686342] [] worker_thread+0x66/0x460 Sep 29 09:56:03 st401b-3 kernel: [ 213.686344] [] ? rescuer_thread+0x2e0/0x2e0 Sep 29 09:56:03 st401b-3 kernel: [ 213.686346] [] kthread+0xdb/0x100 Sep 29 09:56:03 st401b-3 kernel: [ 213.686348] [] ? kthread_park+0x60/0x60 Sep 29 09:56:03 st401b-3 kernel: [ 213.686350] [] ret_from_fork+0x3f/0x70 Sep 29 09:56:03 st401b-3 kernel: [ 213.686352] [] ? kthread_park+0x60/0x60 Sep 29 09:56:03 st401b-3 kernel: [ 213.686353] ---[ end trace 652e67f80001ba41 ]--- Sep 29 09:56:03 st401b-3 kernel: [ 213.686354] ------------[ cut here ]------------ Sep 29 09:56:03 st401b-3 kernel: [ 213.686356] WARNING: CPU: 2 PID: 2061 at lib/kobject.c:240 kobject_add_internal+0x2cd/0x340() Sep 29 09:56:03 st401b-3 kernel: [ 213.686357] kobject_add_internal failed for 8:64 with -EEXIST, don't try to register things with the same name in the same directory. Sep 29 09:56:03 st401b-3 kernel: [ 213.686358] Modules linked in: ipmi_devintf rdma_ucm ib_ucm rdma_cm iw_cm ib_uverbs mlx5_ib mlx5_core x86_pkg_temp_thermal crct10dif_pclmul crc32_pclmul sha256_ssse3 sha256_generic hmac drbg ansi_cprng ib_ipoib aesni_intel sb_edac aes_x86_64 glue_helper ablk_helper ib_cm cryptd edac_core i2c_i801 ioatdma ipmi_si ipmi_msghandler acpi_power_meter acpi_pad button mlx4_ib ib_sa ib_umad ib_mad ib_core ib_addr ipv6 hid_generic usbhid crc32c_intel igb xhci_pci ehci_pci hwmon ahci ehci_hcd xhci_hcd i2c_algo_bit libahci i2c_core mlx4_core dca mlx_compat sg Sep 29 09:56:03 st401b-3 kernel: [ 213.686376] CPU: 2 PID: 2061 Comm: kworker/u32:33 Tainted: G W 4.4.21-1-storage #1 Sep 29 09:56:03 st401b-3 kernel: [ 213.686377] Hardware name: Supermicro SSG-5048R-E1CR36L/X10SRH-CLN4F, BIOS 2.0 12/17/2015 Sep 29 09:56:03 st401b-3 kernel: [ 213.686379] Workqueue: events_unbound async_run_entry_fn Sep 29 09:56:03 st401b-3 kernel: [ 213.686380] 0000000000000000 ffff881034863ad8 ffffffff812f27c8 ffff881034863b20 Sep 29 09:56:03 st401b-3 kernel: [ 213.686381] ffffffff8181a888 ffff881034863b10 ffffffff81055e26 ffff881034884210 Sep 29 09:56:03 st401b-3 kernel: [ 213.686383] 00000000ffffffef ffff881038200120 ffff881034884200 0000000000000000 Sep 29 09:56:03 st401b-3 kernel: [ 213.686385] Call Trace: Sep 29 09:56:03 st401b-3 kernel: [ 213.686387] [] dump_stack+0x4d/0x65 Sep 29 09:56:03 st401b-3 kernel: [ 213.686389] [] warn_slowpath_common+0x86/0xc0 Sep 29 09:56:03 st401b-3 kernel: [ 213.686391] [] warn_slowpath_fmt+0x4c/0x50 Sep 29 09:56:03 st401b-3 kernel: [ 213.686393] [] kobject_add_internal+0x2cd/0x340 Sep 29 09:56:03 st401b-3 kernel: [ 213.686395] [] ? vsnprintf+0x347/0x510 Sep 29 09:56:03 st401b-3 kernel: [ 213.686396] [] kobject_add+0x68/0xb0 Sep 29 09:56:03 st401b-3 kernel: [ 213.686398] [] ? device_private_init+0x23/0x70 Sep 29 09:56:03 st401b-3 kernel: [ 213.686399] [] ? mutex_lock+0x12/0x30 Sep 29 09:56:03 st401b-3 kernel: [ 213.686401] [] device_add+0x266/0x640 Sep 29 09:56:03 st401b-3 kernel: [ 213.686402] [] ? kfree_const+0x22/0x30 Sep 29 09:56:03 st401b-3 kernel: [ 213.686404] [] device_create_groups_vargs+0xe0/0xf0 Sep 29 09:56:03 st401b-3 kernel: [ 213.686406] [] device_create_vargs+0x1c/0x20 Sep 29 09:56:03 st401b-3 kernel: [ 213.686407] [] bdi_register+0x68/0x160 Sep 29 09:56:03 st401b-3 kernel: [ 213.686409] [] bdi_register_owner+0x38/0x60 Sep 29 09:56:03 st401b-3 kernel: [ 213.686411] [] add_disk+0x15d/0x470 Sep 29 09:56:03 st401b-3 kernel: [ 213.686412] [] sd_probe_async+0x107/0x1b0 Sep 29 09:56:03 st401b-3 kernel: [ 213.686414] [] async_run_entry_fn+0x48/0x150 Sep 29 09:56:03 st401b-3 kernel: [ 213.686416] [] process_one_work+0x14d/0x410 Sep 29 09:56:03 st401b-3 kernel: [ 213.686418] [] worker_thread+0x66/0x460 Sep 29 09:56:03 st401b-3 kernel: [ 213.686420] [] ? rescuer_thread+0x2e0/0x2e0 Sep 29 09:56:03 st401b-3 kernel: [ 213.686422] [] kthread+0xdb/0x100 Sep 29 09:56:03 st401b-3 kernel: [ 213.686423] [] ? kthread_park+0x60/0x60 Sep 29 09:56:03 st401b-3 kernel: [ 213.686425] [] ret_from_fork+0x3f/0x70 Sep 29 09:56:03 st401b-3 kernel: [ 213.686427] [] ? kthread_park+0x60/0x60 Sep 29 09:56:03 st401b-3 kernel: [ 213.686428] ---[ end trace 652e67f80001ba42 ]--- Sep 29 09:56:03 st401b-3 kernel: [ 213.705961] BUG: unable to handle kernel NULL pointer dereference at 0000000000000040 Sep 29 09:56:03 st401b-3 kernel: [ 213.706601] IP: [] sysfs_do_create_link_sd.isra.2+0x34/0xb0 Sep 29 09:56:03 st401b-3 kernel: [ 213.707154] PGD 0 Sep 29 09:56:03 st401b-3 kernel: [ 213.707325] Oops: 0000 [#1] SMP Sep 29 09:56:03 st401b-3 kernel: [ 213.707588] Modules linked in: ipmi_devintf rdma_ucm ib_ucm rdma_cm iw_cm ib_uverbs mlx5_ib mlx5_core x86_pkg_temp_thermal crct10dif_pclmul crc32_pclmul sha256_ssse3 sha256_generic hmac drbg ansi_cprng ib_ipoib aesni_intel sb_edac aes_x86_64 glue_helper ablk_helper ib_cm cryptd edac_core i2c_i801 ioatdma ipmi_si ipmi_msghandler acpi_power_meter acpi_pad button mlx4_ib ib_sa ib_umad ib_mad ib_core ib_addr ipv6 hid_generic usbhid crc32c_intel igb xhci_pci ehci_pci hwmon ahci ehci_hcd xhci_hcd i2c_algo_bit libahci i2c_core mlx4_core dca mlx_compat sg Sep 29 09:56:03 st401b-3 kernel: [ 213.711714] CPU: 2 PID: 2061 Comm: kworker/u32:33 Tainted: G W 4.4.21-1-storage #1 Sep 29 09:56:03 st401b-3 kernel: [ 213.712327] Hardware name: Supermicro SSG-5048R-E1CR36L/X10SRH-CLN4F, BIOS 2.0 12/17/2015 Sep 29 09:56:03 st401b-3 kernel: [ 213.713000] Workqueue: events_unbound async_run_entry_fn Sep 29 09:56:03 st401b-3 kernel: [ 213.713385] task: ffff881034858000 ti: ffff881034860000 task.ti: ffff881034860000 Sep 29 09:56:03 st401b-3 kernel: [ 213.713922] RIP: 0010:[] [] sysfs_do_create_link_sd.isra.2+0x34/0xb0 Sep 29 09:56:03 st401b-3 kernel: [ 213.714650] RSP: 0018:ffff881034863d30 EFLAGS: 00010246 Sep 29 09:56:03 st401b-3 kernel: [ 213.715044] RAX: 0000000000000000 RBX: 0000000000000040 RCX: 0000000000000001 Sep 29 09:56:03 st401b-3 kernel: [ 213.715568] RDX: 0000000000000001 RSI: 0000000000000040 RDI: ffffffff81ec4c10 Sep 29 09:56:03 st401b-3 kernel: [ 213.716092] RBP: ffff881034863d58 R08: ffff8800738f6180 R09: ffff881036c0e288 Sep 29 09:56:03 st401b-3 kernel: [ 213.716616] R10: 0000000000000000 R11: 0000000000018be0 R12: 0000000000000001 Sep 29 09:56:03 st401b-3 kernel: [ 213.717139] R13: ffffffff817f5a5d R14: ffff881016c8c078 R15: ffff8810361d9a00 Sep 29 09:56:03 st401b-3 kernel: [ 213.717674] FS: 0000000000000000(0000) GS:ffff88107fc40000(0000) knlGS:0000000000000000 Sep 29 09:56:03 st401b-3 kernel: [ 213.718264] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 Sep 29 09:56:03 st401b-3 kernel: [ 213.718690] CR2: 0000000000000040 CR3: 0000001038176000 CR4: 00000000003406e0 Sep 29 09:56:03 st401b-3 kernel: [ 213.719216] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 Sep 29 09:56:03 st401b-3 kernel: [ 213.719741] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Sep 29 09:56:03 st401b-3 kernel: [ 213.720293] Stack: Sep 29 09:56:03 st401b-3 kernel: [ 213.720447] ffff88103536bc00 ffff88103536bc80 ffff88103536bc0c ffff881033141150 Sep 29 09:56:03 st401b-3 kernel: [ 213.721030] ffff8810361d9a00 ffff881034863d68 ffffffff81209e15 ffff881034863dc8 Sep 29 09:56:03 st401b-3 kernel: [ 213.721601] ffffffff812de1a3 ffff88103536bc00 0080004033141150 ffff88103536bc00 Sep 29 09:56:03 st401b-3 kernel: [ 213.722197] Call Trace: Sep 29 09:56:03 st401b-3 kernel: [ 213.722402] [] sysfs_create_link+0x25/0x40 Sep 29 09:56:03 st401b-3 kernel: [ 213.722854] [] add_disk+0x1f3/0x470 Sep 29 09:56:03 st401b-3 kernel: [ 213.723236] [] sd_probe_async+0x107/0x1b0 Sep 29 09:56:03 st401b-3 kernel: [ 213.723636] [] async_run_entry_fn+0x48/0x150 Sep 29 09:56:03 st401b-3 kernel: [ 213.724053] [] process_one_work+0x14d/0x410 Sep 29 09:56:03 st401b-3 kernel: [ 213.724464] [] worker_thread+0x66/0x460 Sep 29 09:56:03 st401b-3 kernel: [ 213.724851] [] ? rescuer_thread+0x2e0/0x2e0 Sep 29 09:56:03 st401b-3 kernel: [ 213.725262] [] kthread+0xdb/0x100 Sep 29 09:56:03 st401b-3 kernel: [ 213.725612] [] ? kthread_park+0x60/0x60 Sep 29 09:56:03 st401b-3 kernel: [ 213.725999] [] ret_from_fork+0x3f/0x70 Sep 29 09:56:03 st401b-3 kernel: [ 213.726379] [] ? kthread_park+0x60/0x60 Sep 29 09:56:03 st401b-3 kernel: [ 213.743800] Code: 75 48 85 ff 74 70 55 48 89 e5 41 57 41 56 41 55 41 54 49 89 fe 53 48 c7 c7 10 4c ec 81 48 89 f3 41 89 cc 49 89 d5 e8 dc 4d 3a 00 <48> 8b 1b 48 85 db 74 08 48 89 df e8 ac c7 ff ff c6 05 85 ae cb Sep 29 09:56:03 st401b-3 kernel: [ 213.781305] RIP [] sysfs_do_create_link_sd.isra.2+0x34/0xb0 Sep 29 09:56:03 st401b-3 kernel: [ 213.799760] RSP Sep 29 09:56:03 st401b-3 kernel: [ 213.818354] CR2: 0000000000000040 Sep 29 09:56:03 st401b-3 kernel: [ 213.836356] ---[ end trace 652e67f80001ba43 ]--- Sep 29 09:56:03 st401b-3 kernel: [ 213.855513] BUG: unable to handle kernel paging request at ffffffffffffffd8 diff --git a/block/genhd.c b/block/genhd.c index a178c8e..318bc63 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -614,7 +614,15 @@ void device_add_disk(struct device *parent, struct gendisk *disk) /* Register BDI before referencing it from bdev */ bdi = &disk->queue->backing_dev_info; - bdi_register_owner(bdi, disk_to_dev(disk)); + if (bdi_register_owner(bdi, disk_to_dev(disk))) { + disk_release_events(disk); + blk_free_devt(devt); + disk->ev = NULL; + disk->first_minor = 0; + disk->major = 0; + WARN_ON(1); + return; + } blk_register_region(disk_devt(disk), disk->minors, NULL, exact_match, exact_lock, disk);