Commit d07ed204 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

mount: fix comparison of stat.st_dev and mount_info->s_dev (v2)

st_dev and s_dev have different formats.
st_dev is (MAJOR(dev) << 8) | MINOR(dev)
s_dev is (MAJOR(dev) << 20) | MINOR(dev)

so we need to convert one of them

v2: use kdev_to_odev
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 81999b70
......@@ -502,7 +502,7 @@ static int __open_mountpoint(struct mount_info *pm, int mnt_fd)
goto err;
}
if (st.st_dev != pm->s_dev) {
if (st.st_dev != kdev_to_odev(pm->s_dev)) {
pr_err("The file system %#x (%#x) %s %s is inaccessible\n",
pm->s_dev, (int)st.st_dev, pm->fstype->name, pm->mountpoint);
goto err;
......
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