From: Edward Shishkin <edward.shishkin@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Vladimir Saveliev <Vladimir.Saveliev@sun.com>,
ReiserFS Mailing List <reiserfs-devel@vger.kernel.org>
Subject: [patch] reiser4: fix kill_hook_internal
Date: Fri, 25 Apr 2008 22:18:03 +0400 [thread overview]
Message-ID: <4812205B.1050908@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: reiser4-fix-kill_hook_internal.patch --]
[-- Type: text/x-patch, Size: 1457 bytes --]
Problem:
Failed assertion (nikita-2754): child znode is not loaded
when looking at its number of items in kill_hook_internal().
Nobody cares about its loading.
Fixup:
Added missed zload/zrelse of the child.
---
linux-2.6.25-mm1/fs/reiser4/plugin/item/internal.c | 18 +++++++++++++-----
1 files changed, 13 insertions(+), 5 deletions(-)
--- linux-2.6.25-mm1/fs/reiser4/plugin/item/internal.c.orig
+++ linux-2.6.25-mm1/fs/reiser4/plugin/item/internal.c
@@ -308,6 +308,7 @@
struct carry_kill_data *p UNUSED_ARG)
{
znode *child;
+ int result = 0;
assert("nikita-1222", item != NULL);
assert("nikita-1224", from == 0);
@@ -316,7 +317,14 @@
child = znode_at(item, item->node);
if (IS_ERR(child))
return PTR_ERR(child);
- else if (node_is_empty(child)) {
+ assert("edward-1560", child != NULL);
+
+ result = zload(child);
+ if (result) {
+ zput(child);
+ return result;
+ }
+ if (node_is_empty(child)) {
reiser4_tree *tree;
assert("nikita-1397", znode_is_write_locked(child));
@@ -328,14 +336,14 @@
init_parent_coord(&child->in_parent, NULL);
--item->node->c_count;
write_unlock_tree(tree);
- zput(child);
- return 0;
} else {
warning("nikita-1223",
"Cowardly refuse to remove link to non-empty node");
- zput(child);
- return RETERR(-EIO);
+ result = RETERR(-EIO);
}
+ zrelse(child);
+ zput(child);
+ return result;
}
/* hook called by ->shift() node plugin method when iternal item was just
reply other threads:[~2008-04-25 18:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4812205B.1050908@gmail.com \
--to=edward.shishkin@gmail.com \
--cc=Vladimir.Saveliev@sun.com \
--cc=akpm@linux-foundation.org \
--cc=reiserfs-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.