<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mtd-utils.git/tests/ubi-tests/integ.c, branch v2.3.1</title>
<subtitle>A mirror of http://git.infradead.org/mtd-utils.git</subtitle>
<id>https://git.infraroot.at/mtd-utils.git/atom?h=v2.3.1</id>
<link rel='self' href='https://git.infraroot.at/mtd-utils.git/atom?h=v2.3.1'/>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/'/>
<updated>2019-06-16T10:27:10+00:00</updated>
<entry>
<title>ubi-tests: ubi_mkvol_request: Fully initialize 'struct ubi_mkvol_request req'</title>
<updated>2019-06-16T10:27:10+00:00</updated>
<author>
<name>Zhihao Cheng</name>
<email>chengzhihao1@huawei.com</email>
</author>
<published>2019-06-14T12:14:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=c74c62420cbe1939c924e83f00e8838f148ae051'/>
<id>urn:sha1:c74c62420cbe1939c924e83f00e8838f148ae051</id>
<content type='text'>
'struct ubi_mkvol_request req' is one parameter of the function 'ubi_mkvol'
, this parameter will be passed to kernel and then be checked. It acts as a
local variable in many ubi tests, such as io_basic, io_read, mkvol_bad,
mkvol_basic, etc.

After commit c355aa465fce ("ubi: expose the volume CRC check skip flag") in
linux-stable, 'struct ubi_mkvol_request' supports a new configuration named
'flags', and req.flags will be checked in kernel function
'verify_mkvol_req'. Currently, there is no initialization for req.flags
before 'ubi_mkvol' invoked. So, req.flags can be an arbitrary number passed
to kernel. When we run ubi tests in qemu (x86_64, kernel image: 5.2.0-rc4),
the following errors may occur:

  ======================================================================
  ======================================================================
  ======================================================================
  Test on mtdram, fastmap enabled, VID header offset factor 1
  ======================================================================
  ======================================================================
  ======================================================================
  mtdram: 16MiB, PEB size 16KiB, fastmap enabled
  Running mkvol_basic /dev/ubi0
  Running mkvol_bad /dev/ubi0
  [mkvol_bad] test_mkvol():105: ubi_mkvol failed with error 22
  (Invalid argument), expected 28 (No space left on device)
  [mkvol_bad] test_mkvol():105: bytes = 16060929
  Error: mkvol_bad failed
  FAILURE

