diff options
author | Gary S. Robertson <gary.robertson@linaro.org> | 2015-11-18 16:00:23 -0600 |
---|---|---|
committer | Gary S. Robertson <gary.robertson@linaro.org> | 2015-11-18 16:00:23 -0600 |
commit | fe7e08f8621d68222f1c65599d8c8d10f0cf5164 (patch) | |
tree | 78b986dce0ca910245ec379c9725033b0b25fddd /fs/hfs/brec.c | |
parent | 701f68f192e35dfc22c6a456c8a60fb4e9ff7d02 (diff) | |
parent | 53c3c13396c2a8ee4fd9e83141b3e2b22223e590 (diff) |
Merge tag 'lsk-v4.1-15.10' of http://git.linaro.org/kernel/linux-linaro-stable into linux-linaro-lng-v4.1linux-lng-4.1.10-2015.11
LSK 15.10 v4.1
Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org>
Conflicts:
linaro/configs/linaro-base.conf
Diffstat (limited to 'fs/hfs/brec.c')
-rw-r--r-- | fs/hfs/brec.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/fs/hfs/brec.c b/fs/hfs/brec.c index 9f4ee7f52026..6fc766df0461 100644 --- a/fs/hfs/brec.c +++ b/fs/hfs/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); @@ -166,9 +169,6 @@ skip: goto again; } - if (!rec) - hfs_brec_update_parent(fd); - return 0; } @@ -366,6 +366,8 @@ again: if (IS_ERR(parent)) return PTR_ERR(parent); __hfs_brec_find(parent, fd); + if (fd->record < 0) + return -ENOENT; hfs_bnode_dump(parent); rec = fd->record; |