[PATCH 3/3] UBIFS: fix-up free space earlier

Artem Bityutskiy dedekind1 at gmail.com
Wed Jun 1 06:16:47 EDT 2011


On Mon, 2011-05-30 at 14:56 -0400, Ben Gardiner wrote:
> The free space fixup is currently initiated during mount after the call to
> ubifs_write_master() which results in a write to PEBs; this has been observed
> with the patch 'assert no fixup when writing a node' applied:
> 
> Move the free space fixup on mount to before the calls to
> ubifs_recover_inl_heads() and ubifs_write_master(). This results in no
> assertions with the previously mentioned patch applied.
> 
> Signed-off-by: Ben Gardiner <bengardiner at nanometrics>
> CC: Matthew L. Creech <mlcreech at gmail.com>
> 
> ---
>  fs/ubifs/super.c |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
> index 89c8d33..531b9b7 100644
> --- a/fs/ubifs/super.c
> +++ b/fs/ubifs/super.c
> @@ -1285,6 +1285,12 @@ static int mount_ubifs(struct ubifs_info *c)
>  	if (err)
>  		goto out_lpt;
>  
> +	if (!c->ro_mount && c->space_fixup) {
> +		err = ubifs_fixup_free_space(c);
> +		if (err)
> +			goto out_infos;
> +	}

Tweaked the patch a bit to make sure 'init_constants_master()' is called
before we start fixing-up - this does not matter now but it is less
error prone. And pushed to the UBIFS git tree, thank you.

But please, do review my tweaks and test them. When you confirm it
works, I'll send a pull request to Linus.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)




More information about the linux-mtd mailing list