All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] mkfs.ubifs: add "-F" option for "free-space fixup"
@ 2011-05-04 22:14 Matthew L. Creech
  2011-05-11 20:09 ` Ben Gardiner
  0 siblings, 1 reply; 12+ messages in thread
From: Matthew L. Creech @ 2011-05-04 22:14 UTC (permalink / raw)
  To: linux-mtd

This adds a superblock flag indicating that "free-space fixup" is needed, and
allows it to be set by the user via the "-F" command-line option.  The first
time the filesystem is mounted, this flag will trigger a one-time re-mapping of
all LEBs containing free space.  This fixes problems seen on some NAND flashes
when a non-UBIFS-aware flash programmer is used.


Changes since v1: renamed "LEB fixup" to "free space fixup"

Signed-off-by: Matthew L. Creech <mlcreech@gmail.com>
---
 mkfs.ubifs/mkfs.ubifs.c  |   11 ++++++++++-
 mkfs.ubifs/ubifs-media.h |    2 ++
 mkfs.ubifs/ubifs.h       |    2 ++
 3 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/mkfs.ubifs/mkfs.ubifs.c b/mkfs.ubifs/mkfs.ubifs.c
index a306dd6..96e17a3 100644
--- a/mkfs.ubifs/mkfs.ubifs.c
+++ b/mkfs.ubifs/mkfs.ubifs.c
@@ -132,7 +132,7 @@ static struct inum_mapping **hash_table;
 /* Inode creation sequence number */
 static unsigned long long creat_sqnum;

-static const char *optstring = "d:r:m:o:D:h?vVe:c:g:f:p:k:x:X:j:R:l:j:UQq";
+static const char *optstring = "d:r:m:o:D:h?vVe:c:g:f:Fp:k:x:X:j:R:l:j:UQq";

 static const struct option longopts[] = {
 	{"root",               1, NULL, 'r'},
@@ -150,6 +150,7 @@ static const struct option longopts[] = {
 	{"compr",              1, NULL, 'x'},
 	{"favor-percent",      1, NULL, 'X'},
 	{"fanout",             1, NULL, 'f'},
+	{"space-fixup",        0, NULL, 'F'},
 	{"keyhash",            1, NULL, 'k'},
 	{"log-lebs",           1, NULL, 'l'},
 	{"orph-lebs",          1, NULL, 'p'},
@@ -183,6 +184,7 @@ static const char *helptext =
 "                         how many percent better zlib should
compress to make\n"
 "                         mkfs.ubifs use zlib instead of LZO (default 20%)\n"
 "-f, --fanout=NUM         fanout NUM (default: 8)\n"
+"-F, --space-fixup        fixup free space on first mount (needed for
some NANDs)\n"
 "-k, --keyhash=TYPE       key hash type - \"r5\" or \"test\"
(default: \"r5\")\n"
 "-p, --orph-lebs=COUNT    count of erase blocks for orphans (default: 1)\n"
 "-D, --devtable=FILE      use device table FILE\n"
@@ -537,6 +539,7 @@ static int get_options(int argc, char**argv)
 	c->max_leb_cnt = -1;
 	c->max_bud_bytes = -1;
 	c->log_lebs = -1;
+	c->space_fixup = 0;

 	while (1) {
 		opt = getopt_long(argc, argv, optstring, longopts, &i);
@@ -610,6 +613,9 @@ static int get_options(int argc, char**argv)
 			if (*endp != '\0' || endp == optarg || c->fanout <= 0)
 				return err_msg("bad fanout %s", optarg);
 			break;
+		case 'F':
+			c->space_fixup = 1;
+			break;
 		case 'l':
 			c->log_lebs = strtol(optarg, &endp, 0);
 			if (*endp != '\0' || endp == optarg || c->log_lebs <= 0)
@@ -758,6 +764,7 @@ static int get_options(int argc, char**argv)
 						"r5" : "test");
 		printf("\tfanout:       %d\n", c->fanout);
 		printf("\torph_lebs:    %d\n", c->orph_lebs);
+		printf("\tspace_fixup:  %d\n", c->space_fixup);
 	}

 	if (validate_options())
@@ -1997,6 +2004,8 @@ static int write_super(void)
 	}
 	if (c->big_lpt)
 		sup.flags |= cpu_to_le32(UBIFS_FLG_BIGLPT);
+	if (c->space_fixup)
+		sup.flags |= cpu_to_le32(UBIFS_FLG_SPACE_FIXUP);

 	return write_node(&sup, UBIFS_SB_NODE_SZ, UBIFS_SB_LNUM, UBI_LONGTERM);
 }
diff --git a/mkfs.ubifs/ubifs-media.h b/mkfs.ubifs/ubifs-media.h
index a9ecbd9..fe62d0e 100644
--- a/mkfs.ubifs/ubifs-media.h
+++ b/mkfs.ubifs/ubifs-media.h
@@ -373,9 +373,11 @@ enum {
  * Superblock flags.
  *
  * UBIFS_FLG_BIGLPT: if "big" LPT model is used if set
+ * UBIFS_FLG_SPACE_FIXUP: first-mount "fixup" of free space within LEBs needed
  */
 enum {
 	UBIFS_FLG_BIGLPT = 0x02,
+	UBIFS_FLG_SPACE_FIXUP = 0x04,
 };

 /**
diff --git a/mkfs.ubifs/ubifs.h b/mkfs.ubifs/ubifs.h
index 5c29046..f94a52c 100644
--- a/mkfs.ubifs/ubifs.h
+++ b/mkfs.ubifs/ubifs.h
@@ -317,6 +317,7 @@ struct ubifs_znode
  * @nhead_lnum: LEB number of LPT head
  * @nhead_offs: offset of LPT head
  * @big_lpt: flag that LPT is too big to write whole during commit
+ * @space_fixup: flag indicating that free space in LEBs needs to be cleaned up
  * @lpt_sz: LPT size
  *
  * @ltab_lnum: LEB number of LPT's own lprops table
@@ -394,6 +395,7 @@ struct ubifs_info
 	int nhead_lnum;
 	int nhead_offs;
 	int big_lpt;
+	int space_fixup;
 	long long lpt_sz;

 	int ltab_lnum;
-- 
1.6.3.3


-- 
Matthew L. Creech

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] mkfs.ubifs: add "-F" option for "free-space fixup"
  2011-05-04 22:14 [PATCH v2] mkfs.ubifs: add "-F" option for "free-space fixup" Matthew L. Creech
@ 2011-05-11 20:09 ` Ben Gardiner
  2011-05-11 21:01   ` Matthew L. Creech
  0 siblings, 1 reply; 12+ messages in thread
From: Ben Gardiner @ 2011-05-11 20:09 UTC (permalink / raw)
  To: Matthew L. Creech; +Cc: linux-mtd

Hi Matthew,

I keep meaning to get around to testing the free-space fixup patches
as promised. Sorry.

For now all I can offer is some superficial criticisms of this patch.
Sorry again.

I think your mail client wrapped the patch. When I try to 'git am' it
onto "e15b521 fs-tests: integck: print error number in pcv messages" I
get

Applying: mkfs.ubifs: add "-F" option for "free-space fixup"
fatal: corrupt patch at line 30
Patch failed at 0001 mkfs.ubifs: add "-F" option for "free-space fixup"
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".

On Wed, May 4, 2011 at 6:14 PM, Matthew L. Creech <mlcreech@gmail.com> wrote:
> This adds a superblock flag indicating that "free-space fixup" is needed, and
> allows it to be set by the user via the "-F" command-line option.  The first
> time the filesystem is mounted, this flag will trigger a one-time re-mapping of
> all LEBs containing free space.  This fixes problems seen on some NAND flashes
> when a non-UBIFS-aware flash programmer is used.
>
>
> Changes since v1: renamed "LEB fixup" to "free space fixup"

Put stuff like 'changes since' below a tearline ('---') so it doesn't
make it into the commit message

> Signed-off-by: Matthew L. Creech <mlcreech@gmail.com>
> ---
>  mkfs.ubifs/mkfs.ubifs.c  |   11 ++++++++++-
>  mkfs.ubifs/ubifs-media.h |    2 ++
>  mkfs.ubifs/ubifs.h       |    2 ++
>  3 files changed, 14 insertions(+), 1 deletions(-)
>
> diff --git a/mkfs.ubifs/mkfs.ubifs.c b/mkfs.ubifs/mkfs.ubifs.c
> index a306dd6..96e17a3 100644
> --- a/mkfs.ubifs/mkfs.ubifs.c
> +++ b/mkfs.ubifs/mkfs.ubifs.c
> @@ -132,7 +132,7 @@ static struct inum_mapping **hash_table;
>  /* Inode creation sequence number */
>  static unsigned long long creat_sqnum;
>
> -static const char *optstring = "d:r:m:o:D:h?vVe:c:g:f:p:k:x:X:j:R:l:j:UQq";
> +static const char *optstring = "d:r:m:o:D:h?vVe:c:g:f:Fp:k:x:X:j:R:l:j:UQq";
>
>  static const struct option longopts[] = {
>        {"root",               1, NULL, 'r'},
> @@ -150,6 +150,7 @@ static const struct option longopts[] = {
>        {"compr",              1, NULL, 'x'},
>        {"favor-percent",      1, NULL, 'X'},
>        {"fanout",             1, NULL, 'f'},
> +       {"space-fixup",        0, NULL, 'F'},
>        {"keyhash",            1, NULL, 'k'},
>        {"log-lebs",           1, NULL, 'l'},
>        {"orph-lebs",          1, NULL, 'p'},
> @@ -183,6 +184,7 @@ static const char *helptext =
>  "                         how many percent better zlib should
> compress to make\n"

here

>  "                         mkfs.ubifs use zlib instead of LZO (default 20%)\n"
>  "-f, --fanout=NUM         fanout NUM (default: 8)\n"
> +"-F, --space-fixup        fixup free space on first mount (needed for
> some NANDs)\n"

here

>  "-k, --keyhash=TYPE       key hash type - \"r5\" or \"test\"
> (default: \"r5\")\n"

and here

are detrimental wraps

>  "-p, --orph-lebs=COUNT    count of erase blocks for orphans (default: 1)\n"
>  "-D, --devtable=FILE      use device table FILE\n"
> @@ -537,6 +539,7 @@ static int get_options(int argc, char**argv)
>        c->max_leb_cnt = -1;
>        c->max_bud_bytes = -1;
>        c->log_lebs = -1;
> +       c->space_fixup = 0;
>
>        while (1) {
>                opt = getopt_long(argc, argv, optstring, longopts, &i);
> @@ -610,6 +613,9 @@ static int get_options(int argc, char**argv)
>                        if (*endp != '\0' || endp == optarg || c->fanout <= 0)
>                                return err_msg("bad fanout %s", optarg);
>                        break;
> +               case 'F':
> +                       c->space_fixup = 1;
> +                       break;
>                case 'l':
>                        c->log_lebs = strtol(optarg, &endp, 0);
>                        if (*endp != '\0' || endp == optarg || c->log_lebs <= 0)
> @@ -758,6 +764,7 @@ static int get_options(int argc, char**argv)
>                                                "r5" : "test");
>                printf("\tfanout:       %d\n", c->fanout);
>                printf("\torph_lebs:    %d\n", c->orph_lebs);
> +               printf("\tspace_fixup:  %d\n", c->space_fixup);
>        }
>
>        if (validate_options())
> @@ -1997,6 +2004,8 @@ static int write_super(void)
>        }
>        if (c->big_lpt)
>                sup.flags |= cpu_to_le32(UBIFS_FLG_BIGLPT);
> +       if (c->space_fixup)
> +               sup.flags |= cpu_to_le32(UBIFS_FLG_SPACE_FIXUP);
>
>        return write_node(&sup, UBIFS_SB_NODE_SZ, UBIFS_SB_LNUM, UBI_LONGTERM);
>  }
> diff --git a/mkfs.ubifs/ubifs-media.h b/mkfs.ubifs/ubifs-media.h
> index a9ecbd9..fe62d0e 100644
> --- a/mkfs.ubifs/ubifs-media.h
> +++ b/mkfs.ubifs/ubifs-media.h
> @@ -373,9 +373,11 @@ enum {
>  * Superblock flags.
>  *
>  * UBIFS_FLG_BIGLPT: if "big" LPT model is used if set
> + * UBIFS_FLG_SPACE_FIXUP: first-mount "fixup" of free space within LEBs needed
>  */
>  enum {
>        UBIFS_FLG_BIGLPT = 0x02,
> +       UBIFS_FLG_SPACE_FIXUP = 0x04,
>  };
>
>  /**
> diff --git a/mkfs.ubifs/ubifs.h b/mkfs.ubifs/ubifs.h
> index 5c29046..f94a52c 100644
> --- a/mkfs.ubifs/ubifs.h
> +++ b/mkfs.ubifs/ubifs.h
> @@ -317,6 +317,7 @@ struct ubifs_znode
>  * @nhead_lnum: LEB number of LPT head
>  * @nhead_offs: offset of LPT head
>  * @big_lpt: flag that LPT is too big to write whole during commit
> + * @space_fixup: flag indicating that free space in LEBs needs to be cleaned up
>  * @lpt_sz: LPT size
>  *
>  * @ltab_lnum: LEB number of LPT's own lprops table
> @@ -394,6 +395,7 @@ struct ubifs_info
>        int nhead_lnum;
>        int nhead_offs;
>        int big_lpt;
> +       int space_fixup;
>        long long lpt_sz;
>
>        int ltab_lnum;
> --
> 1.6.3.3
>
>
> --
> Matthew L. Creech
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>

I am planning to do actual testing of this flag on the da850 at the
end of next week.

Best Regards,
Ben Gardiner

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] mkfs.ubifs: add "-F" option for "free-space fixup"
  2011-05-11 20:09 ` Ben Gardiner
@ 2011-05-11 21:01   ` Matthew L. Creech
  2011-05-11 21:02     ` [PATCH 1/1] " Matthew L. Creech
  0 siblings, 1 reply; 12+ messages in thread
From: Matthew L. Creech @ 2011-05-11 21:01 UTC (permalink / raw)
  To: Ben Gardiner; +Cc: linux-mtd

On Wed, May 11, 2011 at 4:09 PM, Ben Gardiner
<bengardiner@nanometrics.ca> wrote:
>
> I think your mail client wrapped the patch. When I try to 'git am' it
> onto "e15b521 fs-tests: integck: print error number in pcv messages" I
> get
>

Yes, I'm sorry about that!  Artem pointed out the same problem with my
kernel patches (it's a gmail wrapping issue).  I'll reply with a
proper version.

-- 
Matthew L. Creech

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/1] mkfs.ubifs: add "-F" option for "free-space fixup"
  2011-05-11 21:01   ` Matthew L. Creech
@ 2011-05-11 21:02     ` Matthew L. Creech
  2011-05-12 13:13       ` Artem Bityutskiy
                         ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Matthew L. Creech @ 2011-05-11 21:02 UTC (permalink / raw)
  To: linux-mtd, bengardiner

This adds a superblock flag indicating that "free-space fixup" is needed, and
allows it to be set by the user via the "-F" command-line option.  The first
time the filesystem is mounted, this flag will trigger a one-time re-mapping of
all LEBs containing free space.  This fixes problems seen on some NAND flashes
when a non-UBIFS-aware flash programmer is used.

Signed-off-by: Matthew L. Creech <mlcreech@gmail.com>
---
 mkfs.ubifs/mkfs.ubifs.c  |   11 ++++++++++-
 mkfs.ubifs/ubifs-media.h |    2 ++
 mkfs.ubifs/ubifs.h       |    2 ++
 3 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/mkfs.ubifs/mkfs.ubifs.c b/mkfs.ubifs/mkfs.ubifs.c
index a306dd6..96e17a3 100644
--- a/mkfs.ubifs/mkfs.ubifs.c
+++ b/mkfs.ubifs/mkfs.ubifs.c
@@ -132,7 +132,7 @@ static struct inum_mapping **hash_table;
 /* Inode creation sequence number */
 static unsigned long long creat_sqnum;
 
-static const char *optstring = "d:r:m:o:D:h?vVe:c:g:f:p:k:x:X:j:R:l:j:UQq";
+static const char *optstring = "d:r:m:o:D:h?vVe:c:g:f:Fp:k:x:X:j:R:l:j:UQq";
 
 static const struct option longopts[] = {
 	{"root",               1, NULL, 'r'},
@@ -150,6 +150,7 @@ static const struct option longopts[] = {
 	{"compr",              1, NULL, 'x'},
 	{"favor-percent",      1, NULL, 'X'},
 	{"fanout",             1, NULL, 'f'},
+	{"space-fixup",        0, NULL, 'F'},
 	{"keyhash",            1, NULL, 'k'},
 	{"log-lebs",           1, NULL, 'l'},
 	{"orph-lebs",          1, NULL, 'p'},
@@ -183,6 +184,7 @@ static const char *helptext =
 "                         how many percent better zlib should compress to make\n"
 "                         mkfs.ubifs use zlib instead of LZO (default 20%)\n"
 "-f, --fanout=NUM         fanout NUM (default: 8)\n"
+"-F, --space-fixup        fixup free space on first mount (needed for some NANDs)\n"
 "-k, --keyhash=TYPE       key hash type - \"r5\" or \"test\" (default: \"r5\")\n"
 "-p, --orph-lebs=COUNT    count of erase blocks for orphans (default: 1)\n"
 "-D, --devtable=FILE      use device table FILE\n"
@@ -537,6 +539,7 @@ static int get_options(int argc, char**argv)
 	c->max_leb_cnt = -1;
 	c->max_bud_bytes = -1;
 	c->log_lebs = -1;
+	c->space_fixup = 0;
 
 	while (1) {
 		opt = getopt_long(argc, argv, optstring, longopts, &i);
@@ -610,6 +613,9 @@ static int get_options(int argc, char**argv)
 			if (*endp != '\0' || endp == optarg || c->fanout <= 0)
 				return err_msg("bad fanout %s", optarg);
 			break;
+		case 'F':
+			c->space_fixup = 1;
+			break;
 		case 'l':
 			c->log_lebs = strtol(optarg, &endp, 0);
 			if (*endp != '\0' || endp == optarg || c->log_lebs <= 0)
@@ -758,6 +764,7 @@ static int get_options(int argc, char**argv)
 						"r5" : "test");
 		printf("\tfanout:       %d\n", c->fanout);
 		printf("\torph_lebs:    %d\n", c->orph_lebs);
+		printf("\tspace_fixup:  %d\n", c->space_fixup);
 	}
 
 	if (validate_options())
@@ -1997,6 +2004,8 @@ static int write_super(void)
 	}
 	if (c->big_lpt)
 		sup.flags |= cpu_to_le32(UBIFS_FLG_BIGLPT);
+	if (c->space_fixup)
+		sup.flags |= cpu_to_le32(UBIFS_FLG_SPACE_FIXUP);
 
 	return write_node(&sup, UBIFS_SB_NODE_SZ, UBIFS_SB_LNUM, UBI_LONGTERM);
 }
diff --git a/mkfs.ubifs/ubifs-media.h b/mkfs.ubifs/ubifs-media.h
index a9ecbd9..fe62d0e 100644
--- a/mkfs.ubifs/ubifs-media.h
+++ b/mkfs.ubifs/ubifs-media.h
@@ -373,9 +373,11 @@ enum {
  * Superblock flags.
  *
  * UBIFS_FLG_BIGLPT: if "big" LPT model is used if set
+ * UBIFS_FLG_SPACE_FIXUP: first-mount "fixup" of free space within LEBs needed
  */
 enum {
 	UBIFS_FLG_BIGLPT = 0x02,
+	UBIFS_FLG_SPACE_FIXUP = 0x04,
 };
 
 /**
diff --git a/mkfs.ubifs/ubifs.h b/mkfs.ubifs/ubifs.h
index 5c29046..f94a52c 100644
--- a/mkfs.ubifs/ubifs.h
+++ b/mkfs.ubifs/ubifs.h
@@ -317,6 +317,7 @@ struct ubifs_znode
  * @nhead_lnum: LEB number of LPT head
  * @nhead_offs: offset of LPT head
  * @big_lpt: flag that LPT is too big to write whole during commit
+ * @space_fixup: flag indicating that free space in LEBs needs to be cleaned up
  * @lpt_sz: LPT size
  *
  * @ltab_lnum: LEB number of LPT's own lprops table
@@ -394,6 +395,7 @@ struct ubifs_info
 	int nhead_lnum;
 	int nhead_offs;
 	int big_lpt;
+	int space_fixup;
 	long long lpt_sz;
 
 	int ltab_lnum;
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/1] mkfs.ubifs: add "-F" option for "free-space fixup"
  2011-05-11 21:02     ` [PATCH 1/1] " Matthew L. Creech
@ 2011-05-12 13:13       ` Artem Bityutskiy
  2011-05-18 20:57       ` [PATCH] mkfs.ubifs: free-space-fixup: note supported kernels Ben Gardiner
  2011-05-20 10:11       ` [PATCH 1/1] mkfs.ubifs: add "-F" option for "free-space fixup" Artem Bityutskiy
  2 siblings, 0 replies; 12+ messages in thread
From: Artem Bityutskiy @ 2011-05-12 13:13 UTC (permalink / raw)
  To: Matthew L. Creech; +Cc: bengardiner, linux-mtd

On Wed, 2011-05-11 at 17:02 -0400, Matthew L. Creech wrote:
> +"-F, --space-fixup        fixup free space on first mount (needed for some NANDs)\n"

Could you somehow reflect in the --help output in this feature needs
up-to-date kernel. And also in the C comment. You can tell that this
feature was introduce to 2.6.39.

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] mkfs.ubifs: free-space-fixup: note supported kernels
  2011-05-11 21:02     ` [PATCH 1/1] " Matthew L. Creech
  2011-05-12 13:13       ` Artem Bityutskiy
@ 2011-05-18 20:57       ` Ben Gardiner
  2011-05-19  5:41         ` Matthew L. Creech
  2011-05-20 10:11       ` [PATCH 1/1] mkfs.ubifs: add "-F" option for "free-space fixup" Artem Bityutskiy
  2 siblings, 1 reply; 12+ messages in thread
