Bug 1029695

Summary: dosfsck fails on big endian
Product: [Fedora] Fedora Reporter: Kevin W Monroe <kmonroe>
Component: dosfstoolsAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: jskarvad
Target Milestone: ---   
Target Release: ---   
Hardware: ppc64   
OS: Linux   
Whiteboard:
Fixed In Version: dosfstools-3.0.24-1.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1033599 (view as bug list) Environment:
Last Closed: 2013-12-10 06:13:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Proposed fix sent upstream none

Description Kevin W Monroe 2013-11-12 23:24:07 UTC
Description of problem:

dosfsck'ing a newly created fs fails on ppc64 with:

"Logical sector size (2 bytes) is not a multiple of the physical sector size."

Version-Release number of selected component (if applicable):

Found in f19, still occurs in latest from ppc.koji:

dosfstools-3.0.23-1.fc21.ppc64.rpm

How reproducible:

Always

Steps to Reproduce:
1. mkdosfs -C /tmp/t.img 1024
2. dosfsck /tmp/t.img

Actual results:

# mkdosfs -C /tmp/t.img 1024
mkfs.fat 3.0.23 (2013-10-15)
# dosfsck /tmp/t.img
fsck.fat 3.0.23 (2013-10-15)
Logical sector size (2 bytes) is not a multiple of the physical sector size.
# echo $?
1

Expected results:

# mkdosfs -C /tmp/t.img 1024
mkfs.fat 3.0.23 (2013-10-15)
# dosfsck /tmp/t.img
fsck.fat 3.0.23 (2013-10-15)
# echo $?
0

Additional info:

Reverting the change to GET_UNALIGNED_W from commit 4a265c6 fixes this:

http://daniel-baumann.ch/gitweb/?p=software/dosfstools.git;a=commitdiff;h=4a265c6#patch2

Comment 1 Jaroslav Škarvada 2013-11-22 14:56:19 UTC
Thanks for the report, it seems the problem is in the double conversion on big endians. The first conversion is done by the explicit conversion to __u16, so the secondary conversion by le16toh is redundant.

Comment 2 Jaroslav Škarvada 2013-11-22 14:57:11 UTC
Created attachment 827840 [details]
Proposed fix sent upstream

Comment 3 Fedora Update System 2013-11-22 16:13:26 UTC
dosfstools-3.0.22-3.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/dosfstools-3.0.22-3.fc19

Comment 4 Fedora Update System 2013-11-22 16:13:48 UTC
dosfstools-3.0.23-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/dosfstools-3.0.23-2.fc20

Comment 5 Fedora Update System 2013-11-23 19:37:33 UTC
Package dosfstools-3.0.22-3.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing dosfstools-3.0.22-3.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-21876/dosfstools-3.0.22-3.fc19
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2013-11-25 14:59:04 UTC
dosfstools-3.0.24-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/dosfstools-3.0.24-1.fc20

Comment 7 Fedora Update System 2013-12-10 06:13:46 UTC
dosfstools-3.0.22-3.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2013-12-14 02:46:21 UTC
dosfstools-3.0.24-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.