Bug 150934 - badblocks attempt to access beyond end of device
badblocks attempt to access beyond end of device
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: e2fsprogs (Show other bugs)
3.0
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Eric Sandeen
Jay Turner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-03-12 00:31 EST by Italo
Modified: 2015-01-07 19:09 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-10-19 15:06:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Italo 2005-03-12 00:31:24 EST
When I run badblocks I get false errors at the end of the root and swap 
partitions, but not on the boot partition. Also I get messages in the error log 
that it is attempting to access beyound the end of the device. This bug is also 
present in FC1, but apparently not present on FC3.

My system is a Celeron D 2.4 with 1GB ram:

[root@server1 root]# cat /etc/redhat-release 
Red Hat Enterprise Linux ES release 3 (Taroon Update 4)

[root@server1 root]# cat /proc/version 
Linux version 2.4.21-27.0.2.EL (bhcompile@tweety.build.redhat.com) (gcc version 
3.2.3 20030502 (Red Hat Linux 3.2.3-47)) #1 Wed Jan 12 23:46:37 EST 2005

[root@server1 root]# cat /proc/ide/hda/model
WDC WD800BB-75FRA0

[root@server1 root]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda3             74730396  11060996  59873244  16% /
/dev/hda1               101089     24062     71808  26% /boot
none                    513492         0    513492   0% /dev/shm
/dev/hdc1             76896316     87780  72902336   1% /backup




When I run badblocks I get false errors on the root and swap partitions but not 
on the boot:



[root@server1 root]# badblocks -s /dev/hda1
Checking for bad blocks (read-only test): done

[root@server1 root]# badblocks -s /dev/hda2
Checking for bad blocks (read-only test): 2096482/  2096482
2096480
2096481
done

[root@server1 root]# badblocks -s /dev/hda3
Checking for bad blocks (read-only test): 75923190/ 75923190
75923188
75923189
done



And the log reports:


/var/log/messages (partial)

Mar 11 20:12:11 server1 kernel: attempt to access beyond end of device
Mar 11 20:12:11 server1 kernel: 03:02: rw=0, want=2096484, limit=2096482
Mar 11 20:43:45 server1 kernel: attempt to access beyond end of device
Mar 11 20:43:45 server1 kernel: 03:03: rw=0, want=75923192, limit=75923190
Comment 1 Italo 2005-03-12 00:39:36 EST
A similar bug has been reported on Fedora Core 1:

https://bugzilla.redhat.com/beta/show_bug.cgi?id=125885

https://bugzilla.redhat.com/beta/show_bug.cgi?id=125883
Comment 2 Italo 2005-03-12 01:41:04 EST
Same error for the second HD:

[root@server1 root]# cat /proc/ide/hda/model 
WDC WD800BB-75FRA0

[root@server1 root]# cat /proc/ide/hdc/model 
ST380011A

[root@server1 root]# badblocks -s /dev/hdc1
Checking for bad blocks (read-only test): 78124063/ 78124063
78124060
78124061
78124062
done

Mar 12 03:13:16 server1 kernel: attempt to access beyond end of device
Mar 12 03:13:16 server1 kernel: 16:01: rw=0, want=78124064, limit=78124063
Mar 12 03:13:16 server1 kernel: attempt to access beyond end of device
Mar 12 03:13:16 server1 kernel: 16:01: rw=0, want=78124064, limit=78124063
Mar 12 03:13:16 server1 kernel: attempt to access beyond end of device
Mar 12 03:13:16 server1 kernel: 16:01: rw=0, want=78124064, limit=78124063
Mar 12 03:13:16 server1 kernel: attempt to access beyond end of device
Mar 12 03:13:16 server1 kernel: 16:01: rw=0, want=78124064, limit=78124063
Comment 3 Italo 2005-03-12 01:47:16 EST
[root@server1 root]# lspci
00:00.0 Host bridge: Intel Corp. 82875P/E7210 Memory Controller Hub (rev 02)
00:01.0 PCI bridge: Intel Corp. 82875P Processor to AGP Controller (rev 02)
00:1d.0 USB Controller: Intel Corp. 82801EB/ER (ICH5/ICH5R) USB UHCI Controller 
#1 (rev 02)
00:1d.1 USB Controller: Intel Corp. 82801EB/ER (ICH5/ICH5R) USB UHCI Controller 
#2 (rev 02)
00:1d.2 USB Controller: Intel Corp. 82801EB/ER (ICH5/ICH5R) USB UHCI #3 (rev 02)
00:1d.3 USB Controller: Intel Corp. 82801EB/ER (ICH5/ICH5R) USB UHCI Controller 
#4 (rev 02)
00:1d.7 USB Controller: Intel Corp. 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller 
(rev 02)
00:1e.0 PCI bridge: Intel Corp. 82801 PCI Bridge (rev c2)
00:1f.0 ISA bridge: Intel Corp. 82801EB/ER (ICH5/ICH5R) LPC Interface Bridge 
(rev 02)
00:1f.1 IDE interface: Intel Corp. 82801EB/ER (ICH5/ICH5R) IDE Controller (rev 
02)
00:1f.2 IDE interface: Intel Corp. 82801EB (ICH5) SATA Controller (rev 02)
00:1f.3 SMBus: Intel Corp. 82801EB/ER (ICH5/ICH5R) SMBus Controller (rev 02)
00:1f.5 Multimedia audio controller: Intel Corp. 82801EB/ER (ICH5/ICH5R) AC'97 
Audio Controller (rev 02)
02:00.0 VGA compatible controller: ATI Technologies Inc Rage XL (rev 27)
02:0c.0 Ethernet controller: Intel Corp. 82540EM Gigabit Ethernet Controller 
(rev 02)
Comment 4 Stephen Tweedie 2005-03-14 17:24:01 EST
I expect this is due to the device being left in 4k blocksize mode internally
within the kernel, and badblocks being run in 1k blocksize.

Does the problem persist if you run with "blocksize -b 4096"?
Comment 5 Italo 2005-03-15 11:26:25 EST
No errors were found using 4KB blocks.

[root@server1 root]# badblocks -s -b 4096 /dev/hda2
Checking for bad blocks (read-only test): done
[root@server1 root]# badblocks -s -b 4096 /dev/hda3
Checking for bad blocks (read-only test): done

Was it my fault then? How can I tell the block size I should use for each 
system?
Comment 6 Stephen Tweedie 2005-03-15 12:39:22 EST
The problem is that if the kernel has a blocksize of 4k on a device, then any
odd sectors beyond the last whole multiple of 4k near the end of the partition
will be unreadable.  But if you don't specify -b 4096 to badblocks, and it
defaults to 1k blocks, then the badblocks scan will try to access these sectors.

There are two separate problems here.  The kernel is working as defined; access
to these sectors will never work unless the device is back in 512- or 1024-byte
blocksize, and you cannot set the blocksize on a device that is already mounted
(the blocksize is fixed by the mounted filesystem.)  But it probably shouldn't
be warning in this case.  That's only a minor issue.

The other problem is that badblocks probably needs to be aware about the
blocksize on the device it is handling in order to avoid getting confused by
these entirely-expected errors.

I'm really not certain what the best option will be.   There are various
possibilities with various advantages and disadvantages, and we'll have to
discuss with the upstream e2fsprogs developers how best to deal with this.

But for now, using the -b option for badblocks used on mounted filesystems is
strongly recommended.
Comment 7 RHEL Product and Program Management 2007-10-19 15:06:28 EDT
This bug is filed against RHEL 3, which is in maintenance phase.
During the maintenance phase, only security errata and select mission
critical bug fixes will be released for enterprise products. Since
this bug does not meet that criteria, it is now being closed.
 
For more information of the RHEL errata support policy, please visit:
http://www.redhat.com/security/updates/errata/
 
If you feel this bug is indeed mission critical, please contact your
support representative. You may be asked to provide detailed
information on how this bug is affecting you.

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