[LU-4453] Have prepare-commit-msg or checkpatch.pl to warn about deprecated cfs_* uses Created: 07/Jan/14  Updated: 03/Jun/14  Resolved: 03/Jun/14

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.6.0
Fix Version/s: Lustre 2.6.0

Type: Bug Priority: Major
Reporter: Andreas Dilger Assignee: John Hammond
Resolution: Fixed Votes: 0
Labels: RoDC, checkpatch

Severity: 3
Rank (Obsolete): 12208

 Description   

It would be useful for prepare-commit-msg and/or checkpatch.pl warn about cfs_list_() and cfs_atomic_() and other deprecated wrappers in new patches.

I think checkpatch.pl has a feature for reporting on deprecated function usage, or we could call the sed script to report on any changes that it finds.

Now that we are close to finishing the cfs_* wrapper removal we don't want to introduce new users in patches that are landing.



 Comments   
Comment by John Hammond [ 08/Jan/14 ]

For checkpatch.pl to warn on cfs_xxx() identifiers we would need to modify Documentation/feature-removal-schedule.txt in the kernel source. Or we could modify checkpatch.pl. Or we could use sed.

Comment by John Hammond [ 12/Feb/14 ]

What exactly should we warn about:

  1. each function defined in libcfs/include/libcfs/list.h with a cfs_ prefix
  2. any function matching cfs_list_*
  3. ... cfs_hlist_*
  4. ... cfs_atomic_*
  5. ... cfs_timer_*
  6. ... cfs_time_*
  7. ... cfs_proc_*

Other?

We should also update the coding guidelines to say what's deprecated.

Comment by John Hammond [ 12/Feb/14 ]
  1. cfs_bitmap_*
  2. cfs_capable
  3. cfs_cap_*
  4. cfs_duration_sec
  5. cfs_duration_t
  6. cfs_duration_usec
  7. cfs_fs_time_current
  8. cfs_fs_time_t
  9. cfs_init_timer
  10. cfs_module()
  11. CFS_MODULE_PARM
  12. CFS_O_* (CFS_O_ACCMODE, CFS_O_APPEND, ...)
  13. CFS_PAGE_MASK
  14. CFS_PAGE_SIZE
Comment by John Hammond [ 12/Feb/14 ]

Bad functions:

  1. sprintf
  2. strcat
  3. strcpy

Including asm headers.

Comment by John Hammond [ 11/Mar/14 ]

Please see http://review.whamcloud.com/#/c/9585/.

Comment by Li Xi (Inactive) [ 12/Mar/14 ]

Do we really need to remove the checking of Documentation/feature-removal-schedule.txt? I think it might be better if we both check Documentation/feature-removal-schedule.txt and keep a special list of Lustre (e.g. cfs_*). Otherwise, it is easy to miss some deprecated functions/include files in Documentation/feature-removal-schedule.txt.

Comment by John Hammond [ 12/Mar/14 ]

Hi Li Xi, I see your point, but when I looked at checkpatch.pl from the 3.12 tree I saw that the deprecated function logic had been removed entirely.

Comment by Li Xi (Inactive) [ 12/Mar/14 ]

Ah, I see. That file has been removed since 9c0ece069b3. Thanks for pointing that out.

Comment by Jodi Levi (Inactive) [ 03/Jun/14 ]

Patch landed to Master.

Generated at Sat Feb 10 01:42:52 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.