On 12/18/2018 9:00 AM, Leon Romanovsky wrote:
From: Leon Romanovsky <leonro@xxxxxxxxxxxx> Disable device rename functionality for hfi1 driver, because current state where users can rename device name visible to them in dmesg, netlink e.t.c and not reflected in debugfs produces ambiguity to the users. [1] https://patchwork.kernel.org/patch/10723375/ Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> --- drivers/infiniband/core/device.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index 06aeababf705..d733b2b63b60 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c @@ -214,6 +214,21 @@ int ib_device_rename(struct ib_device *ibdev, const char *name) struct ib_device *device; int ret = 0; + if (ibdev->driver_id == RDMA_DRIVER_HFI1) + /* + * hfi1 debugfs entries are device name based, + * it means that any change in device name will create + * mess for the users, while all prints/netlink will report + * new name and debugfs will report old name. + * + * Attempts to solve it by ensuring that debugfs is unique + * for that driver failed https://patchwork.kernel.org/patch/10723375/ + * + * Need to return error here to ensure that any future systemd changes + * won't break for the distros while working with hfi1. + */ + return -EOPNOTSUPP; + /* If old and new name are same, nothing more to be done */ if (!strcmp(name, dev_name(&ibdev->dev))) return ret; -- 2.19.1
Please continue the discussion before applying patches like this. I'm not a fan of the comments here either.
Your assumption that debugfs needs to match what gets put in dmesg is not necessarily valid.
So it's a Nak from me for now until the discussion concludes and you respond to Mike's questions in:
https://marc.info/?l=linux-rdma&m=154514263920253&w=2 -Denny