Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package tgt for openSUSE:Factory checked in 
at 2024-09-02 13:13:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/tgt (Old)
 and      /work/SRC/openSUSE:Factory/.tgt.new.2698 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "tgt"

Mon Sep  2 13:13:39 2024 rev:44 rq:1198020 version:1.0.92

Changes:
--------
--- /work/SRC/openSUSE:Factory/tgt/tgt.changes  2024-03-02 23:24:04.520693901 
+0100
+++ /work/SRC/openSUSE:Factory/.tgt.new.2698/tgt.changes        2024-09-02 
13:13:40.820430851 +0200
@@ -1,0 +2,9 @@
+Wed Aug 28 14:30:59 UTC 2024 - Andrea Manzini <andrea.manz...@suse.com>
+
+- Update to version v1.0.92 (from 1.0.89):
+  * fix arm64 compilation
+  * do not rely on non-portable __WORDSIZE nor LFS64 interfaces
+  * Enabled thin-provision option for discarding ranges from block
+    devices, that supporting discard
+
+-------------------------------------------------------------------

Old:
----
  v1.0.89.tar.gz

New:
----
  v1.0.92.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ tgt.spec ++++++
--- /var/tmp/diff_new_pack.lcAn71/_old  2024-09-02 13:13:41.632464619 +0200
+++ /var/tmp/diff_new_pack.lcAn71/_new  2024-09-02 13:13:41.632464619 +0200
@@ -25,7 +25,7 @@
   %define make_build %{__make} %{?_smp_mflags}
 %endif
 Name:           tgt
-Version:        1.0.89
+Version:        1.0.92
 Release:        0
 Summary:        Generic Linux target framework (tgt)
 License:        GPL-2.0-only

++++++ harden_tgtd.service.patch ++++++
--- /var/tmp/diff_new_pack.lcAn71/_old  2024-09-02 13:13:41.656465617 +0200
+++ /var/tmp/diff_new_pack.lcAn71/_new  2024-09-02 13:13:41.660465784 +0200
@@ -1,7 +1,7 @@
-Index: tgt-1.0.74/scripts/tgtd.service
+Index: tgt-1.0.92/scripts/tgtd.service
 ===================================================================
---- tgt-1.0.74.orig/scripts/tgtd.service
-+++ tgt-1.0.74/scripts/tgtd.service
+--- tgt-1.0.92.orig/scripts/tgtd.service
++++ tgt-1.0.92/scripts/tgtd.service
 @@ -9,6 +9,15 @@ After=network.target
  ConditionPathExists=/etc/tgt/targets.conf
  

++++++ tgt-fix-build ++++++
--- /var/tmp/diff_new_pack.lcAn71/_old  2024-09-02 13:13:41.688466948 +0200
+++ /var/tmp/diff_new_pack.lcAn71/_new  2024-09-02 13:13:41.692467114 +0200
@@ -12,12 +12,12 @@
  usr/Makefile | 3 +++
  1 file changed, 3 insertions(+)
 
-diff --git a/usr/Makefile b/usr/Makefile
-index e29826c..31067e8 100644
---- a/usr/Makefile
-+++ b/usr/Makefile
-@@ -40,6 +40,9 @@ INCLUDES += -I.
- 
+Index: tgt-1.0.92/usr/Makefile
+===================================================================
+--- tgt-1.0.92.orig/usr/Makefile
++++ tgt-1.0.92/usr/Makefile
+@@ -41,6 +41,9 @@ INCLUDES += -I.
+ CFLAGS += -D_FILE_OFFSET_BITS=64
  CFLAGS += -D_GNU_SOURCE
  CFLAGS += $(INCLUDES)
 +ifneq ($(OPTFAGS),)

++++++ tgt-install-examples-in-documentation-dir.patch ++++++
--- /var/tmp/diff_new_pack.lcAn71/_old  2024-09-02 13:13:41.700467447 +0200
+++ /var/tmp/diff_new_pack.lcAn71/_new  2024-09-02 13:13:41.704467614 +0200
@@ -12,8 +12,10 @@
  conf/Makefile |    6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
 
---- a/conf/Makefile
-+++ b/conf/Makefile
+Index: tgt-1.0.92/conf/Makefile
+===================================================================
+--- tgt-1.0.92.orig/conf/Makefile
++++ tgt-1.0.92/conf/Makefile
 @@ -1,4 +1,5 @@
  sysconfdir ?= /etc
 +docdatadir ?= /usr/share/doc/packages/

