libfuse: fix the 'remember' option
authorMadan Valluri <mvalluri@cumulus-systems.com>
Mon, 4 Feb 2013 17:30:14 +0000 (18:30 +0100)
committerMiklos Szeredi <mszeredi@suse.cz>
Mon, 4 Feb 2013 17:30:14 +0000 (18:30 +0100)
The lru list was not initialized for the "/" path.  This resulted in
remove_node_lru() crashing on LOOKUP-DOTDOT.

Patch by Madan Valluri.
--
 ChangeLog  |    4 ++++
 lib/fuse.c |    4 ++++
 2 files changed, 8 insertions(+)

ChangeLog
lib/fuse.c

index 076bcaf54490bf7f85930dbc796cff0e7f15d559..5a648be99f116d8a817b1ac306e9f232e644b407 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@
 
        * libfuse: fix crash in unlock_path().  Patch by Ratna Manoj
 
+       * libfuse: fix the 'remember' option.  The lru list was not
+       initialized for the "/" path.  This resulted in remove_node_lru()
+       crashing on LOOKUP-DOTDOT.  Patch by Madan Valluri
+
 2012-10-01  Miklos Szeredi <miklos@szeredi.hu>
 
        * Released 2.9.2
index 1917346c759d4cca13c513372f6b68b02fa3402f..f4046500d3c9091e205a90df897472a69c54e5c8 100644 (file)
@@ -4698,6 +4698,10 @@ struct fuse *fuse_new_common(struct fuse_chan *ch, struct fuse_args *args,
                fprintf(stderr, "fuse: memory allocation failed\n");
                goto out_free_id_table;
        }
+       if (lru_enabled(f)) {
+               struct node_lru *lnode = node_lru(root);
+               init_list_head(&lnode->lru);
+       }
 
        strcpy(root->inline_name, "/");
        root->name = root->inline_name;