Merge pull request #17431 from msekletar/udev-link-update-race

udev: make algorithm that selects highest priority devlink less susceptible to race conditions
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2020-11-10 09:41:57 +01:00
committed by GitHub
6 changed files with 1850 additions and 496 deletions
+2 -1
View File
@@ -408,7 +408,8 @@ bool stat_inode_unmodified(const struct stat *a, const struct stat *b) {
return a && b &&
(a->st_mode & S_IFMT) != 0 && /* We use the check for .st_mode if the structure was ever initialized */
((a->st_mode ^ b->st_mode) & S_IFMT) == 0 && /* same inode type */
a->st_mtime == b->st_mtime &&
a->st_mtim.tv_sec == b->st_mtim.tv_sec &&
a->st_mtim.tv_nsec == b->st_mtim.tv_nsec &&
(!S_ISREG(a->st_mode) || a->st_size == b->st_size) && /* if regular file, compare file size */
a->st_dev == b->st_dev &&
a->st_ino == b->st_ino &&