This patch fully initializes every 'struct ubi_mkvol_request req' passed to
'ubi_mkvol', which can fix the bug that the ubi test failed caused by that
req.flags was not initialized. And it is still compatible with old kernel
before kernel commit c355aa465fce ("ubi: expose the volume CRC check skip
flag").

----------------------------------------

Signed-off-by: Zhihao Cheng &lt;chengzhihao1@huawei.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>mtd-utils: Instead of doing preprocessor magic, just output off_t as long long</title>
<updated>2018-10-02T12:00:28+00:00</updated>
<author>
<name>Thorsten Glaser</name>
<email>tg@mirbsd.org</email>
</author>
<published>2018-09-20T23:22:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=64667fe63ba9dd78adb9c4abf04bc3e4e25a0fd7'/>
<id>urn:sha1:64667fe63ba9dd78adb9c4abf04bc3e4e25a0fd7</id>
<content type='text'>
Fix warnings abot PRIdoff_t in libmtd.c, in mtd_read (and mtd_write):

In file included from ../git/lib/libmtd.c:40:0:
../git/lib/libmtd.c: In function 'mtd_read':
../git/include/common.h:110:18: warning: format '%ld' expects argument of
 type 'long int', but argument 5 has type 'off_t {aka long long int}'
 [-Wformat=]

../git/include/common.h:120:2: note: in expansion of macro 'errmsg'
  errmsg(fmt, ##__VA_ARGS__);                                         \
  ^~~~~~
../git/lib/libmtd.c:1082:10: note: in expansion of macro 'sys_errmsg'
   return sys_errmsg("cannot seek mtd%d to offset %"PRIdoff_t,
          ^~~~~~~~~~

/usr/lib/klibc/include/inttypes.h:28:17: note: format string is defined here
 #define PRId32 "d"

Signed-off-by: Thorsten Glaser &lt;tg@mirbsd.org&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Remove unused variables and functions</title>
<updated>2017-06-28T08:27:35+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2017-06-22T11:41:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=e511691315f6704961a0c8e3a9725f1a589a5c11'/>
<id>urn:sha1:e511691315f6704961a0c8e3a9725f1a589a5c11</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>common: Fix 'unchecked return code' warnings</title>
<updated>2016-12-06T18:38:16+00:00</updated>
<author>
<name>Boris Brezillon</name>
<email>boris.brezillon@free-electrons.com</email>
</author>
<published>2016-11-25T17:30:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=bfb33f2f46a40023aa9820f4cdd99281e41250c1'/>
<id>urn:sha1:bfb33f2f46a40023aa9820f4cdd99281e41250c1</id>
<content type='text'>
Several tools are simply not checking return code of functions marked
with 'warn_unused_result'.

Provide wrappers for the read/write functions to avoid patching old
code and providing proper error handling.
Fix the remaining ones (calls to fgets() and system()).

Signed-off-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>ubi-tests: switch to using common.h from the top level</title>
<updated>2012-11-16T08:09:54+00:00</updated>
<author>
<name>Artem Bityutskiy</name>
<email>artem.bityutskiy@linux.intel.com</email>
</author>
<published>2012-11-16T07:56:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=7343528e5821c69224000ed7cfd3e8aaf47b7a93'/>
<id>urn:sha1:7343528e5821c69224000ed7cfd3e8aaf47b7a93</id>
<content type='text'>
Sorry, the commit is huge, I just did not have time to split it.

Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>ubi-tests: rename common.[ch] to helpers.[ch]</title>
<updated>2012-11-16T07:52:21+00:00</updated>
<author>
<name>Artem Bityutskiy</name>
<email>artem.bityutskiy@linux.intel.com</email>
</author>
<published>2012-11-16T07:52:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=98ed9f3360bb5cbfb02d2cb82ee3167fce437772'/>
<id>urn:sha1:98ed9f3360bb5cbfb02d2cb82ee3167fce437772</id>
<content type='text'>
... to avoid confusion when the local common.h shadows the top-level common.h.

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>tests: ubi-tests: seed_random_generator() was used w/o prototype</title>
<updated>2011-04-05T14:27:43+00:00</updated>
<author>
<name>Andy Shevchenko</name>
<email>ext-andriy.shevchenko@nokia.com</email>
</author>
<published>2011-04-05T13:55:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=1bf8fb86ef192bc182a0c7cecdfc0792d6555fda'/>
<id>urn:sha1:1bf8fb86ef192bc182a0c7cecdfc0792d6555fda</id>
<content type='text'>
Signed-off-by: Andy Shevchenko &lt;ext-andriy.shevchenko@nokia.com&gt;
Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
</content>
</entry>
<entry>
<title>ubi-test: seed the random genrator in tests</title>
<updated>2010-06-15T11:02:48+00:00</updated>
<author>
<name>Artem Bityutskiy</name>
<email>Artem.Bityutskiy@nokia.com</email>
</author>
<published>2010-06-15T11:01:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=e4867287195421ed3c41e15ce292b00b1c0e3649'/>
<id>urn:sha1:e4867287195421ed3c41e15ce292b00b1c0e3649</id>
<content type='text'>
Add a common seed_random_generator() and make tests use it
for seeding the random generator.

Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
</content>
</entry>
<entry>
<title>ubi-tests: remove some junk from the integ test</title>
<updated>2010-06-15T11:02:47+00:00</updated>
<author>
<name>Artem Bityutskiy</name>
<email>Artem.Bityutskiy@nokia.com</email>
</author>
<published>2010-06-15T10:30:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=e3d3aa2593b32b11d967c3219c2b4881d881557e'/>
<id>urn:sha1:e3d3aa2593b32b11d967c3219c2b4881d881557e</id>
<content type='text'>
Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
</content>
</entry>
</feed>
