Skip to content

Commit

Permalink
Demote fsnotify logs for ignored failures.
Browse files Browse the repository at this point in the history
Make logs about inaccessible mounts warnings, as the failures are
normally harmless (e.g. failure to read /dev/cgroup) and don't
make the CRIU run fail. (If it happens that the fsnotify can't
find a file, then to debug, full CRIU logs will be necessary anyway.)

Signed-off-by: Michał Mirosław <emmir@google.com>
  • Loading branch information
osctobe committed Jun 14, 2023
1 parent 661a11c commit 1ba14e4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions criu/mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ int __check_mountpoint_fd(struct mount_info *pm, int mnt_fd, bool parse_mountinf
dev == pm->s_dev_rt)
return 0;

pr_err("The file system %#x %#x (%#x) %s %s is inaccessible\n", pm->s_dev, pm->s_dev_rt, dev,
pr_warn("The file system %#x %#x (%#x) %s %s is inaccessible\n", pm->s_dev, pm->s_dev_rt, dev,
pm->fstype->name, pm->ns_mountpoint);
return -1;
}
Expand Down Expand Up @@ -1228,7 +1228,7 @@ int __open_mountpoint(struct mount_info *pm)
return -1;
}

if (check_mountpoint_fd(pm, mnt_fd)) {
if (__check_mountpoint_fd(pm, mnt_fd, false)) {
close(mnt_fd);
return -1;
}
Expand All @@ -1239,12 +1239,16 @@ int __open_mountpoint(struct mount_info *pm)
int open_mount(unsigned int s_dev)
{
struct mount_info *m;
int mnt_fd;

m = lookup_mnt_sdev(s_dev);
if (!m)
return -ENOENT;

return __open_mountpoint(m);
mnt_fd = __open_mountpoint(m);
if (mnt_fd < 0)
pr_err("Can't open mount %#x\n", s_dev);
return mnt_fd;
}

/* Bind-mount a mount point in a temporary place without children */
Expand Down

0 comments on commit 1ba14e4

Please sign in to comment.