diff mbox

UBIFS: fixup merged 'UBIFS: fix-up free space earlier'

Message ID 1306940008-28454-1-git-send-email-bengardiner@nanometrics.ca
State New, archived
Headers show

Commit Message

Ben Gardiner June 1, 2011, 2:53 p.m. UTC
When the patch 'UBIFS: intialize LPT earlier' was massaged before being applied
the context of the next patch 'UBIFS: fix-up free space earlier' was muddled
sufficiently for the order of allocate-lpt then free-space-fixup was reversed --
I think.

Put the free-space-fixup after allocate-lpt.

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>

---
With this fixup applied on-top-of the ubifs-2.6 master I am able to mount a
ubinized image containing a UBIFS volume which has the free-space-fixup flag
set. No assertions are displayed.

---
 fs/ubifs/super.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

Comments

Artem Bityutskiy June 1, 2011, 3:03 p.m. UTC | #1
On Wed, 2011-06-01 at 10:53 -0400, Ben Gardiner wrote:
> When the patch 'UBIFS: intialize LPT earlier' was massaged before being applied
> the context of the next patch 'UBIFS: fix-up free space earlier' was muddled
> sufficiently for the order of allocate-lpt then free-space-fixup was reversed --
> I think.
> 
> Put the free-space-fixup after allocate-lpt.
> 
> Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>

I'll take a look at this and fold this change in a bit later, thanks.
Artem Bityutskiy June 1, 2011, 3:14 p.m. UTC | #2
On Wed, 2011-06-01 at 10:53 -0400, Ben Gardiner wrote:
> When the patch 'UBIFS: intialize LPT earlier' was massaged before being applied
> the context of the next patch 'UBIFS: fix-up free space earlier' was muddled
> sufficiently for the order of allocate-lpt then free-space-fixup was reversed --
> I think.
> 
> Put the free-space-fixup after allocate-lpt.
> 
> Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
> 
> ---
> With this fixup applied on-top-of the ubifs-2.6 master I am able to mount a
> ubinized image containing a UBIFS volume which has the free-space-fixup flag
> set. No assertions are displayed.

Thanks. Merged this patch to the 3rd one and pushed out.
Ben Gardiner June 1, 2011, 3:28 p.m. UTC | #3
Hi Artem,

On Wed, Jun 1, 2011 at 11:14 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> On Wed, 2011-06-01 at 10:53 -0400, Ben Gardiner wrote:
>> When the patch 'UBIFS: intialize LPT earlier' was massaged before being applied
>> the context of the next patch 'UBIFS: fix-up free space earlier' was muddled
>> sufficiently for the order of allocate-lpt then free-space-fixup was reversed --
>> I think.
>>
>> Put the free-space-fixup after allocate-lpt.
>>
>> Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
>>
>> ---
>> With this fixup applied on-top-of the ubifs-2.6 master I am able to mount a
>> ubinized image containing a UBIFS volume which has the free-space-fixup flag
>> set. No assertions are displayed.
>
> Thanks. Merged this patch to the 3rd one and pushed out.

You're most welcome.

Both branches master and linux-next are working as expected.

Best Regards,
Ben Gardiner

---
Nanometrics Inc.
http://www.nanometrics.ca
diff mbox

Patch

diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 4722f31..70e8c92 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1284,12 +1284,6 @@  static int mount_ubifs(struct ubifs_info *c)
 
 	init_constants_master(c);
 
-	if (!c->ro_mount && c->space_fixup) {
-		err = ubifs_fixup_free_space(c);
-		if (err)
-			goto out_infos;
-	}
-
 	if ((c->mst_node->flags & cpu_to_le32(UBIFS_MST_DIRTY)) != 0) {
 		ubifs_msg("recovery needed");
 		c->need_recovery = 1;
@@ -1305,6 +1299,12 @@  static int mount_ubifs(struct ubifs_info *c)
 	if (err)
 		goto out_master;
 
+	if (!c->ro_mount && c->space_fixup) {
+		err = ubifs_fixup_free_space(c);
+		if (err)
+			goto out_master;
+	}
+
 	if (!c->ro_mount) {
 		/*
 		 * Set the "dirty" flag so that if we reboot uncleanly we