Patchwork JFFS2: min/max confusion?

login
register
mail settings
Submitter roel kluin
Date Nov. 21, 2009, 3:34 p.m.
Message ID <4B08088C.8050305@gmail.com>
Download mbox | patch
Permalink /patch/38984/
State New
Headers show

Comments

roel kluin - Nov. 21, 2009, 3:34 p.m.
MAX_SUMMARY_SIZE was meant as a limit, not as a minimum

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
 fs/jffs2/summary.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

unless I am mistaken?
Artem Bityutskiy - Nov. 26, 2009, 7:05 a.m.
On Sat, 2009-11-21 at 16:34 +0100, Roel Kluin wrote:
> MAX_SUMMARY_SIZE was meant as a limit, not as a minimum
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
>  fs/jffs2/summary.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> unless I am mistaken?
> 
> diff --git a/fs/jffs2/summary.c b/fs/jffs2/summary.c
> index 6caf1e1..800171d 100644
> --- a/fs/jffs2/summary.c
> +++ b/fs/jffs2/summary.c
> @@ -23,7 +23,7 @@
>  
>  int jffs2_sum_init(struct jffs2_sb_info *c)
>  {
> -	uint32_t sum_size = max_t(uint32_t, c->sector_size, MAX_SUMMARY_SIZE);
> +	uint32_t sum_size = min_t(uint32_t, c->sector_size, MAX_SUMMARY_SIZE);
>  
>  	c->summary = kzalloc(sizeof(struct jffs2_summary), GFP_KERNEL);

This looks right, I've pushed your patch to my l2-mtd tree, thanks.

Patch

diff --git a/fs/jffs2/summary.c b/fs/jffs2/summary.c
index 6caf1e1..800171d 100644
--- a/fs/jffs2/summary.c
+++ b/fs/jffs2/summary.c
@@ -23,7 +23,7 @@ 
 
 int jffs2_sum_init(struct jffs2_sb_info *c)
 {
-	uint32_t sum_size = max_t(uint32_t, c->sector_size, MAX_SUMMARY_SIZE);
+	uint32_t sum_size = min_t(uint32_t, c->sector_size, MAX_SUMMARY_SIZE);
 
 	c->summary = kzalloc(sizeof(struct jffs2_summary), GFP_KERNEL);