diff options
-rw-r--r-- | CHANGELOG.md | 25 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | jffsX-utils/jffs2reader.c | 3 | ||||
-rw-r--r-- | misc-utils/flashcp.c | 2 | ||||
-rw-r--r-- | nand-utils/nanddump.c | 5 | ||||
-rw-r--r-- | tests/checkfs/comm.c | 2 | ||||
-rw-r--r-- | ubi-utils/mtdinfo.c | 2 | ||||
-rw-r--r-- | ubi-utils/ubinize.c | 4 | ||||
-rw-r--r-- | ubi-utils/ubirsvol.c | 9 | ||||
-rw-r--r-- | ubifs-utils/Makemodule.am | 4 | ||||
-rw-r--r-- | ubifs-utils/common/README | 17 | ||||
-rw-r--r-- | ubifs-utils/common/atomic.h | 6 | ||||
-rw-r--r-- | ubifs-utils/common/defs.h | 5 | ||||
-rw-r--r-- | ubifs-utils/common/devtable.c | 1 | ||||
-rw-r--r-- | ubifs-utils/fsck.ubifs/extract_files.c | 2 | ||||
-rw-r--r-- | ubifs-utils/libubifs/README | 2 | ||||
-rw-r--r-- | ubifs-utils/libubifs/find.c | 40 | ||||
-rw-r--r-- | ubifs-utils/libubifs/journal.c | 1 | ||||
-rw-r--r-- | ubifs-utils/libubifs/lpt.c | 1 | ||||
-rw-r--r-- | ubifs-utils/libubifs/lpt_commit.c | 4 | ||||
-rw-r--r-- | ubifs-utils/libubifs/replay.c | 1 | ||||
-rw-r--r-- | ubifs-utils/libubifs/tnc_commit.c | 2 | ||||
-rw-r--r-- | ubifs-utils/libubifs/ubifs.h | 1 |
23 files changed, 96 insertions, 45 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index dfad584..204ee0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,31 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## [2.3.0] - 2025-02-15 +### Added + - fsck.ubifs: Add fsck utility for ubifs + - ubifs-utils: Support Address-Sanitizier debug + - nand-utils: nanddump: Add support for testing continuous reads + - mtd-tests: nandbiterrs: Add support for testing continuous reads + - mtd-tests: flash_speed: Benchmark continuous reads + +### Fixed + - Various integer handling errors (potential overflows, divide by zero) + - mkfs.jffs2: fix segfault when parsing dev table + - nand-utils: nanddump: Explicitely use the page size when relevant + - misc-utils: add missing error handling for 'bam' allocation in ftl_check.c + - mtdinfo: type mis-match in printf format string + - nanddump: const cast warning + - flashcp: uninitialized variable + - jffs2reader: potential null pointer dereference + - tests: checkfs: Add previous prototype for do_pwr_dn() + +### Changed + - mkfs.ubifs: re-sync with the kernel code + - mkfs.ubifs: move most of the code into a libubifs library + - Import a more recent version of libiniparser + - mtd-tests: flash_speed: cleanup/refactor + ## [2.2.1] - 2024-09-25 ### Fixed - fectest: Fix time formatting with _TIME_BITS=64 on 32-bit system diff --git a/configure.ac b/configure.ac index b160c03..2a79ba8 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ AC_PREREQ([2.60]) -m4_define([RELEASE], 2.2.1) +m4_define([RELEASE], 2.3.0) AC_INIT([mtd-utils], [RELEASE], [linux-mtd@lists.infradead.org], mtd-utils) diff --git a/jffsX-utils/jffs2reader.c b/jffsX-utils/jffs2reader.c index 87a2167..548fc8d 100644 --- a/jffsX-utils/jffs2reader.c +++ b/jffsX-utils/jffs2reader.c @@ -694,6 +694,9 @@ static struct jffs2_raw_dirent *resolvepath0(char *o, size_t size, uint32_t ino, pp = path = xstrdup(p); + if (path == NULL) + return NULL; + if (*path == '/') { path++; ino = 1; diff --git a/misc-utils/flashcp.c b/misc-utils/flashcp.c index 9c48637..6065a8c 100644 --- a/misc-utils/flashcp.c +++ b/misc-utils/flashcp.c @@ -221,7 +221,7 @@ int main (int argc,char *argv[]) struct mtd_info_user mtd; struct erase_info_user erase; struct stat filestat; - unsigned char *src,*dest,*wrlast_buf; + unsigned char *src, *dest, *wrlast_buf = NULL; unsigned long long wrlast_len = 0; int error = 0; diff --git a/nand-utils/nanddump.c b/nand-utils/nanddump.c index bc22858..b4de05e 100644 --- a/nand-utils/nanddump.c +++ b/nand-utils/nanddump.c @@ -102,6 +102,7 @@ static void process_options(int argc, char * const argv[]) { int error = 0; bool oob_default = true; + char *dumpfile_tmp = NULL; for (;;) { int option_index = 0; @@ -165,8 +166,8 @@ static void process_options(int argc, char * const argv[]) start_addr = simple_strtoll(optarg, &error); break; case 'f': - free(dumpfile); - dumpfile = xstrdup(optarg); + free(dumpfile_tmp); + dumpfile = dumpfile_tmp = xstrdup(optarg); break; case 'l': length = simple_strtoll(optarg, &error); diff --git a/tests/checkfs/comm.c b/tests/checkfs/comm.c index c8c457e..9f4e20d 100644 --- a/tests/checkfs/comm.c +++ b/tests/checkfs/comm.c @@ -28,6 +28,8 @@ #include <unistd.h> #include <string.h> +int do_pwr_dn(int fd, int cycleCnt); + /* This is the routine that forms and sends the "ok to pwr me down" message diff --git a/ubi-utils/mtdinfo.c b/ubi-utils/mtdinfo.c index 12d35eb..61ce7bc 100644 --- a/ubi-utils/mtdinfo.c +++ b/ubi-utils/mtdinfo.c @@ -204,7 +204,7 @@ static void print_region_map(const struct mtd_dev_info *mtd, int fd, for (i = 0; i < reginfo->numblocks; ++i) { start = reginfo->offset + (unsigned long long)i * reginfo->erasesize; - printf(" %*i: %08lx ", width, i, start); + printf(" %*i: %08llx ", width, i, start); if (ret_locked != -1) { ret_locked = mtd_is_locked(mtd, fd, i); diff --git a/ubi-utils/ubinize.c b/ubi-utils/ubinize.c index ac8c1e5..9c950b1 100644 --- a/ubi-utils/ubinize.c +++ b/ubi-utils/ubinize.c @@ -375,8 +375,8 @@ static int read_section(const struct ubigen_info *ui, const char *sname, vi->alignment = iniparser_getint(args.dict, buf, -1); if (vi->alignment == -1) vi->alignment = 1; - else if (vi->id < 0) - return errmsg("negative volume alignment %d in section \"%s\"", + else if (vi->alignment <= 0) + return errmsg("not positive volume alignment %d in section \"%s\"", vi->alignment, sname); verbose(args.verbose, "volume alignment: %d", vi->alignment); diff --git a/ubi-utils/ubirsvol.c b/ubi-utils/ubirsvol.c index 73d2f68..55f6794 100644 --- a/ubi-utils/ubirsvol.c +++ b/ubi-utils/ubirsvol.c @@ -57,8 +57,10 @@ static const char optionsstr[] = "-N, --name=<volume name> volume name to resize\n" "-s, --size=<bytes> volume size volume size in bytes, kilobytes (KiB)\n" " or megabytes (MiB)\n" +" zero size means use all available free bytes\n" "-S, --lebs=<LEBs count> alternative way to give volume size in logical\n" " eraseblocks\n" +" zero size means use all available free LEBs\n" "-h, -?, --help print help message\n" "-V, --version print program version"; @@ -114,13 +116,13 @@ static int parse_opt(int argc, char * const argv[]) switch (key) { case 's': args.bytes = util_get_bytes(optarg); - if (args.bytes <= 0) + if (args.bytes < 0) return errmsg("bad volume size: \"%s\"", optarg); break; case 'S': args.lebs = simple_strtoull(optarg, &error); - if (error || args.lebs <= 0) + if (error || args.lebs < 0) return errmsg("bad LEB count: \"%s\"", optarg); break; @@ -233,6 +235,9 @@ int main(int argc, char * const argv[]) if (args.lebs != -1) args.bytes = (long long)vol_info.leb_size * args.lebs; + if (args.lebs == 0 || args.bytes == 0) + args.bytes = vol_info.rsvd_bytes + dev_info.avail_bytes; + err = ubi_rsvol(libubi, args.node, args.vol_id, args.bytes); if (err) { sys_errmsg("cannot UBI resize volume"); diff --git a/ubifs-utils/Makemodule.am b/ubifs-utils/Makemodule.am index 21ba059..f84569a 100644 --- a/ubifs-utils/Makemodule.am +++ b/ubifs-utils/Makemodule.am @@ -72,7 +72,7 @@ mkfs_ubifs_SOURCES = \ ubifs-utils/mkfs.ubifs/mkfs.ubifs.c mkfs_ubifs_LDADD = libmtd.a libubi.a $(ZLIB_LIBS) $(LZO_LIBS) $(ZSTD_LIBS) $(UUID_LIBS) $(LIBSELINUX_LIBS) $(OPENSSL_LIBS) \ - $(DUMP_STACK_LD) $(ASAN_LIBS) -lm -lpthread + $(DUMP_STACK_LD) $(ASAN_LIBS) -lm -lpthread libmissing.a mkfs_ubifs_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CFLAGS) $(LZO_CFLAGS) $(ZSTD_CFLAGS) $(UUID_CFLAGS) $(LIBSELINUX_CFLAGS) \ -I$(top_srcdir)/ubi-utils/include -I$(top_srcdir)/ubifs-utils/common -I $(top_srcdir)/ubifs-utils/libubifs @@ -90,7 +90,7 @@ fsck_ubifs_SOURCES = \ ubifs-utils/fsck.ubifs/handle_disconnected.c fsck_ubifs_LDADD = libmtd.a libubi.a $(ZLIB_LIBS) $(LZO_LIBS) $(ZSTD_LIBS) $(UUID_LIBS) $(LIBSELINUX_LIBS) $(OPENSSL_LIBS) \ - $(DUMP_STACK_LD) $(ASAN_LIBS) -lm -lpthread + $(DUMP_STACK_LD) $(ASAN_LIBS) -lm -lpthread libmissing.a fsck_ubifs_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CFLAGS) $(LZO_CFLAGS) $(ZSTD_CFLAGS) $(UUID_CFLAGS) $(LIBSELINUX_CFLAGS) \ -I$(top_srcdir)/ubi-utils/include -I$(top_srcdir)/ubifs-utils/common -I $(top_srcdir)/ubifs-utils/libubifs \ -I$(top_srcdir)/ubifs-utils/fsck.ubifs diff --git a/ubifs-utils/common/README b/ubifs-utils/common/README index a93ebd0..8fe716e 100644 --- a/ubifs-utils/common/README +++ b/ubifs-utils/common/README @@ -1,14 +1,13 @@ Common Library -* crc16.h and crc16.c were copied from the linux kernel. -* crc32.h and crc32.c were copied from mtd-utils and amended. +* crc16.h and crc16.c were copied from the linux kernel(https://elixir.bootlin.com/linux/v5.10.232/source/lib/crc16.c). * defs.h is a bunch of definitions to smooth things over. * hashtable/* was downloaded from http://www.cl.cam.ac.uk/~cwc22/hashtable/ * atomic.h was downloaded from https://the-linux-channel.the-toffee-project.org/index.php?page=6-tutorials-linux-user-space-atomic-operations -* bitops.h and bitops.c were copied from the linux kernel. -* compiler_attributes.h was copied from the linux kernel. -* linux_types.h was copied from the linux kernel. -* linux_err.h was copied from the linux kernel. -* hexdump.c was copied from the linux kernel. -* kmem.h and kmem.c were partial copied from xfsprogs-dev (https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/) -* sort.h and sort.c were copied from the linux kernel. +* bitops.h and bitops.c were copied from the linux kernel(https://elixir.bootlin.com/linux/v5.10.232/source/lib/find_bit.c). +* compiler_attributes.h was copied from the linux kernel(https://elixir.bootlin.com/linux/v5.10.232/source/include/linux/compiler_attributes.h). +* linux_types.h was copied from the linux kernel(https://elixir.bootlin.com/linux/v5.10.232/source/include/linux/types.h overflow.h fscrypt.h). +* linux_err.h was copied from the linux kernel(https://elixir.bootlin.com/linux/v5.10.232/source/include/linux/err.h). +* hexdump.c was copied from the linux kernel(https://elixir.bootlin.com/linux/v5.10.232/source/lib/hexdump.c). +* kmem.h and kmem.c were partial copied from xfsprogs-dev(https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/). +* sort.h and sort.c were copied from the linux kernel(https://elixir.bootlin.com/linux/v5.10.232/source/lib/sort.c). diff --git a/ubifs-utils/common/atomic.h b/ubifs-utils/common/atomic.h index f287d43..95754b2 100644 --- a/ubifs-utils/common/atomic.h +++ b/ubifs-utils/common/atomic.h @@ -2,8 +2,12 @@ #ifndef __ATOMIC_H__ #define __ATOMIC_H__ +#define GCC_VERSION (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) + /* Check GCC version, just to be safe */ -#if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC_MINOR__ < 1) +#if GCC_VERSION < 40100 # error atomic.h works only with GCC newer than version 4.1 #endif /* GNUC >= 4.1 */ diff --git a/ubifs-utils/common/defs.h b/ubifs-utils/common/defs.h index 7ff1771..d5edbf6 100644 --- a/ubifs-utils/common/defs.h +++ b/ubifs-utils/common/defs.h @@ -13,8 +13,11 @@ #include <errno.h> #include <time.h> #include <assert.h> +#if HAVE_EXECINFO_H #include <execinfo.h> - +#else +#include "libmissing.h" +#endif #include "ubifs.h" /* common.h requires the PROGRAM_NAME macro */ diff --git a/ubifs-utils/common/devtable.c b/ubifs-utils/common/devtable.c index 7347f09..2e581ff 100644 --- a/ubifs-utils/common/devtable.c +++ b/ubifs-utils/common/devtable.c @@ -392,6 +392,7 @@ int parse_devtable(const char *tbl_file) out_close: fclose(f); + free(line); free_devtable_info(); return -1; } diff --git a/ubifs-utils/fsck.ubifs/extract_files.c b/ubifs-utils/fsck.ubifs/extract_files.c index c83d377..000ef5d 100644 --- a/ubifs-utils/fsck.ubifs/extract_files.c +++ b/ubifs-utils/fsck.ubifs/extract_files.c @@ -10,6 +10,8 @@ #include <getopt.h> #include <sys/stat.h> +#include <linux/limits.h> + #include "linux_err.h" #include "bitops.h" #include "kmem.h" diff --git a/ubifs-utils/libubifs/README b/ubifs-utils/libubifs/README index 551ed8e..dd9322a 100644 --- a/ubifs-utils/libubifs/README +++ b/ubifs-utils/libubifs/README @@ -1,4 +1,4 @@ -UBIFS Library (Imported from linux kernel 6.8-rc2 41bccc98fb7931d63) +UBIFS Library (Imported from linux kernel 6.13-rc7 aa22f4da2a46) * ubifs.h is a selection of definitions from fs/ubifs/ubifs.h from the linux kernel. * key.h is copied from fs/ubifs/key.h from the linux kernel. diff --git a/ubifs-utils/libubifs/find.c b/ubifs-utils/libubifs/find.c index ecf689c..364252e 100644 --- a/ubifs-utils/libubifs/find.c +++ b/ubifs-utils/libubifs/find.c @@ -80,7 +80,7 @@ static int valuable(struct ubifs_info *c, const struct ubifs_lprops *lprops) * @c: the UBIFS file-system description object * @lprops: LEB properties to scan * @in_tree: whether the LEB properties are in main memory - * @data: information passed to and from the caller of the scan + * @arg: information passed to and from the caller of the scan * * This function returns a code that indicates whether the scan should continue * (%LPT_SCAN_CONTINUE), whether the LEB properties should be added to the tree @@ -89,8 +89,9 @@ static int valuable(struct ubifs_info *c, const struct ubifs_lprops *lprops) */ static int scan_for_dirty_cb(struct ubifs_info *c, const struct ubifs_lprops *lprops, int in_tree, - struct scan_data *data) + void *arg) { + struct scan_data *data = arg; int ret = LPT_SCAN_CONTINUE; /* Exclude LEBs that are currently in use */ @@ -173,8 +174,7 @@ static const struct ubifs_lprops *scan_for_dirty(struct ubifs_info *c, data.pick_free = pick_free; data.lnum = -1; data.exclude_index = exclude_index; - err = ubifs_lpt_scan_nolock(c, -1, c->lscan_lnum, - (ubifs_lpt_scan_callback)scan_for_dirty_cb, + err = ubifs_lpt_scan_nolock(c, -1, c->lscan_lnum, scan_for_dirty_cb, &data); if (err) return ERR_PTR(err); @@ -347,7 +347,7 @@ out: * @c: the UBIFS file-system description object * @lprops: LEB properties to scan * @in_tree: whether the LEB properties are in main memory - * @data: information passed to and from the caller of the scan + * @arg: information passed to and from the caller of the scan * * This function returns a code that indicates whether the scan should continue * (%LPT_SCAN_CONTINUE), whether the LEB properties should be added to the tree @@ -356,8 +356,9 @@ out: */ static int scan_for_free_cb(struct ubifs_info *c, const struct ubifs_lprops *lprops, int in_tree, - struct scan_data *data) + void *arg) { + struct scan_data *data = arg; int ret = LPT_SCAN_CONTINUE; /* Exclude LEBs that are currently in use */ @@ -453,7 +454,7 @@ const struct ubifs_lprops *do_find_free_space(struct ubifs_info *c, data.pick_free = pick_free; data.lnum = -1; err = ubifs_lpt_scan_nolock(c, -1, c->lscan_lnum, - (ubifs_lpt_scan_callback)scan_for_free_cb, + scan_for_free_cb, &data); if (err) return ERR_PTR(err); @@ -587,7 +588,7 @@ out: * @c: the UBIFS file-system description object * @lprops: LEB properties to scan * @in_tree: whether the LEB properties are in main memory - * @data: information passed to and from the caller of the scan + * @arg: information passed to and from the caller of the scan * * This function returns a code that indicates whether the scan should continue * (%LPT_SCAN_CONTINUE), whether the LEB properties should be added to the tree @@ -596,8 +597,9 @@ out: */ static int scan_for_idx_cb(struct ubifs_info *c, const struct ubifs_lprops *lprops, int in_tree, - struct scan_data *data) + void *arg) { + struct scan_data *data = arg; int ret = LPT_SCAN_CONTINUE; /* Exclude LEBs that are currently in use */ @@ -632,8 +634,7 @@ static const struct ubifs_lprops *scan_for_leb_for_idx(struct ubifs_info *c) int err; data.lnum = -1; - err = ubifs_lpt_scan_nolock(c, -1, c->lscan_lnum, - (ubifs_lpt_scan_callback)scan_for_idx_cb, + err = ubifs_lpt_scan_nolock(c, -1, c->lscan_lnum, scan_for_idx_cb, &data); if (err) return ERR_PTR(err); @@ -733,11 +734,10 @@ out: return err; } -static int cmp_dirty_idx(const struct ubifs_lprops **a, - const struct ubifs_lprops **b) +static int cmp_dirty_idx(const void *a, const void *b) { - const struct ubifs_lprops *lpa = *a; - const struct ubifs_lprops *lpb = *b; + const struct ubifs_lprops *lpa = *(const struct ubifs_lprops **)a; + const struct ubifs_lprops *lpb = *(const struct ubifs_lprops **)b; return lpa->dirty + lpa->free - lpb->dirty - lpb->free; } @@ -761,7 +761,7 @@ int ubifs_save_dirty_idx_lnums(struct ubifs_info *c) sizeof(void *) * c->dirty_idx.cnt); /* Sort it so that the dirtiest is now at the end */ sort(c->dirty_idx.arr, c->dirty_idx.cnt, sizeof(void *), - (int (*)(const void *, const void *))cmp_dirty_idx, NULL); + cmp_dirty_idx, NULL); dbg_find("found %d dirty index LEBs", c->dirty_idx.cnt); if (c->dirty_idx.cnt) dbg_find("dirtiest index LEB is %d with dirty %d and free %d", @@ -780,7 +780,7 @@ int ubifs_save_dirty_idx_lnums(struct ubifs_info *c) * @c: the UBIFS file-system description object * @lprops: LEB properties to scan * @in_tree: whether the LEB properties are in main memory - * @data: information passed to and from the caller of the scan + * @arg: information passed to and from the caller of the scan * * This function returns a code that indicates whether the scan should continue * (%LPT_SCAN_CONTINUE), whether the LEB properties should be added to the tree @@ -789,8 +789,9 @@ int ubifs_save_dirty_idx_lnums(struct ubifs_info *c) */ static int scan_dirty_idx_cb(struct ubifs_info *c, const struct ubifs_lprops *lprops, int in_tree, - struct scan_data *data) + void *arg) { + struct scan_data *data = arg; int ret = LPT_SCAN_CONTINUE; /* Exclude LEBs that are currently in use */ @@ -849,8 +850,7 @@ static int find_dirty_idx_leb(struct ubifs_info *c) if (c->pnodes_have >= c->pnode_cnt) /* All pnodes are in memory, so skip scan */ return -ENOSPC; - err = ubifs_lpt_scan_nolock(c, -1, c->lscan_lnum, - (ubifs_lpt_scan_callback)scan_dirty_idx_cb, + err = ubifs_lpt_scan_nolock(c, -1, c->lscan_lnum, scan_dirty_idx_cb, &data); if (err) return err; diff --git a/ubifs-utils/libubifs/journal.c b/ubifs-utils/libubifs/journal.c index e78ea14..45d82fd 100644 --- a/ubifs-utils/libubifs/journal.c +++ b/ubifs-utils/libubifs/journal.c @@ -46,6 +46,7 @@ * all the nodes. */ +#include <sys/stat.h> #include "bitops.h" #include "kmem.h" #include "ubifs.h" diff --git a/ubifs-utils/libubifs/lpt.c b/ubifs-utils/libubifs/lpt.c index 8e20a17..f2f2727 100644 --- a/ubifs-utils/libubifs/lpt.c +++ b/ubifs-utils/libubifs/lpt.c @@ -2009,6 +2009,7 @@ out_err: * @pnode: where to keep a pnode * @cnode: where to keep a cnode * @in_tree: is the node in the tree in memory + * @ptr: union of node pointers * @ptr.nnode: pointer to the nnode (if it is an nnode) which may be here or in * the tree * @ptr.pnode: ditto for pnode diff --git a/ubifs-utils/libubifs/lpt_commit.c b/ubifs-utils/libubifs/lpt_commit.c index ee84f80..79f7b14 100644 --- a/ubifs-utils/libubifs/lpt_commit.c +++ b/ubifs-utils/libubifs/lpt_commit.c @@ -580,7 +580,7 @@ struct ubifs_pnode *ubifs_find_next_pnode(struct ubifs_info *c, /* Go right */ nnode = ubifs_get_nnode(c, nnode, iip); if (IS_ERR(nnode)) - return (void *)nnode; + return ERR_CAST(nnode); /* Go down to level 1 */ while (nnode->level > 1) { @@ -597,7 +597,7 @@ struct ubifs_pnode *ubifs_find_next_pnode(struct ubifs_info *c, } nnode = ubifs_get_nnode(c, nnode, iip); if (IS_ERR(nnode)) - return (void *)nnode; + return ERR_CAST(nnode); } for (iip = 0; iip < UBIFS_LPT_FANOUT; iip++) diff --git a/ubifs-utils/libubifs/replay.c b/ubifs-utils/libubifs/replay.c index 3943b32..9d61133 100644 --- a/ubifs-utils/libubifs/replay.c +++ b/ubifs-utils/libubifs/replay.c @@ -34,6 +34,7 @@ * @lnum: logical eraseblock number of the node * @offs: node offset * @len: node length + * @hash: node hash * @deletion: non-zero if this entry corresponds to a node deletion * @sqnum: node sequence number * @list: links the replay list diff --git a/ubifs-utils/libubifs/tnc_commit.c b/ubifs-utils/libubifs/tnc_commit.c index d797006..66922d4 100644 --- a/ubifs-utils/libubifs/tnc_commit.c +++ b/ubifs-utils/libubifs/tnc_commit.c @@ -663,6 +663,8 @@ static int get_znodes_to_commit(struct ubifs_info *c) znode->alt = 0; cnext = find_next_dirty(znode); if (!cnext) { + ubifs_assert(c, !znode->parent); + znode->cparent = NULL; znode->cnext = c->cnext; break; } diff --git a/ubifs-utils/libubifs/ubifs.h b/ubifs-utils/libubifs/ubifs.h index 0908a22..1c7bc7b 100644 --- a/ubifs-utils/libubifs/ubifs.h +++ b/ubifs-utils/libubifs/ubifs.h @@ -11,6 +11,7 @@ #ifndef __UBIFS_H__ #define __UBIFS_H__ +#include <fcntl.h> #include <string.h> #include "linux_types.h" |