Bug 480141

Summary: /proc/ppc64/rtas/error_log: read: Invalid argument
Product: Red Hat Enterprise Linux 4 Reporter: Qian Cai <qcai>
Component: kernelAssignee: Red Hat Kernel Manager <kernel-mgr>
Status: CLOSED NOTABUG QA Contact: Martin Jenner <mjenner>
Severity: low Docs Contact:
Priority: low    
Version: 4.7CC: vmayatsk
Target Milestone: rc   
Target Release: ---   
Hardware: ppc64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-16 08:48:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.