++++++ tgt-systemd-service-update.patch ++++++
--- /var/tmp/diff_new_pack.lcAn71/_old  2024-09-02 13:13:41.716468113 +0200
+++ /var/tmp/diff_new_pack.lcAn71/_new  2024-09-02 13:13:41.720468279 +0200
@@ -5,10 +5,10 @@
 Update our systemd service file to match what we do at SUSE.
 
 ---
-Index: tgt-1.0.85/scripts/tgtd.service
+Index: tgt-1.0.92/scripts/tgtd.service
 ===================================================================
---- tgt-1.0.85.orig/scripts/tgtd.service
-+++ tgt-1.0.85/scripts/tgtd.service
+--- tgt-1.0.92.orig/scripts/tgtd.service
++++ tgt-1.0.92/scripts/tgtd.service
 @@ -20,8 +20,9 @@ RestrictRealtime=true
  # end of automatic additions 
  Type=forking

++++++ v1.0.89.tar.gz -> v1.0.92.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tgt-1.0.89/.github/workflows/ci.yml 
new/tgt-1.0.92/.github/workflows/ci.yml
--- old/tgt-1.0.89/.github/workflows/ci.yml     2023-11-01 00:30:17.000000000 
+0100
+++ new/tgt-1.0.92/.github/workflows/ci.yml     2024-06-04 04:16:32.000000000 
+0200
@@ -3,8 +3,8 @@
 on: [pull_request]
 
 jobs:
-  build:
-    name: build
+  build_ubuntu:
+    name: build on Ubuntu
     runs-on: ubuntu-22.04
     steps:
       - name: checking out
@@ -14,4 +14,19 @@
       - name: build
         working-directory: tgt
         run: |
+          make
+  build_alpine:
+    name: build on Alpine Linux
+    runs-on: ubuntu-22.04
+    steps:
+      - name: checking out
+        uses: actions/checkout@v3
+        with:
+          path: tgt
+      - name: Setup Alpine Linux
+        uses: jirutka/setup-alpine@v1
+
+      - name: build
+        working-directory: tgt
+        run: |
           make
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tgt-1.0.89/Makefile new/tgt-1.0.92/Makefile
--- old/tgt-1.0.89/Makefile     2023-11-01 00:30:17.000000000 +0100
+++ new/tgt-1.0.92/Makefile     2024-06-04 04:16:32.000000000 +0200
@@ -1,4 +1,4 @@
-VERSION ?= 1.0.89
+VERSION ?= 1.0.92
 
 CHECK_CC = cgcc
 CHECK_CC_FLAGS = '$(CHECK_CC) -Wbitwise -Wno-return-void -no-compile $(ARCH)'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tgt-1.0.89/doc/tgtadm.8.xml 
new/tgt-1.0.92/doc/tgtadm.8.xml
--- old/tgt-1.0.89/doc/tgtadm.8.xml     2023-11-01 00:30:17.000000000 +0100
+++ new/tgt-1.0.92/doc/tgtadm.8.xml     2024-06-04 04:16:32.000000000 +0200
@@ -418,9 +418,14 @@
            This parameter only applies to DISK devices.
           </para>
           <para>
-           Thin-provisioning only works for LUNs stored on filesystems
+           Thin-provisioning works for LUNs stored on filesystems
            that support FALLOC_FL_PUNCH_HOLE.
           </para>
+         <para>
+           When using thin-provisioning option with a block device such a
+           SSD or ZVOL, UNMAP SCSI command discards the region from
+           the block device.
+         </para>
         </listitem>
       </varlistentry>
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tgt-1.0.89/usr/Makefile new/tgt-1.0.92/usr/Makefile
--- old/tgt-1.0.89/usr/Makefile 2023-11-01 00:30:17.000000000 +0100
+++ new/tgt-1.0.92/usr/Makefile 2024-06-04 04:16:32.000000000 +0200
@@ -38,6 +38,7 @@
 
 INCLUDES += -I.
 
+CFLAGS += -D_FILE_OFFSET_BITS=64
 CFLAGS += -D_GNU_SOURCE
 CFLAGS += $(INCLUDES)
 ifneq ($(DEBUG),)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tgt-1.0.89/usr/bs.c new/tgt-1.0.92/usr/bs.c
