Closed priitpol closed 1 year ago
Yes, you are right.
It looks it shall be return ret ? 1 : 0;
,
This is also the case for a successful unltfs
`[root]# sudo /usr/local/bin/mkltfs -w --device=/dev/sg55 LTFS15000I Starting mkltfs, LTFS version 2.4.4.0, log level 2. LTFS15041I Launched by "/usr/local/bin/mkltfs -w --device=/dev/sg55". LTFS15042I This binary is built for Linux (x86_64). LTFS15043I GCC version is 4.8.5 20150623 (Red Hat 4.8.5-16). LTFS17087I Kernel version: Linux version 3.10.0-957.27.2.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Mon Jul 29 17:46:05 UTC 2019 i386. LTFS17089I Distribution: CentOS Linux release 7.6.1810 (Core) . LTFS17089I Distribution: NAME="CentOS Linux". LTFS17089I Distribution: CentOS Linux release 7.6.1810 (Core) . LTFS17089I Distribution: CentOS Linux release 7.6.1810 (Core) . LTFS15003I Formatting device '/dev/sg55'. LTFS15004I LTFS volume blocksize: 524288. LTFS15005I Index partition placement policy: None.
LTFS17085I Plugin: Loading "sg" tape backend. LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg55). LTFS30250I Opened the SCSI tape device 11.0.0.0 (/dev/sg55). LTFS30207I Vendor ID is IBM . LTFS30208I Product ID is ULTRIUM-HH8 . LTFS30214I Firmware revision is P381. LTFS30215I Drive serial is 10WT052568. LTFS30285I The reserved buffer size of /dev/sg55 is 524288. LTFS30294I Setting up timeout values from RSOC. LTFS30294I Setting up timeout values from add log sense. LTFS17160I Maximum device block size is 1048576. LTFS17157I Changing the drive setting to write-anywhere mode. LTFS30252I Logical block protection is disabled. LTFS17071I Unpartitioning the medium. LTFS30252I Logical block protection is disabled. LTFS15040I Medium unformatted successfully.
[rootl]# echo $? 1`
This appears that MKLTFS_UNFORMATTED is set to PROG_TREAT_SUCCESS which is 0x01 and not 0x00.
Is this intended behavior?
Is this intended behavior?
Yes, it is intentional. mkltfs
and ltfsck
returns 1
when data on tape is modified.
The only exception is mkltfs -f
against already formatted tape.
@juliocelon or @jgreen24 ,
Please process this if the PR looks good.
Command ltfs -o device_list lists devices as should but exits with code 1. It is common to expect 0 on success.
Expected behavior Expected to get 0
Desktop (please complete the following information):
Additional context Not an C coder but I suspect ltfs/src/main.c line 711 has a bug return (ret != 0) ? 0 : 1;