Linux block layer
 help / color / mirror / Atom feed
* The gendisk of raid can't be released
@ 2023-03-02 15:51 Xiao Ni
  2023-03-03  2:53 ` Ming Lei
  0 siblings, 1 reply; 3+ messages in thread
From: Xiao Ni @ 2023-03-02 15:51 UTC (permalink / raw)
  To: Christoph Hellwig, Song Liu
  Cc: linux-raid, linux-block, Ming Lei, Nigel Croxon

Hi Christoph

There is a regression problem which is introduced by 84d7d462b16d
(blk-cgroup: pin the gendisk in struct blkcg_gq).

The test commands below can reproduce this:
mdadm -CR /dev/md0 -l10 -n4 /dev/nvme[0-3]n1 --assume-clean
mdadm --stop /dev/md0
mdadm -CR /dev/md0 -l10 -n4 /dev/nvme[0-3]n1 --assume-clean
mdadm: Fail to create md0 when using
/sys/module/md_mod/parameters/new_array, fallback to creation via node
mdadm: unexpected failure opening /dev/md0

The reason is that the gendisk kobj can't be released, so md_free_disk
can't be called. It looks like the patch mentioned above doesn't have
problem. Before this patch, it didn't add the reference to the kobj of
the gendisk. So all things work well. Now it adds the reference to
the kobj of the gendisk in blkg_alloc, but it can't be decremented in
blkg_release. After adding some debug logs, it only adds the reference
of blkg->refcnt, but it doesn't call blkcg_rstat_flush which calls
percpu_ref_put.

So the patch 84d7d462b16d only exposes the reference problem in
block cgroup.

Best Regards
Xiao


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-03  8:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-02 15:51 The gendisk of raid can't be released Xiao Ni
2023-03-03  2:53 ` Ming Lei
2023-03-03  8:51   ` Xiao Ni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox