<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mtd-utils.git/tests/fs-tests/integrity, branch v1.5.1</title>
<subtitle>A mirror of http://git.infradead.org/mtd-utils.git</subtitle>
<id>https://git.infraroot.at/mtd-utils.git/atom?h=v1.5.1</id>
<link rel='self' href='https://git.infraroot.at/mtd-utils.git/atom?h=v1.5.1'/>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/'/>
<updated>2013-03-11T08:44:29+00:00</updated>
<entry>
<title>integck: fix identation a bit</title>
<updated>2013-03-11T08:44:29+00:00</updated>
<author>
<name>Artem Bityutskiy</name>
<email>artem.bityutskiy@linux.intel.com</email>
</author>
<published>2013-03-11T08:44:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=c8f34d79c4f5d6f061d744538949167afa803f5f'/>
<id>urn:sha1:c8f34d79c4f5d6f061d744538949167afa803f5f</id>
<content type='text'>
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>integck.c: Fix buffer overflow in save_file</title>
<updated>2013-03-11T08:40:23+00:00</updated>
<author>
<name>Elie De Brauwer</name>
<email>eliedebrauwer@gmail.com</email>
</author>
<published>2013-03-01T18:37:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=ca7a5eda221d53aa571836a6186ed117c804d702'/>
<id>urn:sha1:ca7a5eda221d53aa571836a6186ed117c804d702</id>
<content type='text'>
In the problem above I've spend several hours waiting for the issue to 
appear, only to had the 'luck' that it was found in a file whose name was
256 bytes in length, resulting in the write to fail. Closer examination 
showed that the buffer to store the path was 256 bytes in length, but this
buffer also includes /tmp and the read/write suffix and should be able to
contain a filename which is up to 255 bytes (NAME_MAX in linux/limits.h)
in size which is a bad fit. So that array is modified to FILENAME_MAX
(stdio_lim.h) and some checking is added to truncate the filename should
it cause an overflow.

The following log shows the first patch in action (see the correct seed), 
and shows why this third patch is needed:
&lt;quote&gt;
integck:     File Data:
integck:         Offset: 0  Size: 1  Seed: 5008310  R.Off: 0
integck:     1 writes
integck:     ============================================
integck:     Write Info:
integck:         Offset: 0  Size: 1  Seed: 5008310  R.Off: 0
integck:         Offset: 0  Size: 1  Seed: 8246352  R.Off: 0
integck:         Offset: 0  Size: 1  Seed: 5078796  R.Off: 0
integck:         Offset: 0  Size: 1  Seed: 2267087  R.Off: 0
integck:         Offset: 0  Size: 1  Seed: 3602680  R.Off: 0
integck:     5 writes or truncations
integck:     ============================================
integck: Saving /tmp/yqcnfygfitaatyeyvffrguegcdttamcnyhowhgieljfuxfipiljsjcbluaeaghwyinkggommsbwnmvekihgnwgiibccpbwfrpxuxwkmnyghnutrudienngxwgorudbskedaaekiuiyqksfazrwzfwbfhzjjqoiulebtlpbfiuffmsnguqkjzqjqizimsmhbqqagaebjdhqwmzdxghiavtcxubegawlgtvstuqurkurpnrckjfkgostdtpg.integ.sav.readn
integck: error!: condition 'w_fd != -1' failed in save_file() at integck.c:1445
integck: error 36 (File name too long)
&lt;/quote&gt;

Signed-off-by: Elie De Brauwer &lt;eliedebrauwer@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>integck.c: rework file_check_data to immediately dump the buffer containing the errors</title>
<updated>2013-03-11T08:36:02+00:00</updated>
<author>
<name>Elie De Brauwer</name>
<email>eliedebrauwer@gmail.com</email>
</author>
<published>2013-03-01T18:37:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=3ff90433ab22c001215d9a26c65de1b7f448dc79'/>
<id>urn:sha1:3ff90433ab22c001215d9a26c65de1b7f448dc79</id>
<content type='text'>
See my problem description int the previous commit, the point is that integck
in file_check_data reads a buffer, and then checks if the data is correct,  it
will do a seek(0), and reread from the same fd. The point is that in the
scenario I observed integck failed (due to a buffer mismatch) but the it saved
(and what was in flash) was actually correct. So I modified this function to
dump the buffers to stderr at the moment an error is found.

Signed-off-by: Elie De Brauwer &lt;eliedebrauwer@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>integck.c: Only verify the operation after all datastructures have been updated</title>
<updated>2013-03-11T08:33:58+00:00</updated>
<author>
<name>Elie De Brauwer</name>
<email>eliedebrauwer@gmail.com</email>
</author>
<published>2013-03-01T18:37:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=681d1d6c311ac918986e964f65097d556b2acd78'/>
<id>urn:sha1:681d1d6c311ac918986e964f65097d556b2acd78</id>
<content type='text'>
&lt;quote&gt;
integck:     File Data:
integck:         Offset: 0  Size: 196  Seed: 5999877  R.Off: 0
integck:         Offset: 196  Size: 33  Seed: 4160795  R.Off: 0
integck:         Offset: 229  Size: 1252  Seed: 8070052  R.Off: 0
integck:         Offset: 1481  Size: 612  Seed: 4160795  R.Off: 1285
integck:         Offset: 2093  Size: 6  Seed: 6946586  R.Off: 0
integck:         Offset: 2099  Size: 536  Seed: 4160795  R.Off: 1903
integck:         Offset: 2635  Size: 1562  Seed: 9845455  R.Off: 0
integck:         Offset: 4197  Size: 80  Seed: 702818  R.Off: 0
integck:         Offset: 4277  Size: 115  Seed: 9845455  R.Off: 1642
integck:     9 writes
integck:     ============================================
integck:     Write Info:
integck:         Offset: 826  Size: 357  Seed: 5908448  R.Off: 0
integck:         Offset: 4197  Size: 80  Seed: 702818  R.Off: 0
...
&lt;/quote&gt;
And I would expect the file data listing to include at offset 826 something
with a size of 357 and a seed of 5908448. Clearly it is not there (which
is already extremely confusing). The point is that file_write_info first 
updates the raw_write, then verifies the data (passing the new write) 
and only after that updates the write structure. But in file_check_data
only the newly written data is verified (passed as an argument) whilst 
the save_file() function to dump the file uses the raw_writes to recreate
the written data (while raw_writes is only updated after after this check
would have succeeded). Several lines to say that in this patch the verify
only gets called _after_ the datastructures are updated. 

Signed-off-by: Elie De Brauwer &lt;eliedebrauwer@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>consistency between u_int32_t / off_t / off64_t</title>
<updated>2012-09-25T15:06:50+00:00</updated>
<author>
<name>Richard Genoud</name>
<email>richard.genoud@gmail.com</email>
</author>
<published>2012-09-12T14:38:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=f3f3a208048eac5f8b5752a17ebcd44db9230fd8'/>
<id>urn:sha1:f3f3a208048eac5f8b5752a17ebcd44db9230fd8</id>
<content type='text'>
We should use the off_t type instead of off64_t or u_int32_t as its
length is controlled by the WITHOUT_LARGEFILE flag.

Signed-off-by: Richard Genoud &lt;richard.genoud@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>ubiattach: introduce max_beb_per1024 in UBI_IOCATT</title>
<updated>2012-08-23T09:16:10+00:00</updated>
<author>
<name>Richard Genoud</name>
<email>richard.genoud@gmail.com</email>
</author>
<published>2012-08-22T16:04:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=878e06ea555ba5dbfb974b3904d1a86a9a0e20f5'/>
<id>urn:sha1:878e06ea555ba5dbfb974b3904d1a86a9a0e20f5</id>
<content type='text'>
The ioctl UBI_IOCATT has been extended with max_beb_per1024 parameter.

This parameter is used for adjusting the "maximum expected number of
bad blocks per 1024 blocks" for each mtd device.
The number of physical erase blocks (PEB) that UBI will reserve for bad
block handling is now:
whole_flash_chipset__PEB_number * max_beb_per1024 / 1024

This means that for a 4096 PEB NAND device with 3 MTD partitions:
mtd0: 512 PEB
mtd1: 1536 PEB
mtd2: 2048 PEB

the commands:
ubiattach -m 0 -d 0 -b 20 /dev/ubi_ctrl
ubiattach -m 1 -d 1 -b 20 /dev/ubi_ctrl
ubiattach -m 2 -d 2 -b 20 /dev/ubi_ctrl
will attach mtdx to UBIx and reserve:
80 PEB for bad block handling on UBI0
80 PEB for bad block handling on UBI1
80 PEB for bad block handling on UBI2

=&gt; for the whole device, 240 PEB will be reserved for bad block
handling.

This may seems a waste of space, but as far as the bad blocks can appear
every where on a flash device, in the worst case scenario they can
all appear in one MTD partition.
So the maximum number of expected erase blocks given by the NAND
manufacturer should be reserve on each MTD partition.

Signed-off-by: Richard Genoud &lt;richard.genoud@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>mtd-utils: update .gitignore files</title>
<updated>2011-06-29T05:42:39+00:00</updated>
<author>
<name>Brian Norris</name>
<email>computersforpeace@gmail.com</email>
</author>
<published>2011-06-27T18:27:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=f0bfefeb47291a83d0d0c2b6793e3fa41ef27339'/>
<id>urn:sha1:f0bfefeb47291a83d0d0c2b6793e3fa41ef27339</id>
<content type='text'>
First, the top-level Makefile should not tell git to ignore sub-level
.gitignore files.

Second, add simple .gitignores to ignore the executables generated under
the various `tests' subdirectories.

Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
Acked-by: Mike Frysinger &lt;vapier@gentoo.org&gt;
Signed-off-by: Artem Bityutskiy &lt;dedekind1@gmail.com&gt;
</content>
</entry>
<entry>
<title>rewrite build system to avoid recursion</title>
<updated>2011-06-27T06:07:07+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@gentoo.org</email>
</author>
<published>2011-06-25T17:20:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=3285a49dd871d54c1ec13076173ad617443baae1'/>
<id>urn:sha1:3285a49dd871d54c1ec13076173ad617443baae1</id>
<content type='text'>
The ubi-utils/src/ subdir is tossed as it just complicates things for no
real gain.  The dictionary.h header is relocated to the ubi-utils/include/
since other headers in there need it.

The top level clean is replaced with a `find -delete` on objects, so it
might prune more than necessary, but many projects now do this sort of
thing and no one complained there.

A "mkdep" helper generates the actual rule, and the variables are used
with "foreach" to expand these automatically.

The tests subdir is updated only to reflect the ubi-utils source move.
Otherwise, it is left untouched as making that non-recursive isn't really
worth the effort.

While we're gutting things, also through in kbuild style output while
building to make things more legible.

Signed-off-by: Mike Frysinger &lt;vapier@gentoo.org&gt;
Signed-off-by: Artem Bityutskiy &lt;dedekind1@gmail.com&gt;
</content>
</entry>
<entry>
<title>integck: fix build error (MS_DIRSYNC, MS_RELATIME)</title>
<updated>2011-06-25T07:02:11+00:00</updated>
<author>
<name>Brian Norris</name>
<email>computersforpeace@gmail.com</email>
</author>
<published>2011-06-24T18:03:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=4e751144ba287ed92de644eabb8d8a2f4971ecbb'/>
<id>urn:sha1:4e751144ba287ed92de644eabb8d8a2f4971ecbb</id>
<content type='text'>
Need to include &lt;linux/fs.h&gt;, at least for my build system. Otherwise,
you can't build the 'tests'.

integck.c: In function ‘parse_mount_options’:
integck.c:2862: error: ‘MS_DIRSYNC’ undeclared (first use in this
function)
integck.c:2862: error: (Each undeclared identifier is reported only once
integck.c:2862: error: for each function it appears in.)
integck.c:2872: error: ‘MS_RELATIME’ undeclared (first use in this
function)

Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
</content>
</entry>
<entry>
<title>fs-tests: integck: add some more error messages</title>
<updated>2011-05-27T12:55:08+00:00</updated>
<author>
<name>Artem Bityutskiy</name>
<email>Artem.Bityutskiy@nokia.com</email>
</author>
<published>2011-05-26T13:04:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=8ed2f6b8bf6465197230b196f013b9cae1308ca8'/>
<id>urn:sha1:8ed2f6b8bf6465197230b196f013b9cae1308ca8</id>
<content type='text'>
Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
</content>
</entry>
</feed>
