[PATCH] Revert "lxc_fuse: Tell FUSE that /proc/meminfo is nonseekable"

Michal Privoznik posted 1 patch 10 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/a6213ce628642b1dfdb86f9b5ca3109a740990d6.1688022572.git.mprivozn@redhat.com
src/lxc/lxc_fuse.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] Revert "lxc_fuse: Tell FUSE that /proc/meminfo is nonseekable"
Posted by Michal Privoznik 10 months, 1 week ago
After v8.1.0-61-g030faee28d it is no longer necessary to make the
/proc/meminfo file nonseekable as our code that fills the file
with spoofed values can handle seeking just fine.

Previously, `free(1)` was okay with failed lseek(), but this was
ages ago and meanwhile the procps project moved to creating a
library and moved the file parsing code under an exported
function. In attempt to make the function callable multiple
times, it can lseek() multiple times and failure to do so is
fatal.

This reverts commit 766495508650bebd5f4ac23224ecd0a2ee2ca9eb.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/492
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---

Ideally, I'd like to merge this in the time for upcoming release, but I
don't insist. It's a bug fix after all ;-)

 src/lxc/lxc_fuse.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c
index a11cbbaff7..44bdd1412d 100644
--- a/src/lxc/lxc_fuse.c
+++ b/src/lxc/lxc_fuse.c
@@ -163,7 +163,6 @@ lxcProcOpen(const char *path,
         return -EACCES;
 
     fi->direct_io = 1;
-    fi->nonseekable = 1;
     return 0;
 }
 
-- 
2.39.3
Re: [PATCH] Revert "lxc_fuse: Tell FUSE that /proc/meminfo is nonseekable"
Posted by Ján Tomko 10 months, 1 week ago
On a Thursday in 2023, Michal Privoznik wrote:
>After v8.1.0-61-g030faee28d it is no longer necessary to make the
>/proc/meminfo file nonseekable as our code that fills the file
>with spoofed values can handle seeking just fine.
>
>Previously, `free(1)` was okay with failed lseek(), but this was
>ages ago and meanwhile the procps project moved to creating a
>library and moved the file parsing code under an exported
>function. In attempt to make the function callable multiple
>times, it can lseek() multiple times and failure to do so is
>fatal.
>
>This reverts commit 766495508650bebd5f4ac23224ecd0a2ee2ca9eb.
>

Please drop the trailing period behind the commit id

>Resolves: https://gitlab.com/libvirt/libvirt/-/issues/492
>Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
>---
>
>Ideally, I'd like to merge this in the time for upcoming release, but I
>don't insist. It's a bug fix after all ;-)
>

It is a bug fix.

> src/lxc/lxc_fuse.c | 1 -
> 1 file changed, 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano