Hello community, here is the log from the commit of package erofs-utils for openSUSE:Factory checked in at 2019-09-09 12:36:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/erofs-utils (Old) and /work/SRC/openSUSE:Factory/.erofs-utils.new.7948 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "erofs-utils" Mon Sep 9 12:36:13 2019 rev:4 rq:729248 version:0.1+20190826 Changes: -------- --- /work/SRC/openSUSE:Factory/erofs-utils/erofs-utils.changes 2019-08-30 14:42:04.809416795 +0200 +++ /work/SRC/openSUSE:Factory/.erofs-utils.new.7948/erofs-utils.changes 2019-09-09 12:36:24.201462323 +0200 @@ -1,0 +2,9 @@ +Sun Sep 8 14:26:05 UTC 2019 - Jan Engelhardt <jeng...@inai.de> + +- Update to release 20190826 + * fix up "-E legacy-compress" + * fix a memory leak of compressmeta + * fail the image creation when source path is not a directory file +- Add long.patch + +------------------------------------------------------------------- Old: ---- erofs-utils-0.1+20190803.tar.xz New: ---- erofs-utils-0.1+20190826.tar.xz long.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ erofs-utils.spec ++++++ --- /var/tmp/diff_new_pack.oLcKNR/_old 2019-09-09 12:36:25.505462109 +0200 +++ /var/tmp/diff_new_pack.oLcKNR/_new 2019-09-09 12:36:25.509462109 +0200 @@ -17,7 +17,7 @@ Name: erofs-utils -Version: 0.1+20190803 +Version: 0.1+20190826 Release: 0 Summary: Utilities for the Extendable Read-Only Filesystem (EROFS) License: GPL-2.0-or-later @@ -25,6 +25,7 @@ URL: https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/ Source: %name-%version.tar.xz +Patch1: long.patch BuildRequires: autoconf >= 2.69 BuildRequires: automake BuildRequires: libtool ++++++ _service ++++++ --- /var/tmp/diff_new_pack.oLcKNR/_old 2019-09-09 12:36:25.541462103 +0200 +++ /var/tmp/diff_new_pack.oLcKNR/_new 2019-09-09 12:36:25.545462103 +0200 @@ -2,9 +2,9 @@ <service mode="disabled" name="tar_scm"> <param name="url">https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/</param> <param name="scm">git</param> - <param name="revision">erofs-utils_20190803</param> + <param name="revision">erofs-utils_20190826</param> <param name="parent-tag">589ab3accd0908f4664c839c6a3a320fa56346ec</param> - <param name="versionformat">0.1+20190803</param> + <param name="versionformat">0.1+20190826</param> </service> <service mode="disabled" name="recompress"> <param name="file">*.tar</param> ++++++ erofs-utils-0.1+20190803.tar.xz -> erofs-utils-0.1+20190826.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/erofs-utils-0.1+20190803/configure.ac new/erofs-utils-0.1+20190826/configure.ac --- old/erofs-utils-0.1+20190803/configure.ac 2019-08-03 05:27:42.000000000 +0200 +++ new/erofs-utils-0.1+20190826/configure.ac 2019-08-26 17:57:41.000000000 +0200 @@ -73,12 +73,14 @@ fcntl.h inttypes.h linux/falloc.h + linux/fs.h linux/types.h limits.h stddef.h stdint.h stdlib.h string.h + sys/ioctl.h sys/stat.h sys/time.h unistd.h diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/erofs-utils-0.1+20190803/include/erofs/print.h new/erofs-utils-0.1+20190826/include/erofs/print.h --- old/erofs-utils-0.1+20190803/include/erofs/print.h 2019-08-03 05:27:42.000000000 +0200 +++ new/erofs-utils-0.1+20190826/include/erofs/print.h 2019-08-26 17:57:41.000000000 +0200 @@ -12,6 +12,15 @@ #include "config.h" #include <stdio.h> +enum { + EROFS_MSG_MIN = 0, + EROFS_ERR = 0, + EROFS_WARN = 2, + EROFS_INFO = 3, + EROFS_DBG = 7, + EROFS_MSG_MAX = 9 +}; + #define FUNC_LINE_FMT "%s() Line[%d] " #ifndef pr_fmt @@ -19,7 +28,7 @@ #endif #define erofs_dbg(fmt, ...) do { \ - if (cfg.c_dbg_lvl >= 7) { \ + if (cfg.c_dbg_lvl >= EROFS_DBG) { \ fprintf(stdout, \ pr_fmt(fmt), \ __func__, \ @@ -29,7 +38,7 @@ } while (0) #define erofs_info(fmt, ...) do { \ - if (cfg.c_dbg_lvl >= 3) { \ + if (cfg.c_dbg_lvl >= EROFS_INFO) { \ fprintf(stdout, \ pr_fmt(fmt), \ __func__, \ @@ -40,7 +49,7 @@ } while (0) #define erofs_warn(fmt, ...) do { \ - if (cfg.c_dbg_lvl >= 2) { \ + if (cfg.c_dbg_lvl >= EROFS_WARN) { \ fprintf(stdout, \ pr_fmt(fmt), \ __func__, \ @@ -51,7 +60,7 @@ } while (0) #define erofs_err(fmt, ...) do { \ - if (cfg.c_dbg_lvl >= 0) { \ + if (cfg.c_dbg_lvl >= EROFS_ERR) { \ fprintf(stderr, \ "Err: " pr_fmt(fmt), \ __func__, \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/erofs-utils-0.1+20190803/lib/inode.c new/erofs-utils-0.1+20190826/lib/inode.c --- old/erofs-utils-0.1+20190803/lib/inode.c 2019-08-03 05:27:42.000000000 +0200 +++ new/erofs-utils-0.1+20190826/lib/inode.c 2019-08-26 17:57:41.000000000 +0200 @@ -404,6 +404,7 @@ ret = dev_write(inode->compressmeta, off, inode->extent_isize); if (ret) return false; + free(inode->compressmeta); } inode->bh = NULL; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/erofs-utils-0.1+20190803/lib/io.c new/erofs-utils-0.1+20190826/lib/io.c --- old/erofs-utils-0.1+20190803/lib/io.c 2019-08-03 05:27:42.000000000 +0200 +++ new/erofs-utils-0.1+20190826/lib/io.c 2019-08-26 17:57:41.000000000 +0200 @@ -9,7 +9,11 @@ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include <sys/stat.h> +#include <sys/ioctl.h> #include "erofs/io.h" +#ifdef HAVE_LINUX_FS_H +#include <linux/fs.h> +#endif #ifdef HAVE_LINUX_FALLOC_H #include <linux/falloc.h> #endif @@ -21,6 +25,26 @@ static int erofs_devfd = -1; static u64 erofs_devsz; +int dev_get_blkdev_size(int fd, u64 *bytes) +{ + errno = ENOTSUP; +#ifdef BLKGETSIZE64 + if (ioctl(fd, BLKGETSIZE64, bytes) >= 0) + return 0; +#endif + +#ifdef BLKGETSIZE + { + unsigned long size; + if (ioctl(fd, BLKGETSIZE, &size) >= 0) { + *bytes = ((u64)size << 9); + return 0; + } + } +#endif + return -errno; +} + void dev_close(void) { close(erofs_devfd); @@ -49,7 +73,12 @@ switch (st.st_mode & S_IFMT) { case S_IFBLK: - erofs_devsz = st.st_size; + ret = dev_get_blkdev_size(fd, &erofs_devsz); + if (ret) { + erofs_err("failed to get block device size(%s).", dev); + close(fd); + return ret; + } break; case S_IFREG: ret = ftruncate(fd, 0); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/erofs-utils-0.1+20190803/mkfs/main.c new/erofs-utils-0.1+20190826/mkfs/main.c --- old/erofs-utils-0.1+20190803/mkfs/main.c 2019-08-03 05:27:42.000000000 +0200 +++ new/erofs-utils-0.1+20190826/mkfs/main.c 2019-08-26 17:57:41.000000000 +0200 @@ -12,6 +12,7 @@ #include <stdlib.h> #include <limits.h> #include <libgen.h> +#include <sys/stat.h> #include "erofs/config.h" #include "erofs/print.h" #include "erofs/cache.h" @@ -30,20 +31,10 @@ fprintf(stderr, " -EX[,...] X=extended options\n"); } -u64 parse_num_from_str(const char *str) -{ - u64 num = 0; - char *endptr = NULL; - - num = strtoull(str, &endptr, 10); - BUG_ON(num == ULLONG_MAX); - return num; -} - static int parse_extended_opts(const char *opts) { #define MATCH_EXTENTED_OPT(opt, token, keylen) \ - (keylen == sizeof(opt) && !memcmp(token, opt, sizeof(opt))) + (keylen == sizeof(opt) - 1 && !memcmp(token, opt, sizeof(opt) - 1)) const char *token, *next, *tokenend, *value __maybe_unused; unsigned int keylen, vallen; @@ -108,7 +99,12 @@ break; case 'd': - cfg.c_dbg_lvl = parse_num_from_str(optarg); + i = atoi(optarg); + if (i < EROFS_MSG_MIN || i > EROFS_MSG_MAX) { + erofs_err("invalid debug level %d", i); + return -EINVAL; + } + cfg.c_dbg_lvl = i; break; case 'E': @@ -192,6 +188,7 @@ struct erofs_buffer_head *sb_bh; struct erofs_inode *root_inode; erofs_nid_t root_nid; + struct stat64 st; erofs_init_configure(); fprintf(stderr, "%s %s\n", basename(argv[0]), cfg.c_version); @@ -203,6 +200,16 @@ return 1; } + err = lstat64(cfg.c_src_path, &st); + if (err) + return 1; + if ((st.st_mode & S_IFMT) != S_IFDIR) { + erofs_err("root of the filesystem is not a directory - %s", + cfg.c_src_path); + usage(); + return 1; + } + err = dev_open(cfg.c_img_path); if (err) { usage(); ++++++ long.patch ++++++ >From 5c314e288719b59fb8bad90fd1a75b8076baceee Mon Sep 17 00:00:00 2001 From: Jan Engelhardt <jeng...@inai.de> Date: Sun, 8 Sep 2019 16:52:56 +0200 Subject: [PATCH] build: cure compiler warnings On i586 I observe: In file included from inode.c:16: inode.c: In function 'erofs_mkfs_build_tree': ../include/erofs/print.h:27:21: error: format '%lu' expects argument of type 'long unsigned int', but argument 7 has type 'erofs_nid_t' {aka 'long long unsigned int'} [-Werror=format=] 27 | #define pr_fmt(fmt) "EROFS: " FUNC_LINE_FMT fmt "\n" ../include/erofs/print.h:43:4: note: in expansion of macro 'pr_fmt' 43 | pr_fmt(fmt), \ inode.c:792:3: note: in expansion of macro 'erofs_info' 792 | erofs_info("add file %s/%s (nid %lu, type %d)", inode.c:792:37: note: format string is defined here 792 | erofs_info("add file %s/%s (nid %lu, type %d)", --- lib/compress.c | 4 ++-- lib/inode.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/compress.c b/lib/compress.c index a977c87..cadf598 100644 --- a/lib/compress.c +++ b/lib/compress.c @@ -457,8 +457,8 @@ int erofs_write_compressed_file(struct erofs_inode *inode) ret = erofs_bh_balloon(bh, blknr_to_addr(compressed_blocks)); DBG_BUGON(ret); - erofs_info("compressed %s (%lu bytes) into %u blocks", - inode->i_srcpath, inode->i_size, compressed_blocks); + erofs_info("compressed %s (%llu bytes) into %u blocks", + inode->i_srcpath, (unsigned long long)inode->i_size, compressed_blocks); /* * TODO: need to move erofs_bdrop to erofs_write_tail_end diff --git a/lib/inode.c b/lib/inode.c index 141a300..db9ad99 100644 --- a/lib/inode.c +++ b/lib/inode.c @@ -789,8 +789,8 @@ fail: d->type = erofs_type_by_mode[d->inode->i_mode >> S_SHIFT]; erofs_d_invalidate(d); - erofs_info("add file %s/%s (nid %lu, type %d)", - dir->i_srcpath, d->name, d->nid, d->type); + erofs_info("add file %s/%s (nid %llu, type %d)", + dir->i_srcpath, d->name, (unsigned long long)d->nid, d->type); } erofs_write_dir_file(dir); erofs_write_tail_end(dir); -- 2.23.0