* reiserfstune: block allocator is not defined
@ 2005-10-21 0:24 Konstantin Münning
2005-10-21 8:44 ` Vladimir V. Saveliev
0 siblings, 1 reply; 3+ messages in thread
From: Konstantin Münning @ 2005-10-21 0:24 UTC (permalink / raw)
To: reiserfs-list
Hi!
Just tried to add some badblocks like this:
reiserfstune -b /tmp/badblocklist /dev/hda5
and I get the error:
block allocator is not defined
Aborted
The same when I try it with -B. As this message means nothing to me, has
somebody any idea what the problem might be? The man pages and
interestingly a web search gave me nothing about it. Or is reiserfstune
not to be used for adding bad blocks to the fs?
Kernel 2.6.12, reiserfstools 3.6.19.
Thanks!
--
Konstantin Münning
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: reiserfstune: block allocator is not defined
2005-10-21 0:24 reiserfstune: block allocator is not defined Konstantin Münning
@ 2005-10-21 8:44 ` Vladimir V. Saveliev
2005-10-21 15:12 ` Vitaly Fertman
0 siblings, 1 reply; 3+ messages in thread
From: Vladimir V. Saveliev @ 2005-10-21 8:44 UTC (permalink / raw)
To: Konstantin Münning; +Cc: reiserfs-list
Hello
Konstantin Münning wrote:
> Hi!
>
> Just tried to add some badblocks like this:
>
> reiserfstune -b /tmp/badblocklist /dev/hda5
>
> and I get the error:
>
>
> block allocator is not defined
>
> Aborted
>
>
> The same when I try it with -B. As this message means nothing to me, has
> somebody any idea what the problem might be? The man pages and
> interestingly a web search gave me nothing about it. Or is reiserfstune
> not to be used for adding bad blocks to the fs?
reiserfstune is supposed to be use for that. You encountered reiserfstune bug.
We are working on a fix.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: reiserfstune: block allocator is not defined
2005-10-21 8:44 ` Vladimir V. Saveliev
@ 2005-10-21 15:12 ` Vitaly Fertman
0 siblings, 0 replies; 3+ messages in thread
From: Vitaly Fertman @ 2005-10-21 15:12 UTC (permalink / raw)
To: Konstantin Münning; +Cc: reiserfs-list
[-- Attachment #1: Type: text/plain, Size: 757 bytes --]
Hi,
try the attached patch please.
On Friday 21 October 2005 12:44, Vladimir V. Saveliev wrote:
> Hello
>
> Konstantin Mьnning wrote:
> > Hi!
> >
> > Just tried to add some badblocks like this:
> >
> > reiserfstune -b /tmp/badblocklist /dev/hda5
> >
> > and I get the error:
> >
> >
> > block allocator is not defined
> >
> > Aborted
> >
> >
> > The same when I try it with -B. As this message means nothing to me, has
> > somebody any idea what the problem might be? The man pages and
> > interestingly a web search gave me nothing about it. Or is reiserfstune
> > not to be used for adding bad blocks to the fs?
>
> reiserfstune is supposed to be use for that. You encountered reiserfstune bug.
> We are working on a fix.
>
>
>
--
Vitaly
[-- Attachment #2: reiserfsprogs-addbadblock-fix.patch --]
[-- Type: text/x-diff, Size: 1270 bytes --]
diff -rup ./reiserfsprogs-3.6.19/reiserfscore/reiserfslib.c ./reiserfsprogs-3.6.19-2/reiserfscore/reiserfslib.c
--- ./reiserfsprogs-3.6.19/reiserfscore/reiserfslib.c 2005-10-21 18:42:23.088825144 +0400
+++ ./reiserfsprogs-3.6.19-2/reiserfscore/reiserfslib.c 2005-10-21 19:01:46.558950800 +0400
@@ -1346,6 +1346,24 @@ void mark_badblock(reiserfs_filsys_t *fs
pathrelse (badblock_path);
}
+static int reiserfs_alloc_blocks (reiserfs_filsys_t * fs,
+ unsigned long *blknr,
+ unsigned long start,
+ int count)
+{
+ int i;
+
+ for (i = 0; i < count; i ++) {
+ blknr[i] = 0;
+ if (reiserfs_bitmap_find_zero_bit(fs->fs_bitmap2, blknr + i))
+ die ("%s: failed to allocate a block.", __FUNCTION__);
+
+ reiserfs_bitmap_set_bit(fs->fs_bitmap2, blknr[i]);
+ }
+
+ return CARRY_ON;
+}
+
void add_badblock_list (reiserfs_filsys_t * fs, int replace) {
struct tree_balance tb;
struct path badblock_path;
@@ -1372,7 +1390,8 @@ void add_badblock_list (reiserfs_filsys_
set_type (KEY_FORMAT_2, &badblock_ih.ih_key, TYPE_INDIRECT);
j = 0;
-
+ fs->block_allocator = reiserfs_alloc_blocks;
+
/* insert all badblock pointers */
for (i = 0; i < fs->fs_badblocks_bm->bm_bit_size; i++) {
int retval;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-10-21 15:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-21 0:24 reiserfstune: block allocator is not defined Konstantin Münning
2005-10-21 8:44 ` Vladimir V. Saveliev
2005-10-21 15:12 ` Vitaly Fertman
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.