linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [QUESTION] How to fix the race of "mdadm --add" and "mdadm mdadm --incremental --export"
@ 2023-03-14 14:58 Li Xiao Keng
  2023-03-14 15:04 ` Martin Wilck
  2023-03-14 16:40 ` Coly Li
  0 siblings, 2 replies; 14+ messages in thread
From: Li Xiao Keng @ 2023-03-14 14:58 UTC (permalink / raw)
  To: Jes Sorensen, Martin Wilck, Paul Menzel, Coly Li, linux-raid
  Cc: linfeilong, louhongxiang, liuzhiqiang (I), miaoguanqin

Hi,
   Here we meet a question. When we add a new disk to a raid, it may return
-EBUSY.
   The main process of --add(for example md0, sdf):
       1.dev_open(sdf)
       2.add_to_super
       3.write_init_super
       4.fsync(fd)
       5.close(fd)
       6.ioctl(ADD_NEW_DISK).
   However, there will be some udev(change of sdf) event after step5. Then
"/usr/sbin/mdadm --incremental --export $devnode --offroot $env{DEVLINKS}"
will be run, and the sdf will be added to md0. After that, step6 will return
-EBUSY.
   It is a problem to user. First time adding disk does not return success
but disk is actually added. And I have no good idea to deal with it. Please
give some great advice.

Regards,
Li Xiao Keng

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

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

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-14 14:58 [QUESTION] How to fix the race of "mdadm --add" and "mdadm mdadm --incremental --export" Li Xiao Keng
2023-03-14 15:04 ` Martin Wilck
2023-03-14 15:59   ` Mariusz Tkaczyk
2023-03-14 16:11     ` Martin Wilck
2023-03-15 10:10       ` Mariusz Tkaczyk
2023-03-15 13:10         ` Li Xiao Keng
2023-03-15 14:14           ` Martin Wilck
2023-03-15 14:57             ` Li Xiao Keng
2023-03-15 15:01               ` Martin Wilck
2023-03-16 10:44                 ` Mariusz Tkaczyk
2023-03-20 15:36                   ` Martin Wilck
2023-03-20 15:51                     ` Mariusz Tkaczyk
2023-03-14 16:40 ` Coly Li
2023-03-15  2:25   ` Li Xiao Keng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).