Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package zonefs-tools for openSUSE:Factory 
checked in at 2021-01-31 16:52:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/zonefs-tools (Old)
 and      /work/SRC/openSUSE:Factory/.zonefs-tools.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "zonefs-tools"

Sun Jan 31 16:52:16 2021 rev:2 rq:868003 version:1.4.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/zonefs-tools/zonefs-tools.changes        
2020-04-07 10:32:21.782580013 +0200
+++ /work/SRC/openSUSE:Factory/.zonefs-tools.new.28504/zonefs-tools.changes     
2021-01-31 16:52:17.892727471 +0100
@@ -1,0 +2,6 @@
+Wed Jan 20 10:03:42 UTC 2021 - Johannes Thumshirn <[email protected]>
+
+- Update to upstream version 1.4
+  This release improves documentation and test coverage of zonefs-tools
+
+-------------------------------------------------------------------

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

Other differences:
------------------
++++++ zonefs-tools.spec ++++++
--- /var/tmp/diff_new_pack.0OeAK9/_old  2021-01-31 16:52:18.472728309 +0100
+++ /var/tmp/diff_new_pack.0OeAK9/_new  2021-01-31 16:52:18.472728309 +0100
@@ -1,6 +1,7 @@
 #
 # spec file for package zonefs-tools
 #
+# Copyright (c) 2021 SUSE LLC
 # Copyright (C) 2020, Western Digital Corporation or its affiliates.
 #
 # All modifications and additions to the file contributed by third parties
@@ -17,7 +18,7 @@
 
 
 Name:           zonefs-tools
-Version:        0.1
+Version:        1.4.0
 Release:        0
 Summary:        Utilities for the Zonefs filesystem
 License:        GPL-2.0-or-later
@@ -35,7 +36,7 @@
 Utilities needed to create and maintain zonefs file systems under Linux.
 
 %prep
-%setup -q -n zonefs-tools
+%setup -q 
 
 %build
 sh ./autogen.sh

++++++ zonefs-tools.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zonefs-tools/README.md 
new/zonefs-tools-1.4.0/README.md
--- old/zonefs-tools/README.md  2020-03-20 16:15:48.000000000 +0100
+++ new/zonefs-tools-1.4.0/README.md    2021-01-20 03:23:06.000000000 +0100
@@ -2,15 +2,17 @@
 
 # <p align="center">zonefs tools</p>
 
-## Zonefs
+This project provides the *mkzonefs* command line utility which allows
+formatting zoned block devices for use withe the *zonefs* file system.
+
+## The *zonefs* File System
+
+*zonefs* is a very simple file system exposing each zone of a zoned block 
device
+as a file. *zonefs* does not have complex on-disk metadata. Its implementation
+relies solely on a super block stored at LBA 0 of the device. On mount,
+*zonefs* uses zone configuration information obtained directly from the device
+to populate the mount point with files representing the device zones.
 
-zonefs is a very simple file system exposing each zone of a zoned block device
-as a file. zonefs does not have complex on-disk metadata andrelies solely on a
-super block stored at LBA 0 of the device.
-
-On mount, zonefs uses blkdev_report_zones() to obtain the zone configuration of
-the disk and populates the mount point with files based on this zone 
information
-and on the file system options specified in the on-disk super block.
 By default, the files created have the following characteristics.
 
 1) The files mapped to zones of the same type are grouped together under a
@@ -48,41 +50,52 @@
 3) Contiguous conventional zones can be aggregated into a single file instead
    of the default one file per zone.
 
