]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
UBIFS: always read hashed-key nodes under TNC mutex
authorAdrian Hunter <ext-adrian.hunter@nokia.com>
Wed, 20 Aug 2008 13:32:40 +0000 (16:32 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Mon, 25 Aug 2008 11:33:41 +0000 (14:33 +0300)
Leaf-nodes that have a hashed key are stored in the
leaf-node-cache (LNC) which is protected by the TNC
mutex.  Consequently, when reading a leaf node with
a hashed key (i.e. directory entries, xattr entries)
the TNC mutex is always required.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
fs/ubifs/tnc.c

index e909f4a96443a65de717771b3004344f02263332..4fbc5921688f1b2d895323514ab1b022c8d53908 100644 (file)
@@ -1498,7 +1498,6 @@ static int do_lookup_nm(struct ubifs_info *c, const union ubifs_key *key,
 {
        int found, n, err;
        struct ubifs_znode *znode;
-       struct ubifs_zbranch zbr;
 
        dbg_tnc("name '%.*s' key %s", nm->len, nm->name, DBGKEY(key));
        mutex_lock(&c->tnc_mutex);
@@ -1522,11 +1521,7 @@ static int do_lookup_nm(struct ubifs_info *c, const union ubifs_key *key,
                goto out_unlock;
        }
 
-       zbr = znode->zbranch[n];
-       mutex_unlock(&c->tnc_mutex);
-
-       err = tnc_read_node_nm(c, &zbr, node);
-       return err;
+       err = tnc_read_node_nm(c, &znode->zbranch[n], node);
 
 out_unlock:
        mutex_unlock(&c->tnc_mutex);