RFC kobject_set_name - error handling
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest2 patches 11 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | kobject_set_name - error handlingdrivers/ drivers/ | +13 | 6 replies | |
| 2/2 | kobject_set_name - error handlingdrivers/ fs/ include/ +3 more | +29 | 1 reply | |
| 2/2 | sysfs_rename_dir-cleanupdrivers/ fs/ include/ +3 more | +32 | 4 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC 0/2] kobject_set_name - error handling
IMO error handling/propogation is incorrect or not there in most of the places in the users of kobject_set_name. sysfs_rename_dir is one of them.
1) sysfs_rename_dir ignores return code from kobject_set_name, and returns void
2) kobject_rename returns void
3) dev_change_name ignore return code from class_device_rename.
This can lead to mismatch in kobject name and the directory name. Now correcting this will involve changing the APIs at this point of time. Luckily we have just one user of sysfs_rename_dir as of now.
Like this there are 14 other users of kobject_set_name and only one checks the return code. Out of them atleast following are problematic IMO.
bus_add_driver()bus_register()sys_dev_register()sysfs_rename_dir()
Others are not because we have name length less than KOBJ_NAME_LEN and there will be no allocation. I have corrected the above problems in the following two patches.
Please comment.
Thanks,
Maneesh
Signature · 6 lines
Maneesh Soni Linux Technology Center, IBM Software Lab, Bangalore, India email: [email protected] Phone: 91-80-25044999 Fax: 91-80-25268553 T/L : 9243696