- For consistency, remove "." and ".." entries from de_dlist before
calling devfs_delete() (and thus possibly dropping dm_lock) in devfs_rmdir_empty(). - Assert that we don't return doomed entries from devfs_find(). [1] Suggested by: kib [1] Reviewed by: kib
This commit is contained in:
parent
ac1d9eedaf
commit
8c48e7bab1
@ -171,6 +171,8 @@ devfs_find(struct devfs_dirent *dd, const char *name, int namelen, int type)
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
KASSERT(de == NULL || (de->de_flags & DE_DOOMED) == 0,
|
||||
("devfs_find: returning a doomed entry"));
|
||||
return (de);
|
||||
}
|
||||
|
||||
@ -302,6 +304,8 @@ devfs_rmdir_empty(struct devfs_mount *dm, struct devfs_dirent *de)
|
||||
|
||||
dd = devfs_parent_dirent(de);
|
||||
KASSERT(dd != NULL, ("devfs_rmdir_empty: NULL dd"));
|
||||
TAILQ_REMOVE(&de->de_dlist, de_dot, de_list);
|
||||
TAILQ_REMOVE(&de->de_dlist, de_dotdot, de_list);
|
||||
TAILQ_REMOVE(&dd->de_dlist, de, de_list);
|
||||
DEVFS_DE_HOLD(dd);
|
||||
devfs_delete(dm, de, DEVFS_DEL_NORECURSE);
|
||||
|
Loading…
Reference in New Issue
Block a user