From: Ben Gardiner @ 2011-05-18 20:57 UTC (permalink / raw)
  To: Artem Bityutskiy; +Cc: linux-mtd, Matthew L. Creech

The free space fixup flag will only have an action taken on up-to-date
kernels.

Note in the help text and comment that kernel release 2.6.39 is required
for the free space fixup to be performed.

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
CC: Matthew L. Creech <mlcreech@gmail.com>

---
 mkfs.ubifs/mkfs.ubifs.c  |    4 +++-
 mkfs.ubifs/ubifs-media.h |    2 ++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/mkfs.ubifs/mkfs.ubifs.c b/mkfs.ubifs/mkfs.ubifs.c
index 96e17a3..f4cf09d 100644
--- a/mkfs.ubifs/mkfs.ubifs.c
+++ b/mkfs.ubifs/mkfs.ubifs.c
@@ -184,7 +184,9 @@ static const char *helptext =
 "                         how many percent better zlib should compress to make\n"
 "                         mkfs.ubifs use zlib instead of LZO (default 20%)\n"
 "-f, --fanout=NUM         fanout NUM (default: 8)\n"
-"-F, --space-fixup        fixup free space on first mount (needed for some NANDs)\n"
+"-F, --space-fixup        fixup free space on first mount (needed for some NANDs;\n"
+"                         the free space fixup will be performed only by kernel\n"
+"                         releases 2.6.39 or greater)\n"
 "-k, --keyhash=TYPE       key hash type - \"r5\" or \"test\" (default: \"r5\")\n"
 "-p, --orph-lebs=COUNT    count of erase blocks for orphans (default: 1)\n"
 "-D, --devtable=FILE      use device table FILE\n"
diff --git a/mkfs.ubifs/ubifs-media.h b/mkfs.ubifs/ubifs-media.h
index fe62d0e..a710589 100644
--- a/mkfs.ubifs/ubifs-media.h
+++ b/mkfs.ubifs/ubifs-media.h
@@ -374,6 +374,8 @@ enum {
  *
  * UBIFS_FLG_BIGLPT: if "big" LPT model is used if set
  * UBIFS_FLG_SPACE_FIXUP: first-mount "fixup" of free space within LEBs needed
+ *                        the free space fixup will be performed only by kernel
+ *                        releases 2.6.39 or greater.
  */
 enum {
 	UBIFS_FLG_BIGLPT = 0x02,
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] mkfs.ubifs: free-space-fixup: note supported kernels
  2011-05-18 20:57       ` [PATCH] mkfs.ubifs: free-space-fixup: note supported kernels Ben Gardiner
@ 2011-05-19  5:41         ` Matthew L. Creech
  2011-05-19  5:56           ` Artem Bityutskiy
  0 siblings, 1 reply; 12+ messages in thread
From: Matthew L. Creech @ 2011-05-19  5:41 UTC (permalink / raw)
  To: Ben Gardiner; +Cc: linux-mtd, Artem Bityutskiy

Thanks Ben, I missed Artem's reply asking for this.

On Wed, May 18, 2011 at 4:57 PM, Ben Gardiner
<bengardiner@nanometrics.ca> wrote:
>
> Note in the help text and comment that kernel release 2.6.39 is required
> for the free space fixup to be performed.
>

Will it actually be included in 2.6.39?  The flag exists there, but
I'd assumed the code changes wouldn't be merged until the next cycle.

-- 
Matthew L. Creech

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] mkfs.ubifs: free-space-fixup: note supported kernels
  2011-05-19  5:41         ` Matthew L. Creech
@ 2011-05-19  5:56           ` Artem Bityutskiy
  2011-05-19 12:14             ` [PATCH v2] " Ben Gardiner
  0 siblings, 1 reply; 12+ messages in thread
From: Artem Bityutskiy @ 2011-05-19  5:56 UTC (permalink / raw)
  To: Matthew L. Creech; +Cc: Ben Gardiner, linux-mtd

On Thu, 2011-05-19 at 01:41 -0400, Matthew L. Creech wrote:
> Thanks Ben, I missed Artem's reply asking for this.
> 
> On Wed, May 18, 2011 at 4:57 PM, Ben Gardiner
> <bengardiner@nanometrics.ca> wrote:
> >
> > Note in the help text and comment that kernel release 2.6.39 is required
> > for the free space fixup to be performed.
> >
> 
> Will it actually be included in 2.6.39?  The flag exists there, but
> I'd assumed the code changes wouldn't be merged until the next cycle.

Hi, indeed, yes, I'm planning to merge this upstream, but in 2.6.40. I'm
sorry for misleading infromation.

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2] mkfs.ubifs: free-space-fixup: note supported kernels
  2011-05-19  5:56           ` Artem Bityutskiy
@ 2011-05-19 12:14             ` Ben Gardiner
  2011-05-20 10:15               ` Artem Bityutskiy
  0 siblings, 1 reply; 12+ messages in thread
From: Ben Gardiner @ 2011-05-19 12:14 UTC (permalink / raw)
  To: Artem Bityutskiy; +Cc: linux-mtd, Matthew L. Creech

The free space fixup flag will only have an action taken on up-to-date
kernels.

Note in the help text and comment that kernel release 2.6.40 is required
for the free space fixup to be performed.

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
CC: Matthew L. Creech <mlcreech@gmail.com>

---
Changes since v1:
 * updated references to the kernel release to reflect the reality that
   2.6.39 is a done deal

---
 mkfs.ubifs/mkfs.ubifs.c  |    4 +++-
 mkfs.ubifs/ubifs-media.h |    2 ++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/mkfs.ubifs/mkfs.ubifs.c b/mkfs.ubifs/mkfs.ubifs.c
index 96e17a3..1ce1db3 100644
--- a/mkfs.ubifs/mkfs.ubifs.c
+++ b/mkfs.ubifs/mkfs.ubifs.c
@@ -184,7 +184,9 @@ static const char *helptext =
 "                         how many percent better zlib should compress to make\n"
 "                         mkfs.ubifs use zlib instead of LZO (default 20%)\n"
 "-f, --fanout=NUM         fanout NUM (default: 8)\n"
-"-F, --space-fixup        fixup free space on first mount (needed for some NANDs)\n"
+"-F, --space-fixup        fixup free space on first mount (needed for some NANDs;\n"
+"                         the free space fixup will be performed only by kernel\n"
+"                         releases 2.6.40 or greater)\n"
 "-k, --keyhash=TYPE       key hash type - \"r5\" or \"test\" (default: \"r5\")\n"
 "-p, --orph-lebs=COUNT    count of erase blocks for orphans (default: 1)\n"
 "-D, --devtable=FILE      use device table FILE\n"
diff --git a/mkfs.ubifs/ubifs-media.h b/mkfs.ubifs/ubifs-media.h
index fe62d0e..16683de 100644
--- a/mkfs.ubifs/ubifs-media.h
+++ b/mkfs.ubifs/ubifs-media.h
@@ -374,6 +374,8 @@ enum {
  *
  * UBIFS_FLG_BIGLPT: if "big" LPT model is used if set
  * UBIFS_FLG_SPACE_FIXUP: first-mount "fixup" of free space within LEBs needed
+ *                        the free space fixup will be performed only by kernel
+ *                        releases 2.6.40 or greater.
  */
 enum {
 	UBIFS_FLG_BIGLPT = 0x02,
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/1] mkfs.ubifs: add "-F" option for "free-space fixup"
  2011-05-11 21:02     ` [PATCH 1/1] " Matthew L. Creech
  2011-05-12 13:13       ` Artem Bityutskiy
  2011-05-18 20:57       ` [PATCH] mkfs.ubifs: free-space-fixup: note supported kernels Ben Gardiner
@ 2011-05-20 10:11       ` Artem Bityutskiy
  2 siblings, 0 replies; 12+ messages in thread
From: Artem Bityutskiy @ 2011-05-20 10:11 UTC (permalink / raw)
  To: Matthew L. Creech; +Cc: bengardiner, linux-mtd

On Wed, 2011-05-11 at 17:02 -0400, Matthew L. Creech wrote:
> This adds a superblock flag indicating that "free-space fixup" is needed, and
> allows it to be set by the user via the "-F" command-line option.  The first
> time the filesystem is mounted, this flag will trigger a one-time re-mapping of
> all LEBs containing free space.  This fixes problems seen on some NAND flashes
> when a non-UBIFS-aware flash programmer is used.
> 
> Signed-off-by: Matthew L. Creech <mlcreech@gmail.com>

I've tweaked your patch and added some more help text and pushed,
thanks.

I think we'll need to make a new mtd-utils release at some point. We
need to wait a bit and let people test this a bit more. Please, be
encourage to remind me to release mtd-utils if I forget about this.
Thanks.

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] mkfs.ubifs: free-space-fixup: note supported kernels
  2011-05-19 12:14             ` [PATCH v2] " Ben Gardiner
@ 2011-05-20 10:15               ` Artem Bityutskiy
  2011-05-24 14:36                 ` Ben Gardiner
  0 siblings, 1 reply; 12+ messages in thread
From: Artem Bityutskiy @ 2011-05-20 10:15 UTC (permalink / raw)
  To: Ben Gardiner; +Cc: linux-mtd, Matthew L. Creech

Hi,

On Thu, 2011-05-19 at 08:14 -0400, Ben Gardiner wrote:
>   *
>   * UBIFS_FLG_BIGLPT: if "big" LPT model is used if set
>   * UBIFS_FLG_SPACE_FIXUP: first-mount "fixup" of free space within LEBs needed
> + *                        the free space fixup will be performed only by kernel
> + *                        releases 2.6.40 or greater.
>   */

Since this is kind of an out-of-date copy of the kernel header file,
this change is not needed because it'll anyway go away when someone
syncs ubifs-media.h with the kernel.

After my changes to Matthew's patch and tweaks to your patch I've found
out that it is cleaner to just fold your patch into Mathew's and make
one single commit. I've thanked you in the commit message and pushed one
single commit instead:

http://git.infradead.org/mtd-utils.git/commit/04665066ebedb0a31335b525fb5f19df32cb8cfe

Hopefully you will not mind.

Thanks!

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] mkfs.ubifs: free-space-fixup: note supported kernels
  2011-05-20 10:15               ` Artem Bityutskiy
@ 2011-05-24 14:36                 ` Ben Gardiner
  0 siblings, 0 replies; 12+ messages in thread
From: Ben Gardiner @ 2011-05-24 14:36 UTC (permalink / raw)
  To: dedekind1; +Cc: linux-mtd, Matthew L. Creech

On Fri, May 20, 2011 at 6:15 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> [...]
> After my changes to Matthew's patch and tweaks to your patch I've found
> out that it is cleaner to just fold your patch into Mathew's and make
> one single commit. I've thanked you in the commit message and pushed one
> single commit instead:
>
> http://git.infradead.org/mtd-utils.git/commit/04665066ebedb0a31335b525fb5f19df32cb8cfe
>
> Hopefully you will not mind.

Not at all. I'm happy to see the free-space-fixup merged.

Best Regards,
Ben Gardiner

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-05-24 14:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-04 22:14 [PATCH v2] mkfs.ubifs: add "-F" option for "free-space fixup" Matthew L. Creech
2011-05-11 20:09 ` Ben Gardiner
2011-05-11 21:01   ` Matthew L. Creech
2011-05-11 21:02     ` [PATCH 1/1] " Matthew L. Creech
2011-05-12 13:13       ` Artem Bityutskiy
2011-05-18 20:57       ` [PATCH] mkfs.ubifs: free-space-fixup: note supported kernels Ben Gardiner
2011-05-19  5:41         ` Matthew L. Creech
2011-05-19  5:56           ` Artem Bityutskiy
2011-05-19 12:14             ` [PATCH v2] " Ben Gardiner
2011-05-20 10:15               ` Artem Bityutskiy
2011-05-24 14:36                 ` Ben Gardiner
2011-05-20 10:11       ` [PATCH 1/1] mkfs.ubifs: add "-F" option for "free-space fixup" Artem Bityutskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.