Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package duperemove for openSUSE:Factory checked in at 2022-02-03 23:55:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/duperemove (Old) and /work/SRC/openSUSE:Factory/.duperemove.new.1898 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "duperemove" Thu Feb 3 23:55:15 2022 rev:27 rq:951385 version:0.11.3 Changes: -------- --- /work/SRC/openSUSE:Factory/duperemove/duperemove.changes 2020-11-05 21:56:26.515978860 +0100 +++ /work/SRC/openSUSE:Factory/.duperemove.new.1898/duperemove.changes 2022-02-03 23:55:16.335944797 +0100 @@ -1,0 +2,13 @@ +Thu Feb 3 16:48:27 UTC 2022 - Michael Vetter <mvet...@suse.com> + +- Update to 0.11.3: + * Increase open file limit. (#269) + * Create hash database file with 600 permission for improved + security. (#262) + * Read more data per pread, for v2 hashfile format this reduces + the overall number of syscalls made which in turns results + in better performance. + * Fix truncated file handling, eliminating a an infinite + loop case. (#255) + +------------------------------------------------------------------- Old: ---- duperemove-0.11.2.tar.gz New: ---- duperemove-0.11.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ duperemove.spec ++++++ --- /var/tmp/diff_new_pack.sxRn8v/_old 2022-02-03 23:55:17.015939945 +0100 +++ /var/tmp/diff_new_pack.sxRn8v/_new 2022-02-03 23:55:17.019939917 +0100 @@ -1,7 +1,7 @@ # # spec file for package duperemove # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %define samename btrfs-extent-same Name: duperemove -Version: 0.11.2 +Version: 0.11.3 Release: 0 Summary: Software to find duplicate extents in files and remove them License: GPL-2.0-only ++++++ duperemove-0.11.2.tar.gz -> duperemove-0.11.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/duperemove-0.11.2/Makefile new/duperemove-0.11.3/Makefile --- old/duperemove-0.11.2/Makefile 2020-10-12 15:00:17.000000000 +0200 +++ new/duperemove-0.11.3/Makefile 2021-08-09 17:36:02.000000000 +0200 @@ -1,4 +1,4 @@ -VER=0.12.dev +VER=0.11.3 RELEASE=v$(VER) CC ?= gcc @@ -56,6 +56,7 @@ override CFLAGS += -D_FILE_OFFSET_BITS=64 -DVERSTRING=\"$(RELEASE)\" \ $(hash_CFLAGS) $(glib_CFLAGS) $(sqlite_CFLAGS) -rdynamic $(DEBUG_FLAGS) +LIBRARY_FLAGS += -Wl,--as-needed -latomic -lm LIBRARY_FLAGS += $(hash_LIBS) $(glib_LIBS) $(sqlite_LIBS) # make C=1 to enable sparse diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/duperemove-0.11.2/dbfile.c new/duperemove-0.11.3/dbfile.c --- old/duperemove-0.11.2/dbfile.c 2020-10-12 15:00:17.000000000 +0200 +++ new/duperemove-0.11.3/dbfile.c 2021-08-09 17:36:02.000000000 +0200 @@ -8,6 +8,7 @@ #include <inttypes.h> #include <stddef.h> #include <sys/types.h> +#include <sys/stat.h> #include <sys/sysmacros.h> #include <sys/syscall.h> @@ -224,6 +225,15 @@ dbfile_config_defaults(cfg); cfg->major = requested_version; cfg->minor = requested_version == DB_FILE_MAJOR ? DB_FILE_MINOR : 0; + if (!inmem) { + ret = chmod(filename, S_IRUSR|S_IWUSR); + if (ret) { + perror("setting db file permissions"); + sqlite3_close(db); + return ret; + } + + } } else { /* Get only version numbers initially */ ret = __dbfile_get_config(db, NULL, NULL, NULL, NULL, NULL, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/duperemove-0.11.2/duperemove.c new/duperemove-0.11.3/duperemove.c --- old/duperemove-0.11.2/duperemove.c 2020-10-12 15:00:17.000000000 +0200 +++ new/duperemove-0.11.3/duperemove.c 2021-08-09 17:36:02.000000000 +0200 @@ -595,6 +595,7 @@ { vprintf("Using %uK blocks\n", blocksize / 1024); vprintf("Using hash: %s\n", csum_mod->name); + vprintf("Using %s hashing\n", v2_hashfile ? "block-based" : "extent-based"); #ifdef DEBUG_BUILD printf("Debug build, performance may be impacted.\n"); #endif @@ -726,6 +727,14 @@ return (version_only || help_option) ? 0 : EINVAL; } + /* Allow larger than unusal amount of open files. On linux + * this should bw increase form 1K to 512K open files + * simultaneously. + * + * On multicore SSD machines it's not hard to get to 1K open + * files. + */ + increase_limits(); /* * Don't run detection if the user has supplied our cpu counts * already. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/duperemove-0.11.2/file_scan.c new/duperemove-0.11.3/file_scan.c --- old/duperemove-0.11.2/file_scan.c 2020-10-12 15:00:17.000000000 +0200 +++ new/duperemove-0.11.3/file_scan.c 2021-08-09 17:36:02.000000000 +0200 @@ -20,6 +20,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <sys/ioctl.h> +#include <sys/param.h> #include <limits.h> #include <fcntl.h> #include <assert.h> @@ -782,10 +783,7 @@ if ((skip_zeroes && *flags & FIEMAP_EXTENT_UNWRITTEN) || (*flags & FIEMAP_SKIP_FLAGS)) { - /* - * Unritten or other extent we don't - * want to read - */ + /* Unritten or other extent we don't want to read */ return 1; } return 0; @@ -796,9 +794,11 @@ { int ret; uint64_t loff, poff, fieloff, bytes_read; - unsigned int fieflags, fielen; + unsigned int fieflags, fielen, read_size = blocksize; struct filerec *file = ctxt->file; struct block_csum *block_hashes; + uint64_t size = file->size; + block_hashes = malloc(sizeof(struct block_csum)); if (block_hashes == NULL) @@ -807,22 +807,30 @@ ctxt->block_hashes = block_hashes; loff = fieloff = fielen = 0; fieflags = 0; - while (loff < file->size) { + while (loff < size) { if (fc && loff >= (fieloff + fielen)) { ret = fiemap_helper(fc, file, &poff, &fieloff, &fielen, &fieflags); if (ret < 0) return ret; + /* + * Cap loop to the size of the last _real_ extent. + * Applies to truncated files + */ + if (fieflags & FIEMAP_EXTENT_LAST) + size = fieloff + fielen; + if (ret == 1) { loff = fieloff + fielen; continue; } loff = fieloff; - continue; + } // printf("loff %"PRIu64"\n", loff); - ret = csum_extent(ctxt, loff, blocksize, fieflags, &bytes_read); + read_size = MAX(fielen, blocksize); + ret = csum_extent(ctxt, loff, read_size, fieflags, &bytes_read); if (ret == 0) /* EOF */ break; @@ -838,7 +846,7 @@ */ return -1; } - loff += blocksize; + loff += bytes_read; if (bytes_read < blocksize) { /* Partial read, don't get any more blocks */ break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/duperemove-0.11.2/util.c new/duperemove-0.11.3/util.c --- old/duperemove-0.11.2/util.c 2020-10-12 15:00:17.000000000 +0200 +++ new/duperemove-0.11.3/util.c 2021-08-09 17:36:02.000000000 +0200 @@ -27,6 +27,7 @@ #ifdef __GLIBC__ #include <execinfo.h> #endif +#include <sys/resource.h> #include <sys/time.h> #include <sys/types.h> #include <regex.h> @@ -309,3 +310,25 @@ *nr_log, *nr_phys, ht ? "is on" : ret < 0 ? "detection broken" : "is off"); } + +int increase_limits(void) { + struct rlimit cur_r; + struct rlimit new_r; + int ret; + + ret = getrlimit(RLIMIT_NOFILE, &cur_r); + if (ret < 0) + return -errno; + + new_r.rlim_cur = cur_r.rlim_max; + new_r.rlim_max = cur_r.rlim_max; + ret = setrlimit(RLIMIT_NOFILE, &new_r); + + if (ret < 0) + return -errno; + + vprintf("Increased open file limit from %llu to %llu.\n", + (unsigned long long)cur_r.rlim_cur, + (unsigned long long)new_r.rlim_cur); + return 0; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/duperemove-0.11.2/util.h new/duperemove-0.11.3/util.h --- old/duperemove-0.11.2/util.h 2020-10-12 15:00:17.000000000 +0200 +++ new/duperemove-0.11.3/util.h 2021-08-09 17:36:02.000000000 +0200 @@ -53,4 +53,7 @@ void get_num_cpus(unsigned int *nr_phys, unsigned int *nr_log); +/* Bump up maximum open file limit. */ +int increase_limits(void); + #endif /* __UTIL_H__ */