On Tuesday, May 17, 2016 15:39:27 Andrew Lunn wrote:
A hard interface can be removed and then added back in quick succession. This is particularly true for hdlc interface when changing the protocol.
It is not possible it synchronously remove the sysfs and debugfs entries for the hard interface when it is removed because the files may be open. Thus removal is deferred. The files may thus already exist in sysfs and debugfs when the hard interface is re-added, and the operations fail.
To fix this race, synchronously rename the debugfs and sysfs files to a unique temporary name, thus making the name available when the interface comes back, yet keeps open files still available.
Signed-off-by: Andrew Lunn andrew@lunn.ch
net/batman-adv/debugfs.c | 23 +++++++++++++++++++++++ net/batman-adv/debugfs.h | 1 + net/batman-adv/hard-interface.c | 19 +++++++++++++++++++ net/batman-adv/sysfs.c | 17 +++++++++++++++++ net/batman-adv/sysfs.h | 2 ++ 5 files changed, 62 insertions(+)
Applied in revision 6b0485c.
Thanks, Marek