On 07/01/2013 05:49 PM, [email protected] wrote: > Hi! >> Add an additional kernel version field compare is more sane. >> But the RHEL version number like "2.6.18-248" is not common. >> So we add this specific version number check function *_rh_* >> only for RHEL use. Further more, we can add addition specific >> kernel version number check functions for SLES and so on if needed. > > What is the expected usage? > > Do we have a test that started to fail due to change that has been > introduced in some RHEL kernel update that changed only the last number > in version? >
Yes, for inotify04 on RHEL5. Below commit is back-ported to RHEL5 updated version, so then inotify will send IN_ATTRIB events when link count changes. But in test case, we only judge the kernel version 2.6.25 to add IN_ATTRIB event. commit ece95912db94d98e202cbedb8f35206deb29d83d Author: Jan Kara <[email protected]> Date: Wed Feb 6 01:37:13 2008 -0800 inotify: send IN_ATTRIB events when link count changes Currently, no notification event has been sent when inode's link count changed. This is inconvenient for the application in some cases: Suppose you have the following directory structure foo/test bar/ and you watch test. If someone does "mv foo/test bar/", you get event IN_MOVE_SELF and you know something has happened with the file "test". However if someone does "ln foo/test bar/test" and "rm foo/test" you get no inotify event for the file "test" (only directories "foo" and "bar" receive events). Furthermore it could be argued that link count belongs to file's metadata and thus IN_ATTRIB should be sent when it changes. The following patch implements sending of IN_ATTRIB inotify events when link count of the inode changes, i.e., when a hardlink to the inode is created or when it is removed. This event is sent in addition to all the events sent so far. In particular, when a last link to a file is removed, IN_ATTRIB event is sent in addition to IN_DELETE_SELF event. Signed-off-by: Jan Kara <[email protected]> Acked-by: Morten Welinder <[email protected]> Cc: Robert Love <[email protected]> Cc: John McCutchan <[email protected]> Cc: Steven French <[email protected]> Cc: Kamalesh Babulal <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> RHEL5 changelog: - [fs] inotify: send IN_ATTRIB event on link count changes (Eric Paris ) [471893] The man page of inotify said that: IN_ATTRIB Metadata changed, e.g., permissions, timestamps, extended attributes, link count (since Linux 2.6.25), UID, GID, etc. (*). So, in the test case, we judge that if the kernel version is less than 2.6.25, we assume that the IN_ATTRIB will not be sent in the event. But after back-port this patch, RHEL5 includes this event when the link count changes. There are many test cases are suffering such situation, because sometimes the patch back-port may break our kernel version check. So I considering introduce some vendor specific kernel version check like RHEL and SLES. Thanks, Wanlong Gao ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
