diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-03-14 10:35:27 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-03-16 04:51:51 -0400 |
commit | 0a6fb8d9c435c612171b453449f98da28e9969a5 (patch) | |
tree | e7a10938b7af3d59f452d9116adb9004fa63655c /fs/ubifs | |
parent | b221337ae4ef9baff84d6d5ecb806e79a5597329 (diff) |
UBIFS: fix lprops committing bug
When writing lprop nodes, do not forget to set @from to 0 when
switching the LEB. This fixes the following bug:
UBIFS error (pid 27768): ubifs_leb_write: writing -15456 bytes at 16:15880, error -22
UBIFS error (pid 27768): do_commit: commit failed, error -22
UBIFS warning (pid 27768): ubifs_ro_mode: switched to read-only mode, error -22
Pid: 27768, comm: freespace Not tainted 2.6.29-rc4-ubifs-2.6 #43
Call Trace:
[<ffffffffa00c46d6>] ubifs_ro_mode+0x54/0x56 [ubifs]
[<ffffffffa00cfa16>] do_commit+0x4f5/0x50a [ubifs]
[<ffffffffa00cfae7>] ubifs_run_commit+0xbc/0xdb [ubifs]
[<ffffffffa00d42b9>] ubifs_budget_space+0x742/0x9ed [ubifs]
[<ffffffff812daf45>] ? __mutex_lock_common+0x361/0x3ae
[<ffffffffa00bc437>] ? ubifs_write_begin+0x18d/0x44c [ubifs]
[<ffffffffa00bc5cb>] ubifs_write_begin+0x321/0x44c [ubifs]
[<ffffffff8106222b>] ? trace_hardirqs_on_caller+0x1f/0x14d
[<ffffffff81097ce2>] generic_file_buffered_write+0x12f/0x2d9
[<ffffffff8109828d>] __generic_file_aio_write_nolock+0x261/0x295
[<ffffffff81098aff>] generic_file_aio_write+0x69/0xc5
[<ffffffffa00bb914>] ubifs_aio_write+0x14c/0x19e [ubifs]
[<ffffffff810c8f42>] do_sync_write+0xe7/0x12d
[<ffffffff81055378>] ? autoremove_wake_function+0x0/0x38
[<ffffffff81149edc>] ? security_file_permission+0x11/0x13
[<ffffffff810c9827>] vfs_write+0xab/0x105
[<ffffffff810c9945>] sys_write+0x47/0x6f
[<ffffffff8100c35b>] system_call_fastpath+0x16/0x1b
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs')
-rw-r--r-- | fs/ubifs/lpt_commit.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/ubifs/lpt_commit.c b/fs/ubifs/lpt_commit.c index 27c97a1873d5..1bead5a6d80a 100644 --- a/fs/ubifs/lpt_commit.c +++ b/fs/ubifs/lpt_commit.c | |||
@@ -421,8 +421,7 @@ static int write_cnodes(struct ubifs_info *c) | |||
421 | err = realloc_lpt_leb(c, &lnum); | 421 | err = realloc_lpt_leb(c, &lnum); |
422 | if (err) | 422 | if (err) |
423 | goto no_space; | 423 | goto no_space; |
424 | offs = 0; | 424 | offs = from = 0; |
425 | from = 0; | ||
426 | ubifs_assert(lnum >= c->lpt_first && | 425 | ubifs_assert(lnum >= c->lpt_first && |
427 | lnum <= c->lpt_last); | 426 | lnum <= c->lpt_last); |
428 | err = ubifs_leb_unmap(c, lnum); | 427 | err = ubifs_leb_unmap(c, lnum); |
@@ -480,7 +479,7 @@ static int write_cnodes(struct ubifs_info *c) | |||
480 | err = realloc_lpt_leb(c, &lnum); | 479 | err = realloc_lpt_leb(c, &lnum); |
481 | if (err) | 480 | if (err) |
482 | goto no_space; | 481 | goto no_space; |
483 | offs = 0; | 482 | offs = from = 0; |
484 | ubifs_assert(lnum >= c->lpt_first && | 483 | ubifs_assert(lnum >= c->lpt_first && |
485 | lnum <= c->lpt_last); | 484 | lnum <= c->lpt_last); |
486 | err = ubifs_leb_unmap(c, lnum); | 485 | err = ubifs_leb_unmap(c, lnum); |
@@ -507,7 +506,7 @@ static int write_cnodes(struct ubifs_info *c) | |||
507 | err = realloc_lpt_leb(c, &lnum); | 506 | err = realloc_lpt_leb(c, &lnum); |
508 | if (err) | 507 | if (err) |
509 | goto no_space; | 508 | goto no_space; |
510 | offs = 0; | 509 | offs = from = 0; |
511 | ubifs_assert(lnum >= c->lpt_first && | 510 | ubifs_assert(lnum >= c->lpt_first && |
512 | lnum <= c->lpt_last); | 511 | lnum <= c->lpt_last); |
513 | err = ubifs_leb_unmap(c, lnum); | 512 | err = ubifs_leb_unmap(c, lnum); |