files-reg: warn when external file has no inherit-fd mapping on restore

In open_path(), when inherit_fd_lookup_id() returns negative for an
external file, execution silently falls through to the normal open
path causing an incorrect size mismatch error. Added a pr_warn() to
make the failure explicit.

Fixes: #2951
Signed-off-by: Cameron Badman <cbadwork@gmail.com>
This commit is contained in:
Cameron Badman 2026-03-18 23:47:10 +10:00 committed by Andrei Vagin
parent 176f140198
commit 592f04507b

View file

@ -2216,6 +2216,7 @@ int open_path(struct file_desc *d, int (*open_cb)(int mntns_root, struct reg_fil
rfi->path = path;
goto ext;
}
pr_warn("External file %s has no --inherit-fd mapping on restore\n", rfi->rfe->name);
}
if (rfi->remap) {