Bug 499581 - blkrawverify exits with 0 even if files do not exist
Summary: blkrawverify exits with 0 even if files do not exist
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: blktrace
Version: 5.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Eric Sandeen
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-05-07 10:12 UTC by Milos Malik
Modified: 2010-02-03 13:17 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-02 09:41:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2009:1284 0 normal SHIPPED_LIVE New package: blktrace 2009-09-01 09:51:07 UTC

Description Milos Malik 2009-05-07 10:12:10 UTC
Description of problem:
When somebody runs blkrawverify with non-existent file as argument, it does not complain. Exit code is zero.

Version-Release number of selected component (if applicable):
blktrace-1.0.0-5.el5

How reproducible:
always

Steps to Reproduce:
# blktrace -w 5 -d /dev/hdb
Device: /dev/hdb
  CPU  0:                    0 events,        0 KiB data
  CPU  1:                    0 events,        3 KiB data
  CPU  2:                    0 events,        0 KiB data
  CPU  3:                    0 events,        0 KiB data
  CPU  4:                    0 events,        0 KiB data
  CPU  5:                    0 events,        0 KiB data
  CPU  6:                    0 events,        0 KiB data
  CPU  7:                    0 events,        0 KiB data
  Total:                     0 events (dropped 0),        3 KiB data
# ls -l hdb*
-rw-r--r-- 1 root root    0 May  7 06:05 hdb.blktrace.0
-rw-r--r-- 1 root root 2592 May  7 06:05 hdb.blktrace.1
-rw-r--r-- 1 root root    0 May  7 06:05 hdb.blktrace.2
-rw-r--r-- 1 root root    0 May  7 06:05 hdb.blktrace.3
-rw-r--r-- 1 root root    0 May  7 06:05 hdb.blktrace.4
-rw-r--r-- 1 root root    0 May  7 06:05 hdb.blktrace.5
-rw-r--r-- 1 root root    0 May  7 06:05 hdb.blktrace.6
-rw-r--r-- 1 root root    0 May  7 06:05 hdb.blktrace.7
# rm -f hdb*
# blkrawverify hdb
Verifying hdb
# echo $?
0
  
Actual results:
no error message appears
exit code == 0

Expected results:
an error message appears (e.g. "no hdb* files found")
exit code != 0

Comment 1 Eric Sandeen 2009-05-07 16:13:14 UTC
Sent a fix upstream:

http://marc.info/?l=linux-btrace&m=124171251110387&w=2

# ./blkrawverify foobar
Verifying foobar
No tracefiles found for foobar
# echo $?
1

Thanks,
-Eric

Comment 4 Eric Sandeen 2009-05-13 22:54:10 UTC
Committed & built in blktrace-1.0.0-6.el5

Comment 10 errata-xmlrpc 2009-09-02 09:41:20 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1284.html


Note You need to log in before you can comment on or make changes to this bug.