-## mkzonefs
-
-*mkzonefs* is the zonefs device formatting utility provided by this project.
-
 ## License
 
 The *zonefs-tools* project source code is distributed under the terms of the
 GNU General Public License v2.0 or later
 ([GPL-v2](https://opensource.org/licenses/GPL-2.0)).
 A copy of this license with *zonefs-tools* copyright can be found in the files
-[LICENSES/GPL-2.0-or-later.txt] and [COPYING.GPL].
+[LICENSES/GPL-2.0-or-later.txt](LICENSES/GPL-2.0-or-later.txt) and
+[COPYING.GPL](COPYING.GPL).
 
-All source files in *zonefs-tools* contain the GPL-2.0-or-later license SPDX
-short identifier in place of the full license text.
+All source files in *zonefs-tools* contain the SPDX short identifier for the
+GPL-2.0-or-later license in place of the full license text.
 
 ```
 SPDX-License-Identifier: GPL-2.0-or-later
 ```
 
-Some files such as the Makefile.am files and the `.gitignore` file are public
-domain specified by the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication.
-These files are identified with the following SPDX header.
+Some files such as the `Makefile.am` files and the `.gitignore` file are public
+domain specified by the [CC0 1.0 Universal (CC0 1.0) Public Domain
+Dedication](https://creativecommons.org/publicdomain/zero/1.0/).
+These files are identified with the following SPDX short identifier header.
 
 ```
 SPDX-License-Identifier: CC0-1.0
 ```
 
-See [LICENSES/CC0-1.0.txt] for the full text of this license.
+See [LICENSES/CC0-1.0.txt](LICENSES/CC0-1.0.txt) for the full text of this
+license.
+
+## Requirements
+
+The following packages must be installed prior to compiling *mkzonefs*.
+
+* autoconf
+* autoconf-archive
+* automake
+* libtool
+* libuuid library and its development headers (*libuuid* and *libuuid-devel*
+  packages)
+* libblkid library and its development headers (*libblkid* and *libblkid-devel*
+  packages)
+
+The kernel header file `/usr/include/linux/blkzoned.h` must also be present.
 
 ## Compilation and Installation
 
-The following commands will compile the *mkzonefs* tool. This requires the
-*autoconf*, *automake* and *libtool* packages to be installed. The libraries
-*libblkid* and *libuuid* as well as their header files (development packages)
-are also required.
+The following commands will compile the *mkzonefs* tool.
 
 ```
 > sh ./autogen.sh
@@ -105,21 +118,7 @@
 > ./configure --help
 ```
 
-## IV. Usage
-
-To format a zoned block device for use with *zonefs* with all default settings,
-the following command can be used.
-
-```
-# mkzonefs /dev/<disk name>
-```
-
-Specifying options can be done with the *-o* option. For instance, to set the
-files owner UID and GID to user "1000", the following command can be used.
-
-```
-# mkzonefs -o uid=1000,gid=1000 /dev/<disk name>
-```
+## Usage
 
 *mkzonefs* detailed usage is as follows:
 
@@ -134,25 +133,39 @@
 See "man mkzonefs" for more information
 ```
 
-The optional features that can be specified as a comma separated list are as
-follow.
+To format a zoned block device for use with *zonefs* with all default settings,
+the following command can be used.
+
+```
+# mkzonefs /dev/<disk name>
+```
+
+Enabling optional features can be done with the *-o* option. For instance,
+to set the files owner UID and GID to user "1000", the following command can
+be used.
+
+```
+# mkzonefs -o uid=1000,gid=1000 /dev/<disk name>
+```
+
+Several optional features can be specified simultaneously as a comma separated
+list. The following features are defined.
 
 Feature       | Description
 --------------|-------------------------------------------------
-aggr_cnv | Aggregate contiguous sequential zones in a single file (defualt: 
file number)
-sect_name | Use zone start sector value as file name (default: disabled)
-uid=*int* | Set file user owner ID (default: 0)
-gid=*int* | Set file user group ID (default: 0)
-perm=*octal* | Set file access permisisons (default: 640)
+aggr_cnv | Aggregate contiguous conventional zones as a single file (default: 
off)
+uid=*int* | Set zone files user owner ID (default: 0)
+gid=*int* | Set zone files user group ID (default: 0)
+perm=*octal* | Set zone files access permisisons (default: 640)
 
 ## Contributing
 
-Read the CONTRIBUTING file and send patches to:
+Read the [CONTRIBUTING](CONTRIBUTING) file and send patches to:
 
        Damien Le Moal <[email protected]>
 
-If you believe this requires kernel eyes or review Cc the Linux file system
-development mailing list:
+If you believe your changes require kernel eyes or review, Cc the Linux kernel
+file system development mailing list:
 
        [email protected]
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zonefs-tools/configure.ac 
new/zonefs-tools-1.4.0/configure.ac
--- old/zonefs-tools/configure.ac       2020-03-20 16:15:48.000000000 +0100
+++ new/zonefs-tools-1.4.0/configure.ac 2021-01-20 03:23:06.000000000 +0100
@@ -2,7 +2,7 @@
 #
 # Copyright (C) 2019 Western Digital Corporation or its affiliates.
 
-AC_INIT([zonefs tools], [1.3.0], [[email protected]])
+AC_INIT([zonefs tools], [1.4.0], [[email protected]])
 
 AC_PREFIX_DEFAULT(/usr)
 AC_CONFIG_HEADER([src/config.h])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zonefs-tools/src/mkzonefs.c 
new/zonefs-tools-1.4.0/src/mkzonefs.c
--- old/zonefs-tools/src/mkzonefs.c     2020-03-20 16:15:48.000000000 +0100
+++ new/zonefs-tools-1.4.0/src/mkzonefs.c       2021-01-20 03:23:06.000000000 
+0100
@@ -138,6 +138,7 @@
 {
        printf("Usage: mkzonefs [options] <device path>\n");
        printf("Options:\n"
+              "  --version     : Print version number and exit\n"
               "  --help | -h   : General help message\n"
               "  -v            : Verbose output\n"
               "  -f            : Force overwrite of existing content\n"
@@ -169,12 +170,21 @@
 
        /* Parse options */
        for (i = 1; i < argc; i++) {
+               if (strcmp(argv[i], "--version") == 0) {
+                       printf("mkzonefs, version %s\n", PACKAGE_VERSION);
+                       printf("Copyright (C) 2019, Western Digital Corporation"
+                              " or its affiliates.\n");
+                       return 0;
+               }
+
                if (strcmp(argv[i], "--help") == 0 ||
                    strcmp(argv[i], "-h") == 0) {
                        mkzonefs_usage();
                        printf("See \"man mkzonefs\" for more information\n");
                        return 0;
-               } else if (strcmp(argv[i], "-f") == 0) {
+               }
+
+               if (strcmp(argv[i], "-f") == 0) {
                        dev.flags |= ZONEFS_OVERWRITE;
                } else if (strcmp(argv[i], "-v") == 0) {
                        dev.flags |= ZONEFS_VERBOSE;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zonefs-tools/src/zonefs.h 
new/zonefs-tools-1.4.0/src/zonefs.h
--- old/zonefs-tools/src/zonefs.h       2020-03-20 16:15:48.000000000 +0100
+++ new/zonefs-tools-1.4.0/src/zonefs.h 2021-01-20 03:23:06.000000000 +0100
@@ -5,9 +5,8 @@
  *
  * Authors: Damien Le Moal ([email protected])
  */
-
-#ifndef __ZONEFS_H__
-#define __ZONEFS_H__
+#ifndef ZONEFS_H
+#define ZONEFS_H
 
 #define _LARGEFILE64_SOURCE
 
@@ -137,4 +136,4 @@
 #define ZONEFS_STATIC_ASSERT(cond) \
        void zonefs_static_assert(int dummy[(cond) ? 1 : -1])
 
-#endif /* __ZONEFS_H__ */
+#endif /* ZONEFS_H */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zonefs-tools/tests/scripts/0010.sh 
new/zonefs-tools-1.4.0/tests/scripts/0010.sh
--- old/zonefs-tools/tests/scripts/0010.sh      2020-03-20 16:15:48.000000000 
+0100
+++ new/zonefs-tools-1.4.0/tests/scripts/0010.sh        2021-01-20 
03:23:06.000000000 +0100
@@ -5,18 +5,13 @@
 # Copyright (C) 2019 Western Digital Corporation or its affiliates.
 #
 
+. scripts/test_lib
+
 if [ $# == 0 ]; then
        echo "mkzonefs (options)"
        exit 0
 fi
 
-function clear_sb()
-{
-       # Clear super block for -f tests
-       dd if=/dev/zero of="$1" bs=4096 oflag=direct count=1 ||
-               (echo "Clear super block failed"; exit 1)
-}
-
 # Test various good mkzonefs options
 OPTS_OK=(""
         "-h"
@@ -41,8 +36,7 @@
 done
 
 # Test various bad mkzonefs options
-OPTS_BAD=(""
-         "-bad-option"
+OPTS_BAD=("-bad-option"
          "-o"
          "-o invalid_feature"
          "-o invalid,,list")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zonefs-tools/tests/scripts/0012.sh 
new/zonefs-tools-1.4.0/tests/scripts/0012.sh
--- old/zonefs-tools/tests/scripts/0012.sh      2020-03-20 16:15:48.000000000 
+0100
+++ new/zonefs-tools-1.4.0/tests/scripts/0012.sh        2021-01-20 
03:23:06.000000000 +0100
@@ -13,10 +13,14 @@
 fi
 
 # Not a block device
+echo "# Trying /dev/console"
+
 mkzonefs /dev/console && exit_failed " --> SUCCESS (should FAIL)"
 
-# Regular disk
+# Regular block device
 nulldev=$(create_nullb)
+echo "# Trying regular block device /dev/nullb$nulldev"
+
 mkzonefs "/dev/nullb$nulldev" && exit_failed " --> SUCCESS (should FAIL)"
 destroy_nullb $nulldev
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zonefs-tools/tests/scripts/0034.sh 
new/zonefs-tools-1.4.0/tests/scripts/0034.sh
--- old/zonefs-tools/tests/scripts/0034.sh      2020-03-20 16:15:48.000000000 
+0100
+++ new/zonefs-tools-1.4.0/tests/scripts/0034.sh        2021-01-20 
03:23:06.000000000 +0100
@@ -19,10 +19,11 @@
 
 nr_blocks=$(block_number "$zonefs_mntdir")
 sz_blocks=$(block_size "$zonefs_mntdir")
-nr_expected_blocks=$(( (nr_zones - 1 ) * zone_bytes / sz_blocks ))
+capacity_bytes=$(( total_usable_sectors * 512))
+nr_expected_blocks=$(( capacity_bytes / sz_blocks ))
 
 if [ "$nr_blocks" != "$nr_expected_blocks" ]; then
-        echo " --> Invalid number of total number of blocks:"
+        echo " --> Invalid total number of blocks:"
         echo " --> Expected $nr_expected_blocks, got $nr_blocks"
         exit 1
 fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zonefs-tools/tests/scripts/0035.sh 
new/zonefs-tools-1.4.0/tests/scripts/0035.sh
--- old/zonefs-tools/tests/scripts/0035.sh      2020-03-20 16:15:48.000000000 
+0100
+++ new/zonefs-tools-1.4.0/tests/scripts/0035.sh        2021-01-20 
03:23:06.000000000 +0100
@@ -19,10 +19,11 @@
 
 nr_blocks=$(block_number "$zonefs_mntdir")
 sz_blocks=$(block_size "$zonefs_mntdir")
-nr_expected_blocks=$(( (nr_zones - 1 ) * zone_bytes / sz_blocks ))
+capacity_bytes=$(( total_usable_sectors * 512))
+nr_expected_blocks=$(( capacity_bytes / sz_blocks ))
 
 if [ "$nr_blocks" != "$nr_expected_blocks" ]; then
-        echo " --> Invalid number of total number of blocks:"
+        echo " --> Invalid total number of blocks:"
         echo " --> Expected $nr_expected_blocks, got $nr_blocks"
         exit 1
 fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zonefs-tools/tests/scripts/0086.sh 
new/zonefs-tools-1.4.0/tests/scripts/0086.sh
--- old/zonefs-tools/tests/scripts/0086.sh      2020-03-20 16:15:48.000000000 
+0100
+++ new/zonefs-tools-1.4.0/tests/scripts/0086.sh        2021-01-20 
03:23:06.000000000 +0100
@@ -25,12 +25,12 @@
        exit_failed " --> Invalid file size $sz B, expected 4096 B"
 
 dd if=/dev/zero of="$zonefs_mntdir"/seq/0 oflag=direct,append bs=4096 \
-       count=$(( zone_bytes / 4096 - 1)) conv=notrunc || \
+       count=$(( seq_file_0_max_size / 4096 - 1)) conv=notrunc || \
        exit_failed " --> FAILED"
 
 sz=$(file_size "$zonefs_mntdir"/seq/0)
-[ "$sz" != "$zone_bytes" ] && \
-       exit_failed " --> Invalid file size $sz B, expected $zone_bytes B"
+[ "$sz" != "$seq_file_0_max_size" ] && \
+       exit_failed " --> Invalid file size $sz B, expected 
$seq_file_0_max_size B"
 
 zonefs_umount
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zonefs-tools/tests/scripts/0087.sh 
new/zonefs-tools-1.4.0/tests/scripts/0087.sh
--- old/zonefs-tools/tests/scripts/0087.sh      2020-03-20 16:15:48.000000000 
+0100
+++ new/zonefs-tools-1.4.0/tests/scripts/0087.sh        2021-01-20 
03:23:06.000000000 +0100
@@ -20,14 +20,14 @@
 zonefs_mount "$1"
 fio --name=seq_wr --filename="$zonefs_mntdir"/seq/0 \
     --create_on_open=0 --allow_file_create=0 --file_append=1 --unlink=0 \
-    --rw=write --ioengine=libaio --iodepth=8 \
-    --bs=131072 --size="$zone_bytes" --verify=md5 --do_verify=1 \
+    --rw=write --ioengine=libaio --iodepth=8 --max-jobs=8 \
+    --bs=131072 --size="$seq_file_0_max_size" --verify=md5 --do_verify=1 \
     --continue_on_error=none --direct=1 || \
        exit_failed " --> FAILED"
 
 sz=$(file_size "$zonefs_mntdir"/seq/0)
-[ "$sz" != "$zone_bytes" ] && \
-       exit_failed " --> Invalid file size $sz B, expected $zone_bytes B"
+[ "$sz" != "$seq_file_0_max_size" ] && \
+       exit_failed " --> Invalid file size $sz B, expected 
$seq_file_0_max_size B"
 
 zonefs_umount
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zonefs-tools/tests/scripts/0088.sh 
new/zonefs-tools-1.4.0/tests/scripts/0088.sh
--- old/zonefs-tools/tests/scripts/0088.sh      2020-03-20 16:15:48.000000000 
+0100
+++ new/zonefs-tools-1.4.0/tests/scripts/0088.sh        2021-01-20 
03:23:06.000000000 +0100
@@ -22,18 +22,18 @@
 # Fill file
 fio --name=seqwrite --filename="$zonefs_mntdir"/seq/0 \
     --create_on_open=0 --allow_file_create=0 --file_append=1 --unlink=0 \
-    --rw=write --ioengine=libaio --iodepth=8 \
-    --bs=131072 --size="$zone_bytes" --verify=md5 --do_verify=1 \
+    --rw=write --ioengine=libaio --iodepth=8 --max-jobs=8 \
+    --bs=131072 --size="$seq_file_0_max_size" --verify=md5 --do_verify=1 \
     --continue_on_error=none --direct=1 || \
        exit_failed "fio write FAILED"
 
 sz=$(file_size "$zonefs_mntdir"/seq/0)
-[ "$sz" != "$zone_bytes" ] && \
-       exit_failed " --> Invalid file size $sz B, expected $zone_bytes B"
+[ "$sz" != "$seq_file_0_max_size" ] && \
+       exit_failed " --> Invalid file size $sz B, expected 
$seq_file_0_max_size B"
 
 # Read
 fio --name=seq_rndrd --filename="$zonefs_mntdir"/seq/0 \
-    --rw=randread --ioengine=libaio --iodepth=8 \
+    --rw=randread --ioengine=libaio --iodepth=8 --max-jobs=8 \
     --bs=131072 --verify=md5 --do_verify=1 \
     --continue_on_error=none || \
        exit_failed "fio async rand read FAILED"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zonefs-tools/tests/scripts/0089.sh 
new/zonefs-tools-1.4.0/tests/scripts/0089.sh
--- old/zonefs-tools/tests/scripts/0089.sh      2020-03-20 16:15:48.000000000 
+0100
+++ new/zonefs-tools-1.4.0/tests/scripts/0089.sh        2021-01-20 
03:23:06.000000000 +0100
@@ -31,7 +31,7 @@
 # mmpa(MAP_WRITE) should fail
 fio --name=cnv_mmapwr --filename="$zonefs_mntdir"/seq/0 \
     --create_on_open=0 --allow_file_create=0 --file_append=0 --unlink=0 \
-    --rw=randwrite --ioengine=mmap --size="$sz" \
+    --rw=randwrite --ioengine=mmap --size="$sz" --max-jobs=8 \
     --bs=4096 --continue_on_error=none && \
     exit_failed " --> FAILED"
 
@@ -42,14 +42,14 @@
 # Fill file
 fio --name=seqwrite --filename="$zonefs_mntdir"/seq/0 \
     --create_on_open=0 --allow_file_create=0 --file_append=1 --unlink=0 \
-    --rw=write --ioengine=libaio --iodepth=64 \
+    --rw=write --ioengine=libaio --iodepth=64 --max-jobs=8 \
     --bs=4096 --size="$maxsize" --verify=md5 --do_verify=1 \
     --continue_on_error=none --direct=1 || \
        exit_failed "fio write FAILED"
 
 sz=$(file_size "$zonefs_mntdir"/seq/0)
-[ "$sz" != "$zone_bytes" ] && \
-       exit_failed " --> Invalid file size $sz B, expected $zone_bytes B"
+[ "$sz" != "$seq_file_0_max_size" ] && \
+       exit_failed " --> Invalid file size $sz B, expected 
$seq_file_0_max_size B"
 
 zonefs_umount
 
@@ -58,7 +58,7 @@
 zonefs_mount "$1"
 
 fio --name=seq_rndrd --filename="$zonefs_mntdir"/seq/0 \
-    --rw=randread --ioengine=mmap \
+    --rw=randread --ioengine=mmap --max-jobs=8 \
     --create_on_open=0 --allow_file_create=0 --unlink=0 \
     --bs=4096 --size="$maxsize" --verify=md5 --do_verify=1 \
     --continue_on_error=none || \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zonefs-tools/tests/scripts/0090.sh 
new/zonefs-tools-1.4.0/tests/scripts/0090.sh
--- old/zonefs-tools/tests/scripts/0090.sh      1970-01-01 01:00:00.000000000 
+0100
+++ new/zonefs-tools-1.4.0/tests/scripts/0090.sh        2021-01-20 
03:23:06.000000000 +0100
@@ -0,0 +1,39 @@
+#!/bin/bash
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# Copyright (C) 2020 Western Digital Corporation or its affiliates.
+#
+
+. scripts/test_lib
+
+if [ $# == 0 ]; then
+       echo "sequential file 4K synchronous write"
+        exit 0
+fi
+
+set -x
+
+require_program fio
+
+echo "Check sequential file 4K sync write"
+
+zonefs_mkfs "$1"
+zonefs_mount "$1"
+
+sz=$(file_max_size "$zonefs_mntdir"/seq/0)
+truncate --no-create --size=0 "$zonefs_mntdir"/seq/0 || \
+        exit_failed " --> FAILED"
+
+fio --name=seqwrite --filename="$zonefs_mntdir"/seq/0 \
+    --create_on_open=0 --allow_file_create=0 --file_append=1 --unlink=0 \
+    --rw=write --ioengine=psync --iodepth=64 --max-jobs=8 \
+    --bs=4096 --size="$sz" --verify=md5 --do_verify=1 \
+    --continue_on_error=none --direct=1 || \
+       exit_failed "fio write FAILED"
+
+zonefs_umount
+
+set +x
+
+exit 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zonefs-tools/tests/scripts/0091.sh 
new/zonefs-tools-1.4.0/tests/scripts/0091.sh
--- old/zonefs-tools/tests/scripts/0091.sh      1970-01-01 01:00:00.000000000 
+0100
+++ new/zonefs-tools-1.4.0/tests/scripts/0091.sh        2021-01-20 
03:23:06.000000000 +0100
@@ -0,0 +1,44 @@
+#!/bin/bash
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# Copyright (C) 2020 Western Digital Corporation or its affiliates.
+#
+
+. scripts/test_lib
+
+if [ $# == 0 ]; then
+       echo "Sequential file large synchronous write"
+        exit 0
+fi
+
+require_program fio
+
+echo "Check sequential file sync write bigger than max-append size"
+
+zonefs_mkfs "$1"
+zonefs_mount "$1"
+
+sz=$(file_max_size "$zonefs_mntdir"/seq/0)
+truncate --no-create --size=0 "$zonefs_mntdir"/seq/0 || \
+        exit_failed " --> FAILED"
+
+pbs=$(block_size "$1")
+mask=$(($pbs - 1))
+
+bs=$(get_zone_append_max_bytes "$1")
+bs=$(($bs + $pbs))
+
+bs=$((($bs + $mask & ~$mask)))
+
+fio --name=seqwrite --filename="$zonefs_mntdir"/seq/0 \
+    --create_on_open=0 --allow_file_create=0 --file_append=1 --unlink=0 \
+    --rw=write --ioengine=psync --iodepth=64 --max-jobs=8 \
+    --bs="$bs" --size="$sz" --verify=md5 --do_verify=1 \
+    --continue_on_error=none --direct=1 || \
+       exit_failed "fio write FAILED"
+
+zonefs_umount
+
+exit 0
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zonefs-tools/tests/scripts/0092.sh 
new/zonefs-tools-1.4.0/tests/scripts/0092.sh
--- old/zonefs-tools/tests/scripts/0092.sh      1970-01-01 01:00:00.000000000 
+0100
+++ new/zonefs-tools-1.4.0/tests/scripts/0092.sh        2021-01-20 
03:23:06.000000000 +0100
@@ -0,0 +1,78 @@
+#!/bin/bash
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# Copyright (C) 2020 Western Digital Corporation or its affiliates.
+#
+
+. scripts/test_lib
+
+generate_fio() {
+       local nseq="$1"
+
+       filename="$zonefs_mntdir/seq/0"
+       for (( i=1; i<$nseq; i++ )); do
+               truncate -s 0 "$zonefs_mntdir/seq/$i"
+               filename="$filename:$zonefs_mntdir/seq/$i"
+       done
+
+       cat > 0092.fio << EOF
+[global]
+create_on_open=0
+allow_file_create=0
+file_append=1
+unlink=0
+rw=write
+ioengine=psync
+bs=4k
+filesize=$(file_max_size "$zonefs_mntdir"/seq/0)
+continue_on_error=none
+direct=1
+
+[less-than-MOZ]
+filename=$filename
+EOF
+}
+
+function cleanup {
+       rm -f 0092.fio > /dev/null 2>&1
+}
+trap cleanup EXIT
+
+if [ $# == 0 ]; then
+       echo "explicit-open mounts"
+        exit 0
+fi
+
+require_program fio
+
+echo "Check explicit-open mounts"
+
+max_open_zones=$(get_max_open_zones "$1")
+if [ "$max_open_zones" == 0 ]; then
+       exit_skip
+fi
+
+zonefs_mkfs "$1"
+zonefs_mount "-o explicit-open $1"
+
+# fio write with less than $max_open_zones must succeed
+echo "Check write in less than max open zones files"
+if [ $max_open_zones -gt 1 ]; then
+       generate_fio $(( $max_open_zones - 1 ))
+       fio 0092.fio || exit_failed "fio write failed"
+fi
+
+# fio write with $max_open_zones must succeed
+echo "Check write in exactly max open zones files"
+generate_fio $max_open_zones
+fio 0092.fio || exit_failed "fio write failed"
+
+# fio write with 2 * $max_open_zones must fail
+echo "Check write in double max open zones files"
+generate_fio $(( $max_open_zones * 2 ))
+fio 0092.fio && exit_failed "fio write succeeded (should fail)"
+
+zonefs_umount
+
+exit 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zonefs-tools/tests/scripts/test_lib 
new/zonefs-tools-1.4.0/tests/scripts/test_lib
--- old/zonefs-tools/tests/scripts/test_lib     2020-03-20 16:15:48.000000000 
+0100
+++ new/zonefs-tools-1.4.0/tests/scripts/test_lib       2021-01-20 
03:23:06.000000000 +0100
@@ -27,9 +27,20 @@
        cat "/sys/class/block/$(basename $1)/queue/chunk_sectors"
 }
 
-function get_zone_bytes()
+function get_zone_append_max_bytes()
 {
-       echo $(( $(get_zone_sectors "$1") * 512 ))
+       cat "/sys/class/block/$(basename $1)/queue/zone_append_max_bytes"
+}
+
+function get_max_open_zones()
+{
+       local bdev="$(basename $1)"
+
+       if [ -f "/sys/class/block/$bdev/queue/max_open_zones" ]; then
+               cat "/sys/class/block/$bdev/queue/max_open_zones"
+       else
+               echo "0"
+       fi
 }
 
 function zone_info()
@@ -39,14 +50,42 @@
 
 function zone_is_conventional()
 {
-       z="$(zone_info $1 $2)"
-       echo "$z" | grep -q "CONVENTIONAL" && return 0 || return 1
+       echo "$(zone_info $1 $2)" | grep -q "CONVENTIONAL" && return 0 || 
return 1
 }
 
 function zone_is_full()
 {
-       z="$(zone_info $1 $2)"
-       echo "$z" | grep -q "zcond:14(fu)" && return 0 || return 1
+       echo "$(zone_info $1 $2)" | grep -q "zcond:14(fu)" && return 0 || 
return 1
+}
+
+function blkzone_has_zone_capacity()
+{
+       echo "$(zone_info $1 0)" | grep -q "cap " && return 0 || return 1
+
+}
+
+function get_zone_capacity_sectors()
+{
+       c=$(echo "$(zone_info $1 $2)" | cut -d "," -f3 | cut -d" " -f3)
+       echo $((c))
+}
+
+function get_zone_capacity_bytes()
+{
+       echo $(( $(get_zone_capacity_sectors "$1" "$2") * 512 ))
+}
+
+function get_total_zone_capacity_sectors()
+{
+       local total_cap=0
+
+       # Skip the first zone as it contains the super block
+       while read -r c_hex; do
+               c=$((c_hex))
+               total_cap=$(( total_cap + c ))
+       done < <(blkzone report -o "$zone_sectors" "$1" | cut -d "," -f3 | cut 
-d" " -f3)
+
+       echo $total_cap
 }
 
 function exit_skip()
@@ -60,6 +99,20 @@
        exit 1
 }
 
+function clear_sb()
+{
+       local nrcnv=$(get_nr_cnv_zones "$1")
+
+       # Clear super block for -f tests
+       if [ $nrcnv == 0 ]; then
+               blkzone reset --offset 0 -c 1 "$1" ||
+                       (echo "Reset super block zone failed"; exit 1)
+       else
+               dd if=/dev/zero of="$1" bs=4096 oflag=direct count=1 ||
+                       (echo "Clear super block failed"; exit 1)
+       fi
+}
+
 function zonefs_mkfs()
 {
        IFS=' ';
@@ -189,6 +242,7 @@
        aggr_cnv=$1
 
        if [ -d "$zonefs_mntdir/cnv/" ]; then
+               # Note: conventional zone capacity is always equal to the zone 
size
                if $aggr_cnv; then
                        expected_sz=$(( zone_bytes * (nr_cnv_zones - 1) ))
                else
@@ -239,6 +293,7 @@
        done
 
        mkdir /sys/kernel/config/nullb/nullb$n
+       echo 0 > /sys/kernel/config/nullb/nullb$n/zoned
        echo 1 > /sys/kernel/config/nullb/nullb$n/power
 
        echo "$n"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zonefs-tools/tests/zonefs-tests-nullblk.sh 
new/zonefs-tools-1.4.0/tests/zonefs-tests-nullblk.sh
--- old/zonefs-tools/tests/zonefs-tests-nullblk.sh      2020-03-20 
16:15:48.000000000 +0100
+++ new/zonefs-tools-1.4.0/tests/zonefs-tests-nullblk.sh        2021-01-20 
03:23:06.000000000 +0100
@@ -5,12 +5,52 @@
 # Copyright (C) 2019 Western Digital Corporation or its affiliates.
 #
 
+# Zone size in MB
+zone_size=64
+zone_capacity=$zone_size
+
+# Use max open limit (default off)
+zone_max_open=0
+
+# Capacity (MB)
+capacity=4096
+
+function usage() {
+       echo "Usage: $0 [options]"
+       echo "Options:"
+       echo "  -h | --help:    Display help"
+       echo "  -c | --cap:     Test with zone capacity < zone size (default: 
off)"
+       echo "  -o | --moz:     Test with max open zone limit set (default: no 
limit)"
+}
+
 # Check credentials
 if [ $(id -u) -ne 0 ]; then
         echo "Root credentials are needed to run tests."
         exit 1
 fi
 
+# Check options
+while [[ $# -gt 0 ]]; do
+        case "$1" in
+               "-c" | "--cap")
+                       zone_capacity=$(( zone_size - 1 ))
+                        shift
+                        ;;
+               "-o" | "--moz")
+                       zone_max_open=$(( $capacity / $zone_size / 8 ))
+                        shift
+                        ;;
+               "-h" | "--help")
+                       usage "$0"
+                       exit 0
+                        ;;
+                *)
+                       echo "Invalid option $1"
+                       exit 1
+                        ;;
+        esac
+done
+
 # trap ctrl-c interruptions
 aborted=0
 trap ctrl_c INT
@@ -38,19 +78,31 @@
        dev="/sys/kernel/config/nullb/nullb$n"
        mkdir "$dev"
 
+       if [ $zone_capacity != $zone_size ] && [ ! -w "$dev"/zone_capacity ]; 
then
+               echo "Zone capacity is not supported by nullblk"
+               exit 1
+       fi
+
        echo 4096 > "$dev"/blocksize
        echo 0 > "$dev"/completion_nsec
        echo 0 > "$dev"/irqmode
        echo 2 > "$dev"/queue_mode
 
-       echo 4096 > "$dev"/size
+       echo $capacity > "$dev"/size
        echo 1024 > "$dev"/hw_queue_depth
        echo 1 > "$dev"/memory_backed
 
        echo 1 > "$dev"/zoned
-       echo 64 > "$dev"/zone_size
+       echo "$zone_size" > "$dev"/zone_size
+       if [ $zone_capacity != $zone_size ]; then
+               echo "$zone_capacity" > "$dev"/zone_capacity
+       fi
        echo $1 > "$dev"/zone_nr_conv
 
+       if [ -f "$dev"/zone_max_open ]; then
+               echo "$zone_max_open" > "$dev"/zone_max_open
+       fi
+
        echo 1 > "$dev"/power
 
        echo "$n"
@@ -72,6 +124,8 @@
 
        echo ""
        echo "Run tests against device with $c conventional zones..."
+       echo "    Zone size: $zone_size MB, zone capacity: $zone_capacity MB"
+       echo "    $zone_max_open max open zones"
        echo ""
        nulld=$(create_zoned_nullb $c)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/zonefs-tools/tests/zonefs-tests.sh 
new/zonefs-tools-1.4.0/tests/zonefs-tests.sh
--- old/zonefs-tools/tests/zonefs-tests.sh      2020-03-20 16:15:48.000000000 
+0100
+++ new/zonefs-tools-1.4.0/tests/zonefs-tests.sh        2021-01-20 
03:23:06.000000000 +0100
@@ -122,6 +122,12 @@
         exit 1
 fi
 
+if ! blkzone_has_zone_capacity "$dev"; then
+       echo "blkzone utility is not reporting zone capacity."
+       echo "util-linux update needed."
+        exit 1
+fi
+
 export zonefs_mntdir="$bdev-mnt"
 mkdir -p "$zonefs_mntdir"
 
@@ -135,25 +141,32 @@
 rc=0
 
 # Drive parameters
+echo "Gathering information on $dev..."
 export nr_zones=$(get_nr_zones "$dev")
 export zone_sectors=$(get_zone_sectors "$dev")
-export zone_bytes=$(get_zone_bytes "$dev")
+export zone_bytes=$(( zone_sectors * 512 ))
 export nr_cnv_zones=$(get_nr_cnv_zones "$dev")
 export nr_seq_zones=$(get_nr_seq_zones "$dev")
+export total_usable_sectors=$(get_total_zone_capacity_sectors "$dev")
 
 # Expected number of files
 if [ "$nr_cnv_zones" == 0 ]; then
        nr_cnv_files=0
        nr_seq_files=$(( nr_seq_zones - 1 ))
+       seq_file_0_zone_start_sector=$(( zone_sectors * 2 ))
 elif [ "$nr_cnv_zones" == 1 ]; then
        nr_cnv_files=0
        nr_seq_files=$nr_seq_zones
+       seq_file_0_zone_start_sector=$zone_sectors
 else
        nr_cnv_files=$(( nr_cnv_zones - 1 ))
        nr_seq_files=$nr_seq_zones
+       seq_file_0_zone_start_sector=$(( nr_cnv_zones * zone_sectors ))
 fi
 export nr_cnv_files
 export nr_seq_files
+export seq_file_0_zone_start_sector
+export seq_file_0_max_size=$(get_zone_capacity_bytes "$dev" 
$seq_file_0_zone_start_sector)
 
 # Set IO scheduler
 echo deadline >"/sys/block/$bdev/queue/scheduler"
@@ -185,7 +198,8 @@
 
 echo "zonefs-tests on $dev:"
 echo "  $nr_zones zones ($nr_cnv_zones conventional zones, $nr_seq_zones 
sequential zones)"
-echo "  $zone_sectors 512B sectors per zone ($(( zone_bytes / 1048576 )) MiB)"
+echo "  $zone_sectors 512B sectors zone size ($(( zone_bytes / 1048576 )) MiB)"
+echo "  $(get_max_open_zones $dev) max open zones"
 echo "Running tests"
 
 for t in "${tests[@]}"; do

Reply via email to