diff options
author | Alex Shi <alex.shi@linaro.org> | 2015-04-18 12:59:16 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2015-04-18 12:59:16 +0800 |
commit | 667ea3959654ae48ef303df13f2635fd07766cb4 (patch) | |
tree | 7f284b5ec16d010773a1101e02b0acb141ae40f4 /fs/hfsplus/brec.c | |
parent | 2dad587ec1dddf02a00d3b54156337a6dc79a752 (diff) | |
parent | 6fb17a412207343151aac1fde91935a542339deb (diff) |
Merge remote-tracking branch 'origin/v3.14/topic/overlayfs' into linux-linaro-lsk-v3.14
Diffstat (limited to 'fs/hfsplus/brec.c')
-rw-r--r-- | fs/hfsplus/brec.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/fs/hfsplus/brec.c b/fs/hfsplus/brec.c index 6e560d56094b..754fdf8c6356 100644 --- a/fs/hfsplus/brec.c +++ b/fs/hfsplus/brec.c @@ -131,13 +131,16 @@ skip: hfs_bnode_write(node, entry, data_off + key_len, entry_len); hfs_bnode_dump(node); - if (new_node) { - /* update parent key if we inserted a key - * at the start of the first node - */ - if (!rec && new_node != node) - hfs_brec_update_parent(fd); + /* + * update parent key if we inserted a key + * at the start of the node and it is not the new node + */ + if (!rec && new_node != node) { + hfs_bnode_read_key(node, fd->search_key, data_off + size); + hfs_brec_update_parent(fd); + } + if (new_node) { hfs_bnode_put(fd->bnode); if (!new_node->parent) { hfs_btree_inc_height(tree); @@ -168,9 +171,6 @@ skip: goto again; } - if (!rec) - hfs_brec_update_parent(fd); - return 0; } @@ -370,6 +370,8 @@ again: if (IS_ERR(parent)) return PTR_ERR(parent); __hfs_brec_find(parent, fd, hfs_find_rec_by_key); + if (fd->record < 0) + return -ENOENT; hfs_bnode_dump(parent); rec = fd->record; |