Details
-
Bug
-
Resolution: Fixed
-
Minor
-
Lustre 2.5.1
-
3
-
14650
Description
Neither llapi_hsm_register_event_fifo() nor
llapi_hsm_unregister_event_fifo() take a const as their argument. This
lead to the following compilation warning when a caller is using a
const char *:
... warning: passing argument 1 of ‘llapi_hsm_register_event_fifo’ discards ‘const’ qualifier from pointer target type [enabled by default] rc = llapi_hsm_register_event_fifo(lustre_fifo_event); ^ ... note: expected ‘char *’ but argument is of type ‘const char *’ extern int llapi_hsm_register_event_fifo(char *path);
Also, llapi_hsm_event_fd is local, so make it static.
And finally, do not unconditionally delete the HSM event fifo.
The lustreapi HSM library will use a pipe if it already exists.
However the deregistration will unconditionally delete that pipe,
which is not correct.
An admin may want to create the pipe with certain rights/ownership,
which the llapi_hsm_register_event_fifo() doesn't allow. In that case,
llapi_hsm_unregister_event_fifo() should not delete it.
Patches to follow.