From e3a8eb21bed45b29ca33e7721b39c969f9399dff Mon Sep 17 00:00:00 2001 From: Charles Manning Date: Mon, 8 Jul 2013 11:45:21 +1200 Subject: [PATCH] Handle inband tags flag better Signed-off-by: Charles Manning --- yaffs_vfs_multi.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/yaffs_vfs_multi.c b/yaffs_vfs_multi.c index b067436..09aed4a 100644 --- a/yaffs_vfs_multi.c +++ b/yaffs_vfs_multi.c @@ -2605,6 +2605,7 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version, struct yaffs_param *param; int read_only = 0; + int inband_tags = 0; struct yaffs_options options; @@ -2683,7 +2684,11 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version, yaffs_version = 1; } - if(yaffs_verify_mtd(mtd, yaffs_version, options.inband_tags) < 0) + if (mtd->oobavail < sizeof(struct yaffs_packed_tags2) || + options.inband_tags) + inband_tags = 1; + + if(yaffs_verify_mtd(mtd, yaffs_version, inband_tags) < 0) return NULL; /* OK, so if we got here, we have an MTD that's NAND and looks @@ -2744,10 +2749,7 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version, param->n_reserved_blocks = 5; param->n_caches = (options.no_cache) ? 0 : 10; - - if (mtd->oobavail < sizeof(struct yaffs_packed_tags2) || - options.inband_tags) - param->inband_tags = 1; + param->inband_tags = inband_tags; param->enable_xattr = 1; if (options.lazy_loading_overridden) -- 2.30.2