* Master node recovery /corruption
@ 2013-03-18 15:42 Thomas Brandt
2013-03-25 8:34 ` Thomas Brandt
2013-04-15 15:34 ` Artem Bityutskiy
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Brandt @ 2013-03-18 15:42 UTC (permalink / raw)
To: linux-mtd
Hi,
I've a little question regarding the recovery of a master node.
In my case the first master node was corrupted and could not be recovered.
After taking a look to the code:
/fs/ubifs/recovery.c
int ubifs_recover_master_node(struct ubifs_info *c)
{
void *buf1 = NULL, *buf2 = NULL, *cor1 = NULL, *cor2 = NULL;
struct ubifs_mst_node *mst1 = NULL, *mst2 = NULL, *mst;
const int sz = c->mst_node_alsz;
int err, offs1, offs2;
dbg_rcvry("recovery");
err = get_master_node(c, UBIFS_MST_LNUM, &buf1, &mst1, &cor1);
if (err)
goto out_free;
err = get_master_node(c, UBIFS_MST_LNUM + 1, &buf2, &mst2, &cor2);
if (err)
goto out_free;
I see that if getting the first master node fails the function returns
without trying to get the second master node, which should be as far as
I understand it, a mirror of the first master node?!.
Is there any reason why it must be handled in that way?
Because after I've done a little hack (don't care that first node fails)
ithe first master node was recovered from the second one and it could be
mounted without any errors.
At the moment it difficult for me to say whats right or wrong!?
Might there be a bug?
Cheers,
Thomas
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Master node recovery /corruption
2013-03-18 15:42 Master node recovery /corruption Thomas Brandt
@ 2013-03-25 8:34 ` Thomas Brandt
2013-04-15 15:34 ` Artem Bityutskiy
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Brandt @ 2013-03-25 8:34 UTC (permalink / raw)
To: linux-mtd
Am 18.03.2013 16:42, schrieb Thomas Brandt:
> Hi,
>
> I've a little question regarding the recovery of a master node.
> In my case the first master node was corrupted and could not be recovered.
>
> After taking a look to the code:
> /fs/ubifs/recovery.c
>
> int ubifs_recover_master_node(struct ubifs_info *c)
> {
> void *buf1 = NULL, *buf2 = NULL, *cor1 = NULL, *cor2 = NULL;
> struct ubifs_mst_node *mst1 = NULL, *mst2 = NULL, *mst;
> const int sz = c->mst_node_alsz;
> int err, offs1, offs2;
>
> dbg_rcvry("recovery");
>
> err = get_master_node(c, UBIFS_MST_LNUM, &buf1, &mst1, &cor1);
> if (err)
> goto out_free;
>
> err = get_master_node(c, UBIFS_MST_LNUM + 1, &buf2, &mst2, &cor2);
> if (err)
> goto out_free;
>
> I see that if getting the first master node fails the function returns
> without trying to get the second master node, which should be as far as
> I understand it, a mirror of the first master node?!.
>
> Is there any reason why it must be handled in that way?
> Because after I've done a little hack (don't care that first node fails)
> ithe first master node was recovered from the second one and it could be
> mounted without any errors.
>
> At the moment it difficult for me to say whats right or wrong!?
> Might there be a bug?
>
> Cheers,
> Thomas
>
>
>
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>
Hello again!
Does somebody take care of this?
BR,
Thomas
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Master node recovery /corruption
2013-03-18 15:42 Master node recovery /corruption Thomas Brandt
2013-03-25 8:34 ` Thomas Brandt
@ 2013-04-15 15:34 ` Artem Bityutskiy
1 sibling, 0 replies; 3+ messages in thread
From: Artem Bityutskiy @ 2013-04-15 15:34 UTC (permalink / raw)
To: Thomas Brandt; +Cc: linux-mtd
On Mon, 2013-03-18 at 16:42 +0100, Thomas Brandt wrote:
> Hi,
>
> I've a little question regarding the recovery of a master node.
> In my case the first master node was corrupted and could not be recovered.
>
> After taking a look to the code:
> /fs/ubifs/recovery.c
>
> int ubifs_recover_master_node(struct ubifs_info *c)
> {
> void *buf1 = NULL, *buf2 = NULL, *cor1 = NULL, *cor2 = NULL;
> struct ubifs_mst_node *mst1 = NULL, *mst2 = NULL, *mst;
> const int sz = c->mst_node_alsz;
> int err, offs1, offs2;
>
> dbg_rcvry("recovery");
>
> err = get_master_node(c, UBIFS_MST_LNUM, &buf1, &mst1, &cor1);
> if (err)
> goto out_free;
>
> err = get_master_node(c, UBIFS_MST_LNUM + 1, &buf2, &mst2, &cor2);
> if (err)
> goto out_free;
>
> I see that if getting the first master node fails the function returns
> without trying to get the second master node, which should be as far as
> I understand it, a mirror of the first master node?!.
'get_master_node()' function will return the last valid master node.
IOW, it already handles the corruption in this LEB. If there is
corruption, it will take the previous valid master node. It fails only
if there is an "unacceptable" corruption, see the comment above this
function.
> Is there any reason why it must be handled in that way?
> Because after I've done a little hack (don't care that first node fails)
> ithe first master node was recovered from the second one and it could be
> mounted without any errors.
It sounds like you are trying to solve a particular issue, without
providing the details.
The idea is that 'get_master_node()' should not fail on recoverable
corruptions.
> At the moment it difficult for me to say whats right or wrong!?
Sounds wrong.
> Might there be a bug?
May be, you can send some more details about the problem you are trying
to solve.
--
Best Regards,
Artem Bityutskiy
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-15 15:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-18 15:42 Master node recovery /corruption Thomas Brandt
2013-03-25 8:34 ` Thomas Brandt
2013-04-15 15:34 ` Artem Bityutskiy
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).