diff options
author | Adrian Hunter <ext-adrian.hunter@nokia.com> | 2008-08-20 09:32:40 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-08-25 07:33:41 -0400 |
commit | 761e29f3bb19b05bea55285dfdf2d28e001a63b8 (patch) | |
tree | 36acaae9cbcca6f613c03e29f7e7fe61bb4f243b /fs | |
parent | 04da11bfcf511544ae19e0a7e5f994b3237752ac (diff) |
UBIFS: always read hashed-key nodes under TNC mutex
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ubifs/tnc.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/ubifs/tnc.c b/fs/ubifs/tnc.c index e909f4a9644..4fbc5921688 100644 --- a/fs/ubifs/tnc.c +++ b/fs/ubifs/tnc.c | |||
@@ -1498,7 +1498,6 @@ static int do_lookup_nm(struct ubifs_info *c, const union ubifs_key *key, | |||
1498 | { | 1498 | { |
1499 | int found, n, err; | 1499 | int found, n, err; |
1500 | struct ubifs_znode *znode; | 1500 | struct ubifs_znode *znode; |
1501 | struct ubifs_zbranch zbr; | ||
1502 | 1501 | ||
1503 | dbg_tnc("name '%.*s' key %s", nm->len, nm->name, DBGKEY(key)); | 1502 | dbg_tnc("name '%.*s' key %s", nm->len, nm->name, DBGKEY(key)); |
1504 | mutex_lock(&c->tnc_mutex); | 1503 | mutex_lock(&c->tnc_mutex); |
@@ -1522,11 +1521,7 @@ static int do_lookup_nm(struct ubifs_info *c, const union ubifs_key *key, | |||
1522 | goto out_unlock; | 1521 | goto out_unlock; |
1523 | } | 1522 | } |
1524 | 1523 | ||
1525 | zbr = znode->zbranch[n]; | 1524 | err = tnc_read_node_nm(c, &znode->zbranch[n], node); |
1526 | mutex_unlock(&c->tnc_mutex); | ||
1527 | |||
1528 | err = tnc_read_node_nm(c, &zbr, node); | ||
1529 | return err; | ||
1530 | 1525 | ||
1531 | out_unlock: | 1526 | out_unlock: |
1532 | mutex_unlock(&c->tnc_mutex); | 1527 | mutex_unlock(&c->tnc_mutex); |