Bug 480141 - /proc/ppc64/rtas/error_log: read: Invalid argument
Summary: /proc/ppc64/rtas/error_log: read: Invalid argument
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel
Version: 4.7
Hardware: ppc64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Red Hat Kernel Manager
QA Contact: Martin Jenner
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-01-15 11:38 UTC by Qian Cai
Modified: 2009-01-16 08:48 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-01-16 08:48:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Qian Cai 2009-01-15 11:38:19 UTC
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 Qian Cai 2009-01-15 14:56:58 UTC
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 Qian Cai 2009-01-16 08:48:24 UTC
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.