--- old/tgt-1.0.89/usr/bs.c     2023-11-01 00:30:17.000000000 +0100
+++ new/tgt-1.0.92/usr/bs.c     2024-06-04 04:16:32.000000000 +0200
@@ -311,7 +311,7 @@
        sigaddset(&mask, SIGUSR2);
        sigprocmask(SIG_BLOCK, &mask, NULL);
 
-       sig_fd = __signalfd(-1, &mask, 0);
+       sig_fd = signalfd(-1, &mask, O_NONBLOCK);
        if (sig_fd < 0)
                return 1;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tgt-1.0.89/usr/bs_rdwr.c new/tgt-1.0.92/usr/bs_rdwr.c
--- old/tgt-1.0.89/usr/bs_rdwr.c        2023-11-01 00:30:17.000000000 +0100
+++ new/tgt-1.0.92/usr/bs_rdwr.c        2024-06-04 04:16:32.000000000 +0200
@@ -78,7 +78,7 @@
                        break;
                }
 
-               ret = pread64(fd, tmpbuf, length, offset);
+               ret = pread(fd, tmpbuf, length, offset);
 
                if (ret != length) {
                        set_medium_error(cmd);
@@ -113,7 +113,7 @@
                        break;
                }
 
-               ret = pread64(fd, tmpbuf, length, offset);
+               ret = pread(fd, tmpbuf, length, offset);
 
                if (ret != length) {
                        set_medium_error(cmd);
@@ -175,7 +175,7 @@
                length = scsi_get_out_length(cmd);
                write_buf = scsi_get_out_buffer(cmd);
 write:
-               ret = pwrite64(fd, write_buf, length,
+               ret = pwrite(fd, write_buf, length,
                               offset);
                if (ret == length) {
                        struct mode_pg *pg;
@@ -233,7 +233,7 @@
                                break;
                        }
 
-                       ret = pwrite64(fd, tmpbuf, blocksize, offset);
+                       ret = pwrite(fd, tmpbuf, blocksize, offset);
                        if (ret != blocksize)
                                set_medium_error(cmd);
 
@@ -246,7 +246,7 @@
        case READ_12:
        case READ_16:
                length = scsi_get_in_length(cmd);
-               ret = pread64(fd, scsi_get_in_buffer(cmd), length,
+               ret = pread(fd, scsi_get_in_buffer(cmd), length,
                              offset);
 
                if (ret != length)
@@ -278,7 +278,7 @@
                        break;
                }
 
-               ret = pread64(fd, tmpbuf, length, offset);
+               ret = pread(fd, tmpbuf, length, offset);
 
                if (ret != length)
                        set_medium_error(cmd);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tgt-1.0.89/usr/bs_ssc.c new/tgt-1.0.92/usr/bs_ssc.c
--- old/tgt-1.0.89/usr/bs_ssc.c 2023-11-01 00:30:17.000000000 +0100
+++ new/tgt-1.0.92/usr/bs_ssc.c 2024-06-04 04:16:32.000000000 +0200
@@ -179,7 +179,7 @@
 
        /* Write any data */
        if (size) {
-               ret = pwrite64(fd, data, size,
+               ret = pwrite(fd, data, size,
                               curr->curr + SSC_BLK_HDR_SIZE);
                if (ret != size) {
                        eprintf("Write of data failed: %m\n");
@@ -349,7 +349,7 @@
                }
        }
 
-       ret = pread64(cmd->dev->fd, buf, length, h->curr + SSC_BLK_HDR_SIZE);
+       ret = pread(cmd->dev->fd, buf, length, h->curr + SSC_BLK_HDR_SIZE);
        if (ret != length) {
                sense_data_build(cmd, MEDIUM_ERROR, ASC_READ_ERROR);
                result = SAM_STAT_CHECK_CONDITION;
@@ -404,7 +404,7 @@
                        goto out;
                }
 
-               residue = pread64(fd, buf, block_length,
+               residue = pread(fd, buf, block_length,
                                  h->curr + SSC_BLK_HDR_SIZE);
                if (block_length != residue) {
                        eprintf("Could only read %d bytes, not %d\n",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tgt-1.0.89/usr/libssc.c new/tgt-1.0.92/usr/libssc.c
--- old/tgt-1.0.89/usr/libssc.c 2023-11-01 00:30:17.000000000 +0100
+++ new/tgt-1.0.92/usr/libssc.c 2024-06-04 04:16:32.000000000 +0200
@@ -57,7 +57,7 @@
        if (ret != sizeof(struct MAM))
                return 1;
 
-       if (lseek64(fd, SSC_1ST_HDR_OFFSET, SEEK_SET) != SSC_1ST_HDR_OFFSET)
+       if (lseek(fd, SSC_1ST_HDR_OFFSET, SEEK_SET) != SSC_1ST_HDR_OFFSET)
                return 1;
 
        SSC_GET_MAM_INFO_VAL(tape_fmt_version, 32);
@@ -176,7 +176,7 @@
        if (ret != sizeof(struct MAM))
                return 1;
 
-       if (lseek64(fd, SSC_1ST_HDR_OFFSET, SEEK_SET) != SSC_1ST_HDR_OFFSET)
+       if (lseek(fd, SSC_1ST_HDR_OFFSET, SEEK_SET) != SSC_1ST_HDR_OFFSET)
                return 1;
 
        return  0;
@@ -188,7 +188,7 @@
        struct blk_header h, *m = &h;
        uint32_t crc = ~0;
 
-       count = pread64(fd, m, SSC_BLK_HDR_SIZE, offset);
+       count = pread(fd, m, SSC_BLK_HDR_SIZE, offset);
        if (count != SSC_BLK_HDR_SIZE)
                return 1;
 
@@ -225,7 +225,7 @@
        crc = crc32c(crc, &m->ondisk_sz, SSC_BLK_HDR_SIZE - sizeof(m->h_csum));
        *(uint32_t *)m->h_csum = ~crc;
 
-       count = pwrite64(fd, m, SSC_BLK_HDR_SIZE, offset);
+       count = pwrite(fd, m, SSC_BLK_HDR_SIZE, offset);
        if (count != SSC_BLK_HDR_SIZE)
                return 1;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tgt-1.0.89/usr/sbc.c new/tgt-1.0.92/usr/sbc.c
--- old/tgt-1.0.89/usr/sbc.c    2023-11-01 00:30:17.000000000 +0100
+++ new/tgt-1.0.92/usr/sbc.c    2024-06-04 04:16:32.000000000 +0200
@@ -23,7 +23,6 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA
  */
-#define _FILE_OFFSET_BITS 64
 #define __USE_GNU
 
 #include <errno.h>
@@ -52,7 +51,7 @@
 static off_t find_next_data(struct scsi_lu *dev, off_t offset)
 {
 #ifdef SEEK_DATA
-       return lseek64(dev->fd, offset, SEEK_DATA);
+       return lseek(dev->fd, offset, SEEK_DATA);
 #else
        return offset;
 #endif
@@ -60,7 +59,7 @@
 static off_t find_next_hole(struct scsi_lu *dev, off_t offset)
 {
 #ifdef SEEK_HOLE
-       return lseek64(dev->fd, offset, SEEK_HOLE);
+       return lseek(dev->fd, offset, SEEK_HOLE);
 #else
        return dev->size;
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tgt-1.0.89/usr/tgtd.h new/tgt-1.0.92/usr/tgtd.h
--- old/tgt-1.0.89/usr/tgtd.h   2023-11-01 00:30:17.000000000 +0100
+++ new/tgt-1.0.92/usr/tgtd.h   2024-06-04 04:16:32.000000000 +0200
@@ -1,6 +1,8 @@
 #ifndef __TARGET_DAEMON_H
 #define __TARGET_DAEMON_H
 
+#include <limits.h>
+
 #include "log.h"
 #include "scsi_cmnd.h"
 #include "tgtadm_error.h"
@@ -173,7 +175,7 @@
        void (*bs_exit)(struct scsi_lu *dev);
        int (*bs_cmd_submit)(struct scsi_cmd *cmd);
        int bs_oflags_supported;
-       unsigned long bs_supported_ops[NR_SCSI_OPCODES / __WORDSIZE];
+       unsigned long bs_supported_ops[NR_SCSI_OPCODES / LONG_BIT];
 
        struct list_head backingstore_siblings;
 };
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tgt-1.0.89/usr/tgtimg.c new/tgt-1.0.92/usr/tgtimg.c
--- old/tgt-1.0.89/usr/tgtimg.c 2023-11-01 00:30:17.000000000 +0100
+++ new/tgt-1.0.92/usr/tgtimg.c 2024-06-04 04:16:32.000000000 +0200
@@ -327,7 +327,7 @@
        h->blk_type = BLK_EOD;
        h->blk_num = 1;
        h->prev = 0;
-       h->next = lseek64(fd, 0, SEEK_CUR);
+       h->next = lseek(fd, 0, SEEK_CUR);
        h->curr = h->next;
 
        ret = ssc_write_blkhdr(fd, h, h->next);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tgt-1.0.89/usr/util.c new/tgt-1.0.92/usr/util.c
--- old/tgt-1.0.89/usr/util.c   2023-11-01 00:30:17.000000000 +0100
+++ new/tgt-1.0.92/usr/util.c   2024-06-04 04:16:32.000000000 +0200
@@ -85,7 +85,7 @@
 int backed_file_open(char *path, int oflag, uint64_t *size, uint32_t *blksize)
 {
        int fd, err;
-       struct stat64 st;
+       struct stat st;
 
        fd = open(path, oflag);
        if (fd < 0) {
@@ -93,7 +93,7 @@
                return fd;
        }
 
-       err = fstat64(fd, &st);
+       err = fstat(fd, &st);
        if (err < 0) {
                eprintf("Cannot get stat %d, %m\n", fd);
                goto close_fd;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tgt-1.0.89/usr/util.h new/tgt-1.0.92/usr/util.h
--- old/tgt-1.0.89/usr/util.h   2023-11-01 00:30:17.000000000 +0100
+++ new/tgt-1.0.92/usr/util.h   2024-06-04 04:16:32.000000000 +0200
@@ -14,7 +14,12 @@
 #include <stdlib.h>
 #include <string.h>
 #include <limits.h>
+#include <linux/fs.h>
 #include <linux/types.h>
+#include <sys/ioctl.h>
+#include <sys/signalfd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 
 #include "be_byteshift.h"
 
@@ -99,44 +104,6 @@
 
 extern unsigned long pagesize, pageshift;
 
-#if defined(__NR_signalfd) && defined(USE_SIGNALFD)
-
-/*
- * workaround for broken linux/signalfd.h including
- * usr/include/linux/fcntl.h
- */
-#define _LINUX_FCNTL_H
-
-#include <linux/signalfd.h>
-
-static inline int __signalfd(int fd, const sigset_t *mask, int flags)
-{
-       int fd2, ret;
-
-       fd2 = syscall(__NR_signalfd, fd, mask, _NSIG / 8);
-       if (fd2 < 0)
-               return fd2;
-
-       ret = fcntl(fd2, F_GETFL);
-       if (ret < 0) {
-               close(fd2);
-               return -1;
-       }
-
-       ret = fcntl(fd2, F_SETFL, ret | O_NONBLOCK);
-       if (ret < 0) {
-               close(fd2);
-               return -1;
-       }
-
-       return fd2;
-}
-#else
-#define __signalfd(fd, mask, flags) (-1)
-struct signalfd_siginfo {
-};
-#endif
-
 /* convert string to integer, check for validity of the string numeric format
  * and the natural boundaries of the integer value type (first get a 64-bit
  * value and check that it fits the range of the destination integer).
@@ -208,19 +175,31 @@
 
 
 /* If we have recent enough glibc to support PUNCH HOLE we try to unmap
- * the region.
+ * the region of file.
+ * If supported BLKDISCARD, try to unmap the region of block device.
  */
 static inline int unmap_file_region(int fd, off_t offset, off_t length)
 {
+       struct stat st;
+       if (fstat(fd, &st) < 0)
+               return -1;
+       if (S_ISREG(st.st_mode)) {
 #ifdef FALLOC_FL_PUNCH_HOLE
-       if (fallocate(fd, FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE,
-                       offset, length) == 0)
-               return 0;
+               if (fallocate(fd, FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE,
+                               offset, length) == 0)
+                       return 0;
 #endif
+       } else if (S_ISBLK(st.st_mode)) {
+#ifdef BLKDISCARD
+               uint64_t range[] = { offset, length };
+               if (ioctl(fd, BLKDISCARD, &range) == 0)
+                       return 0;
+#endif
+       }
        return -1;
 }
 
-#define BITS_PER_LONG __WORDSIZE
+#define BITS_PER_LONG           LONG_BIT
 #define BITS_PER_BYTE           8
 #define BITS_TO_LONGS(nr)       DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
 

Reply via email to