Description of problem: fsck command does not return with proper error code but returns zero under specific circumstance. The return value of fsck_device function should appear as the error code. Version-Release number of selected component (if applicable): e2fsprogs-1.39-23.el5 How reproducible: Always Steps to Reproduce: 1. Create entry such as following to /etc/fstab: /dev/sda1 /data ignore defaults 1 2 ###fstype is "ignore" 2. Execute # fsck -t ignore /dev/sdb1 which would return error message. 3. Execute echo $? to confirm it returned 0 instead of error code. Actual results: # echo $? returns 0. Expected results: It should return non-zero, desirably, 8. Additional info: The bug has been encountered by vendor's middle ware, which continued to try running although there were an error.
Created attachment 435078 [details] fix fsck error handling
Created attachment 435080 [details] patch from comment #1 re-diffed to apply with -p1
Patch in comment #2 is from the partner who reported this, reviewed & localbuild tested by me.
Upstream fix exists in the util-linux-ng repo: http://git.kernel.org/?p=utils/util-linux/util-linux.git;a=commitdiff;h=6c6f2af9e3949197cf7a70255895a2f4451f2319 commit 6c6f2af9e3949197cf7a70255895a2f4451f2319 Author: Karel Zak <kzak> Date: Mon Dec 27 22:30:24 2010 +0100 fsck: returns proper code on exec() error # fsck -t foo /dev/sda1; echo $? fsck: fsck.foo: not found /sbin/fsck: Error 2 while executing fsck.foo for /dev/sda1 0 new version: # fsck -t foo /dev/sda1; echo $? fsck: fsck.foo: not found fsck: Error 2 while executing fsck.foo for /dev/sda1 8 Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=619139 Signed-off-by: Karel Zak <kzak>
Built & tagged in e2fsprogs-1.39-28.el5
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/RHBA-2011-1080.html