Re: [PATCH] Monitor: release /proc/mdstat fd when no arrays present

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tomasz Majchrzak <tomasz.majchrzak@xxxxxxxxx> writes:
> If md kernel module is reloaded, /proc/mdstat cannot be accessed ("cat:
> /proc/mdstat: No such file or directory"). The reason is mdadm monitor
> still holds a file descriptor to previous /proc/mdstat instance. It
> leads to really confusing outcome of the following operations - mdadm
> seems to run without errors, however some udev rules don't get executed
> and new array doesn't work.
>
> Add a check if lseek was successful as it fails if md kernel module has
> been unloaded - close a file descriptor then. The problem is mdadm
> monitor doesn't always do it before next operation takes place. To
> prevent it monitor always releases /proc/mdstat descriptor when there
> are no arrays to be monitored, just in case driver unload happens in a
> moment.
>
> Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@xxxxxxxxx>
> Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@xxxxxxxxx>
> ---
>  Monitor.c | 2 ++
>  mdstat.c  | 6 +++++-
>  2 files changed, 7 insertions(+), 1 deletion(-)

Looks good, applied!

Thanks,
Jes
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux