<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mtd-utils.git/tests, branch v1.5.2</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.2</id>
<link rel='self' href='https://git.infraroot.at/mtd-utils.git/atom?h=v1.5.2'/>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/'/>
<updated>2015-07-06T21:55:03+00:00</updated>
<entry>
<title>mtd-utils: fix 'new blank line at EOF' problems</title>
<updated>2015-07-06T21:55:03+00:00</updated>
<author>
<name>Dongsheng Yang</name>
<email>yangds.fnst@cn.fujitsu.com</email>
</author>
<published>2015-07-01T03:44:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=5be8bafab070709ccc7535bc895ff16f141e3ad5'/>
<id>urn:sha1:5be8bafab070709ccc7535bc895ff16f141e3ad5</id>
<content type='text'>
Signed-off-by: Dongsheng Yang &lt;yangds.fnst@cn.fujitsu.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
</entry>
<entry>
<title>mtd-utils: fix the trailing whitespace problems</title>
<updated>2015-07-06T21:52:35+00:00</updated>
<author>
<name>Dongsheng Yang</name>
<email>yangds.fnst@cn.fujitsu.com</email>
</author>
<published>2015-07-01T03:44:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=ddd8d3b39fc9b84a3bdb94d9ac62d2b20581dca4'/>
<id>urn:sha1:ddd8d3b39fc9b84a3bdb94d9ac62d2b20581dca4</id>
<content type='text'>
Signed-off-by: Dongsheng Yang &lt;yangds.fnst@cn.fujitsu.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
</entry>
<entry>
<title>mtd-utils: ubi-tests: fix a some overflows</title>
<updated>2015-07-06T21:42:38+00:00</updated>
<author>
<name>Dongsheng Yang</name>
<email>yangds.fnst@cn.fujitsu.com</email>
</author>
<published>2015-06-29T08:49:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=e76eeca21de23ae884e415a12809ac683960cbca'/>
<id>urn:sha1:e76eeca21de23ae884e415a12809ac683960cbca</id>
<content type='text'>
Signed-off-by: Dongsheng Yang &lt;yangds.fnst@cn.fujitsu.com&gt;
Reviewed-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
</entry>
<entry>
<title>mtd-utils: fs-tests: pass TEST_DIR to integck in run_all.sh</title>
<updated>2015-07-06T21:39:59+00:00</updated>
<author>
<name>Dongsheng Yang</name>
<email>yangds.fnst@cn.fujitsu.com</email>
</author>
<published>2015-06-29T08:49:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=eb3f8a53e92b250b1086b216da7049eff0bd4589'/>
<id>urn:sha1:eb3f8a53e92b250b1086b216da7049eff0bd4589</id>
<content type='text'>
Test integck requires a parameter but run_all.sh did no pass any to it.
Then:
integck: error!: test file-system was not specified (use -h for help)

Signed-off-by: Dongsheng Yang &lt;yangds.fnst@cn.fujitsu.com&gt;
Reviewed-by: Richard Weinberger &lt;richard@nod.at&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
</entry>
<entry>
<title>mtd-utils: integck: Use $(CC) and $(AR) instead of 'gcc' and 'ar' consistently</title>
<updated>2014-04-15T13:01:12+00:00</updated>
<author>
<name>Mats Kärrman</name>
<email>mats.karrman@tritech.se</email>
</author>
<published>2014-04-11T07:38:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=7556c09cbac5c9d8a7a6d9c7c4bb736e2c472366'/>
<id>urn:sha1:7556c09cbac5c9d8a7a6d9c7c4bb736e2c472366</id>
<content type='text'>
Not using the macros may be a problem when cross-compiling.

Signed-off-by: Mats Karrman &lt;mats.karrman@tritech.se&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
</entry>
<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>ubi-tests: fix pthreads linking</title>
<updated>2012-12-03T13:16:55+00:00</updated>
<author>
<name>Brian Norris</name>
<email>computersforpeace@gmail.com</email>
</author>
<published>2012-11-25T07:26:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=3835899b3b29904eede98e0c22973a430c9cb1f9'/>
<id>urn:sha1:3835899b3b29904eede98e0c22973a430c9cb1f9</id>
<content type='text'>
Technically, '-l' linker options should be included only after the
objects which must link to the library. So when we include '-lpthread'
in the LDFLAGS variable, it gets placed too early (i.e., before the
io_paral.o object), and so the pthread linkage never occurs. The
following error probably only shows up with linkers that don't link
pthreads by default.

$ make tests V=1
...
gcc -I../../ubi-utils//include -I ../../include -lpthread -Wall -Wextra -Wwrite-strings -Wno-sign-compare -ffunction-sections -fdata-sections -Wl,--gc-sections   -g -o /home/norris/git/mtd-utils/tests/ubi-tests/io_paral /home/norris/git/mtd-utils/tests/ubi-tests/io_paral.o /home/norris/git/mtd-utils/tests/ubi-tests/helpers.o libubi.a
/home/norris/git/mtd-utils/tests/ubi-tests/io_paral.o: In function `main':
/home/norris/git/mtd-utils/tests/ubi-tests/io_paral.c:287: undefined reference to `pthread_create'
/home/norris/git/mtd-utils/tests/ubi-tests/io_paral.c:295: undefined reference to `pthread_create'
/home/norris/git/mtd-utils/tests/ubi-tests/io_paral.c:303: undefined reference to `pthread_join'
collect2: ld returned 1 exit status
make[2]: *** [/home/norris/git/mtd-utils/tests/ubi-tests/io_paral] Error 1
...

$ ld --version
GNU ld (GNU Binutils for Ubuntu) 2.22
...
$ gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
...

Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
</entry>
</feed>
