lxc_fuse: Tell FUSE that /proc/meminfo is nonseekable

If an app within a container wishes to read from /proc/meminfo
from a different position than the beginning of the file, we can
have FUSE keep track of all the lseek()-s and reflect them in
@offset argument of read callback (lxcProcRead()). This is done
by setting fuse_file_info::nonseekable. If we don't do this, then
FUSE reports errors back the app that does lseek().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik 2022-03-01 09:35:48 +01:00
parent 3f2454ca0c
commit 7664955086

View File

@ -118,6 +118,7 @@ lxcProcOpen(const char *path,
return -EACCES;
fi->direct_io = 1;
fi->nonseekable = 1;
return 0;
}