On Thu, 2006-03-09 at 13:18 +0800, Yi Yang wrote:Many structures exported to user space in kernel are undergoing some change, A good application shouldn't count on invariability forever,
Arjan van de Ven wrote:
On Thu, 2006-03-09 at 00:33 +0800, Yi Yang wrote:a change of struct inotify_event can't change ABI, can you describe it more clear?
Current inotify implementation only focus on change of file system, but it doesn'tthis patch appears to change the ABI! That is bad bad bad.
know who results in this change, this patch adds three fields to struct inotify_event,
tgid, uid and gid, they will save process ID, user ID and user group ID of the process
which leads to change in the file system, such software as anti-virus can make use of this feature to monitor who is modifying a specific file.
it breaks ABI because this structure is communicated to userspace, and
you change both the layout and the size of it. What else would ABI
mean??
you can get values of these fields without any problem for kernel thread although they are useless.
Also, how can you guarantee that "current" is valid and meaningful atOf course, current process/thread never disappears before fsnotify_* returns.
the place you use it to get the user id ??
but... what makes you think it's not a kernel thread such as kjournald?
(which have basically meaningless current)
For this case you said, this patch has now way really, do you have a good way to handle this case?
Also the process ID part is really bogus, after all the process may haveYour concern is correct, but uid and git can give out some hints, I ever considered to
exited by the time the inotify client gets to it, and the PID may even
already have been reused.
save the name of current process, however that needs a bigger and length-variable
inotify_event struct, moreover, to get the full path name of current process/thread
in kernel will have a big overhead, so I must select a comprise way.
there is no "full path name" concept in linux like that. And even worse,
many processes will not have *any* path because they have been deleted,
especially the viruses will use this ;)