Commit 873d1dac authored by Pavel Emelyanov's avatar Pavel Emelyanov

unix: Move odev to kdev conversion into phys_stat_dev_match

This is more correct, as if st_dev == phys_dev check fails
we have to treat phys_dev as kdev for path resolve device
comparison.

Howver, this is not the case for non-btrfs FSs, and for the
latter one doesn't change anything as it uses anon devices
which are equal for kdev and odev cases.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 0d8f688e
......@@ -172,7 +172,7 @@ dev_t phys_stat_resolve_dev(dev_t st_dev, const char *path)
bool phys_stat_dev_match(dev_t st_dev, dev_t phys_dev, const char *path)
{
if (st_dev == phys_dev)
if (st_dev == kdev_to_odev(phys_dev))
return true;
return phys_dev == phys_stat_resolve_dev(st_dev, path);
......
......@@ -355,7 +355,7 @@ static int unix_collect_one(const struct unix_diag_msg *m,
}
if ((st.st_ino != uv->udiag_vfs_ino) ||
!phys_stat_dev_match(st.st_dev, kdev_to_odev(uv->udiag_vfs_dev), name)) {
!phys_stat_dev_match(st.st_dev, uv->udiag_vfs_dev, name)) {
pr_info("unix: Dropping path %s for "
"unlinked bound "
"sk %#x.%#x real %#x.%#x\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment