Bug 504417 - file -s is not able to detect swap signature on ppc
file -s is not able to detect swap signature on ppc
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: file (Show other bugs)
5.3
ppc64 Linux
low Severity medium
: rc
: ---
Assigned To: Jan Kaluža
BaseOS QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-06 11:51 EDT by Milan Broz
Modified: 2013-02-28 23:07 EST (History)
3 users (show)

See Also:
Fixed In Version: file-4.17-17
Doc Type: Bug Fix
Doc Text:
Cause: PPC swapspace signature is located at different offset than swapspace signature on different architectures. Consequence: File didn't recognize swap on PPC. Fix: New magic pattern has been added to detect swap on PPC. Result: File now identifies swapspace on PPC as "Linux/ppc swap file"
Story Points: ---
Clone Of:
: 530083 (view as bug list)
Environment:
Last Closed: 2012-02-21 00:45:53 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
swap file created by dd-ing /dev/zero and mkswap(8)ing afterwards (800.00 KB, application/octet-stream)
2009-10-09 10:14 EDT, Daniel Novotny
no flags Details
a patch (529 bytes, patch)
2009-10-20 08:00 EDT, Daniel Novotny
no flags Details | Diff

  None (edit)
Description Milan Broz 2009-06-06 11:51:04 EDT
Description of problem:

file utility do not understant swap signature on PPC platform
(or maybe the problem is 4k vs 64k page size)

x86_64:
  # mkswap /dev/sdb
  Setting up swapspace version 1, size = 320072929 kB
  # file -s /dev/sdb
  /dev/sdb: Linux/i386 swap file (new style) 1 (4K pages) size 78142805 pages
  # rpm -q file
  file-4.17-15.el5_3.1.x86_64

ppc:
  # mkswap /dev/sdb
  Setting up swapspace version 1, size = 73407397 kB
  # file -s /dev/sdb
  /dev/sdb: data
  # rpm -q file
  file-4.17-15.el5_3.1.ppc

file utility should probably detect swap on all supported platforms.
Comment 1 Daniel Novotny 2009-10-09 10:08:49 EDT
the ppc swap is vastly different than the i386/x86_64 one: we will need a new magic

I created a ppc swapfile and will analyze this
Comment 2 Daniel Novotny 2009-10-09 10:14:29 EDT
Created attachment 364252 [details]
swap file created by dd-ing /dev/zero and mkswap(8)ing afterwards

an interesting thing:

[root@ibm-js20-02 ~]# dd if=/dev/zero of=swap.ppc bs=4k count=16
16+0 records in
16+0 records out
65536 bytes (66 kB) copied, 0.000857522 seconds, 76.4 MB/s
[root@ibm-js20-02 ~]# mkswap swap.ppc 
mkswap: error: swap area needs to be at least 655kB



so I created a larger file. the signature is quite long way down in the file:

[dnovotny@dhcp-0-118 file-testfiles]$ od -c swap.ppc
0000000  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
*
0002000  \0  \0  \0 001  \0  \0  \0  \v  \0  \0  \0  \0  \0  \0  \0  \0
0002020  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
*
0177760  \0  \0  \0  \0  \0  \0   S   W   A   P   S   P   A   C   E   2
0200000  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
*
3100000
Comment 3 Daniel Novotny 2009-10-20 08:00:53 EDT
Created attachment 365333 [details]
a patch

adding new magic
Comment 7 RHEL Product and Program Management 2010-08-09 14:26:05 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
Comment 9 RHEL Product and Program Management 2011-01-11 15:39:08 EST
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
Comment 10 RHEL Product and Program Management 2011-01-11 17:34:03 EST
This request was erroneously denied for the current release of
Red Hat Enterprise Linux.  The error has been fixed and this
request has been re-proposed for the current release.
Comment 11 RHEL Product and Program Management 2011-05-31 09:28:23 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
Comment 16 Jan Kaluža 2012-01-05 04:43:52 EST
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: PPC swapspace signature is located at different offset than swapspace signature on different architectures.

Consequence: File didn't recognize swap on PPC.

Fix: New magic pattern has been added to detect swap on PPC.

Result: File now identifies swapspace on PPC as "Linux/ppc swap file"
Comment 17 errata-xmlrpc 2012-02-21 00:45:53 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0201.html

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