diff options
| author | Jan Engelmohr <jan.engelmohr@mailbox.tu-dresden.de> | 2016-07-26 18:11:06 +0200 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2016-08-26 16:00:05 +0200 |
| commit | 42fb8800204306978c6fb8f99ef68b8c1e895fd2 (patch) | |
| tree | 1b90dc930c732604ec6ab4d26a7d366264d0d292 /fs/hfsplus/brec.c | |
| parent | 66b3b5f4bb0c4811f364332d0268fbc047835d71 (diff) | |
3.10.73 -> 3.10.74
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 6e560d560..754fdf8c6 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; |
