Bug 480141 - /proc/ppc64/rtas/error_log: read: Invalid argument
/proc/ppc64/rtas/error_log: read: Invalid argument
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
4.7
ppc64 Linux
low Severity low
: rc
: ---
Assigned To: Red Hat Kernel Manager
Martin Jenner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-15 06:38 EST by CAI Qian
Modified: 2009-01-16 03:48 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-16 03:48:50 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)

  None (edit)
Description CAI Qian 2009-01-15 06:38:19 EST
Description of problem:
# uname -a
Linux squad3.rhts.bos.redhat.com 2.6.9-78.0.13.EL #1 SMP Wed Jan 7 17:25:20 EST 2009 ppc64 ppc64 ppc64 GNU/Linux

# cat rtas.c 
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>

int
main (void)
{
  int fd;
  char buf[4096];

  fd = open ("/proc/ppc64/rtas/error_log", O_RDONLY | O_NONBLOCK);
  read (fd, buf, 4096); 
  perror ("read");
  return 0;
}

# gcc rtas.c -o rtas

# ./rtas
read: Invalid argument

It looks like this only happen the first time. Next time running the reproducer (not matter reboot the machine or not, boot a different kernel or not), it will hang forever, which indicates the same bug in RHEL 5.

Bug 376831 -  Read from /proc/ppc64/rtas/error_log does not honor O_NONBLOCK

Version-Release number of selected component (if applicable):
kernel-2.6.9-78.0.13.EL
kernel-2.6.9-78.EL

How reproducible:
always
Comment 4 CAI Qian 2009-01-15 09:56:58 EST
Vitaly, you can see from comment #0, and also the LTP test from comment #1 were both using 4096 as the buffer size, so perhaps it is still not large enough?
Comment 5 CAI Qian 2009-01-16 03:48:24 EST
You are correct. A bigger buffer like 40960 works fine.

# ./rtas 
read: Success
# ./rtas
read: Resource temporarily unavailable
# ./rtas
read: Resource temporarily unavailable
# ./rtas
read: Resource temporarily unavailable

So this should be closed as NOTABUG and send a patch to LTP instead. Thanks.

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