From b515e37f8f21e30a45de7faef678a5ebdf3ebd87 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 24 Jul 2020 16:43:03 +0200 Subject: [FUSE] Tweak timeout values to prevent stale status file If we cat the stats file right after starting the fuse client, its contents will be cached forever. The exact cause is unknown, since the timeout was specified as one second, but setting it to 0 seems to fix this issue. --- src/fuse/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/fuse') diff --git a/src/fuse/main.c b/src/fuse/main.c index df30602..f303c9c 100644 --- a/src/fuse/main.c +++ b/src/fuse/main.c @@ -99,7 +99,7 @@ static void image_ll_getattr( fuse_req_t req, fuse_ino_t ino, struct fuse_file_i if ( image_stat( ino, &stbuf ) == -1 ) { fuse_reply_err( req, ENOENT ); } else { - fuse_reply_attr( req, &stbuf, ino == INO_IMAGE ? 120 : 1 ); // seconds validity timeout + fuse_reply_attr( req, &stbuf, ino == INO_IMAGE ? 1200 : 1 ); // seconds validity timeout } } @@ -111,10 +111,10 @@ static void image_ll_lookup( fuse_req_t req, fuse_ino_t parent, const char *name struct fuse_entry_param e = { 0 }; if ( strcmp( name, IMAGE_NAME ) == 0 ) { e.ino = INO_IMAGE; - e.attr_timeout = e.entry_timeout = 120; + e.attr_timeout = e.entry_timeout = 1200; } else { e.ino = INO_STATS; - e.attr_timeout = e.entry_timeout = 1; + e.attr_timeout = e.entry_timeout = 0; } if ( image_stat( e.ino, &e.attr ) == 0 ) { fuse_reply_entry( req, &e ); -- cgit v1.2.3-55-g7522