* [PATCH] reiser4: fixed bug in reiser4_kill_root()
@ 2017-11-08 20:50 Edward Shishkin
2017-11-09 3:31 ` Jose R R
0 siblings, 1 reply; 3+ messages in thread
From: Edward Shishkin @ 2017-11-08 20:50 UTC (permalink / raw)
To: ReiserFS development mailing list
[-- Attachment #1: Type: text/plain, Size: 293 bytes --]
Hi all,
Probably, this is the most essential "old sleeping" bug
found for the latest 3 years. It could lead to data corruption
(not proven). Details are in the changeset.
It will go to reiser4-for-4.13.1 and higher. For other
stuff please, apply (backport, etc) by yourself.
Thanks,
Edward.
[-- Attachment #2: reiser4-fix-kill-root.patch --]
[-- Type: text/x-patch, Size: 1856 bytes --]
commit 5e8518e0031c97e21830372721ee7a5fae78d610
Author: Edward Shishkin <edward.shishkin@gmail.com>
Date: Wed Nov 8 21:27:44 2017 +0100
Fixed bug in reiser4_kill_root(): wrong function was called
for reinitialization of the old root. As the result, cached
number of items remained not updated (i.e. corruption of
memory data structures). In practice problems could happen
when removing file sets large enough to reduce storage tree
height, i.e. when old root is killed and its single child
becomes a new root.
Signed-off-by: Edward Shishkin <edward.shishkin@gmail.com>
diff --git a/jnode.c b/jnode.c
index d8b2f8600..0f1594cd6 100644
--- a/jnode.c
+++ b/jnode.c
@@ -1310,7 +1310,7 @@ static int remove_znode(jnode * node, reiser4_tree * tree)
}
/* ->init() method for formatted nodes */
-static int init_znode(jnode * node)
+int init_znode(jnode * node)
{
znode *z;
diff --git a/tree_mod.c b/tree_mod.c
index 26fff5f08..f9687df8f 100644
--- a/tree_mod.c
+++ b/tree_mod.c
@@ -317,7 +317,7 @@ static int reiser4_kill_root(reiser4_tree * tree /* tree from which root is
write_unlock_tree(tree);
/* reinitialise old root. */
- result = node_plugin_by_node(old_root)->init(old_root);
+ result = init_znode(ZJNODE(old_root));
znode_make_dirty(old_root);
if (result == 0) {
assert("nikita-1279", node_is_empty(old_root));
diff --git a/znode.h b/znode.h
index 164fb985a..613377ef6 100644
--- a/znode.h
+++ b/znode.h
@@ -218,6 +218,7 @@ extern void znode_remove(znode *, reiser4_tree *);
extern znode *znode_parent(const znode * node);
extern znode *znode_parent_nolock(const znode * node);
extern int znode_above_root(const znode * node);
+extern int init_znode(jnode *node);
extern int init_znodes(void);
extern void done_znodes(void);
extern int znodes_tree_init(reiser4_tree * ztree);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] reiser4: fixed bug in reiser4_kill_root()
2017-11-08 20:50 [PATCH] reiser4: fixed bug in reiser4_kill_root() Edward Shishkin
@ 2017-11-09 3:31 ` Jose R R
2017-11-09 13:14 ` Jose R R
0 siblings, 1 reply; 3+ messages in thread
From: Jose R R @ 2017-11-09 3:31 UTC (permalink / raw)
To: Edward Shishkin; +Cc: ReiserFS development mailing list
On Wed, Nov 8, 2017 at 12:50 PM, Edward Shishkin
<edward.shishkin@gmail.com> wrote:
> Hi all,
>
> Probably, this is the most essential "old sleeping" bug
> found for the latest 3 years. It could lead to data corruption
> (not proven). Details are in the changeset.
> It will go to reiser4-for-4.13.1 and higher. For other
> stuff please, apply (backport, etc) by yourself.
>
Much appreciated, Edward.
I will apply patch during my build of Linux 4.13.12 for Debian --
later in the evening/night -- to give it a spin.
uname -a
Linux huitzilopochtli 4.13.0-1+reiser4.0.1-amd64 #1 SMP Debian
4.13.11-1+reiser4.0.1 (2017-11-03) x86_64 GNU/Linux
Best Professional Regards.
--
Jose R R
http://metztli.it
---------------------------------------------------------------------------------------------
Download Metztli Reiser4: Debian Stretch with Linux 4.12
---------------------------------------------------------------------------------------------
for AMD64 https://sf.net/projects/metztli-reiser4/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] reiser4: fixed bug in reiser4_kill_root()
2017-11-09 3:31 ` Jose R R
@ 2017-11-09 13:14 ` Jose R R
0 siblings, 0 replies; 3+ messages in thread
From: Jose R R @ 2017-11-09 13:14 UTC (permalink / raw)
To: Edward Shishkin; +Cc: ReiserFS development mailing list
On Wed, Nov 8, 2017 at 7:31 PM, Jose R R <jose.r.r@metztli.com> wrote:
> On Wed, Nov 8, 2017 at 12:50 PM, Edward Shishkin
> <edward.shishkin@gmail.com> wrote:
>> Hi all,
>>
>> Probably, this is the most essential "old sleeping" bug
>> found for the latest 3 years. It could lead to data corruption
>> (not proven). Details are in the changeset.
>> It will go to reiser4-for-4.13.1 and higher. For other
>> stuff please, apply (backport, etc) by yourself.
>>
>
> Much appreciated, Edward.
>
> I will apply patch during my build of Linux 4.13.12 for Debian --
> later in the evening/night -- to give it a spin.
Done: wrapped upstream Linux 4.13.12 into (latest) Debian packaging
for Linux 4.13.11-1 and modified version accordingly for
stretch-backports:
< https://sourceforge.net/projects/metztli-reiser4/files/Reiser4-Linux-4.13.12-1_for-Stretch/
>
>
> uname -a
> Linux huitzilopochtli 4.13.0-1+reiser4.0.1-amd64 #1 SMP Debian
> 4.13.11-1+reiser4.0.1 (2017-11-03) x86_64 GNU/Linux
>
Giving a spin to latest bugfix in transparent-compression environment:
uname -a
Linux huitzilopochtli 4.13.0-1+reiser4.0.1-amd64 #1 SMP Debian
4.13.12-1+reiser4.0.1 (2017-11-04) x86_64 GNU/Linux
Thanks again, Ed.
Best Professional Regards.
--
Jose R R
http://metztli.it
---------------------------------------------------------------------------------------------
Download Metztli Reiser4: Debian Stretch with Linux 4.12
---------------------------------------------------------------------------------------------
for AMD64 https://sf.net/projects/metztli-reiser4/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-11-09 13:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-08 20:50 [PATCH] reiser4: fixed bug in reiser4_kill_root() Edward Shishkin
2017-11-09 3:31 ` Jose R R
2017-11-09 13:14 ` Jose R R
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).