On Fri, Jun 07, 2024 at 02:17:14PM +0800, Yu Kuai wrote: > Sorry that I just noticed that the sysfs api level_store() calls the > pers->run() as well, and it didn't handle failure by pers->free(). > It's weried that the api will return success in this case, and after > this patch, it will require __md_stop() to free the conf. > > Can you also fix the level_store()? By checking pers->run() and if it > failed, call pers->free() and return error. I can look into it. But if we don't have consistent callers anyway I'd be tempted to not call ->free on ->run failure, as that is a rather unusual convention.