Vitaly Mayatskikh <v.mayatskih@gmail.com> writes:Sorry, wrong patch :( Signed-off-by: Vitaly Mayatskikh <v.mayatskih@gmail.com> diff --git a/arch/powerpc/platforms/pseries/rtasd.c b/arch/powerpc/platforms/pseries/rtasd.c index 7d3e2b0..3343211 100644 --- a/arch/powerpc/platforms/pseries/rtasd.c +++ b/arch/powerpc/platforms/pseries/rtasd.c @@ -291,21 +291,24 @@ static ssize_t rtas_log_read(struct file * file, char __user * buf, if (!access_ok(VERIFY_WRITE, buf, count)) return -EFAULT; - tmp = kmalloc(count, GFP_KERNEL); - if (!tmp) - return -ENOMEM; - - spin_lock_irqsave(&rtasd_log_lock, s); /* if it's 0, then we know we got the last one (the one in NVRAM) */ - if (rtas_log_size == 0 && logging_enabled) + if (rtas_log_size == 0 && logging_enabled) { nvram_clear_error_log(); + if (file->f_flags & O_NONBLOCK) { + spin_unlock_irqrestore(&rtasd_log_lock, s); + return -EAGAIN; + } + } spin_unlock_irqrestore(&rtasd_log_lock, s); - error = wait_event_interruptible(rtas_log_wait, rtas_log_size); if (error) - goto out; + return error; + + tmp = kmalloc(count, GFP_KERNEL); + if (!tmp) + return -ENOMEM; spin_lock_irqsave(&rtasd_log_lock, s); offset = rtas_error_log_buffer_max * (rtas_log_start & LOG_NUMBER_MASK); -- wbr, Vitaly --
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| David Miller | Re: [RFC/PATCH] Documentation of kernel messages |
| Tony Lindgren | [PATCH 48/90] ARM: OMAP: I2C-1 init fix for 2430 |
git: | |
| Josip Rodin | bnx2_poll panicking kernel |
| Gerrit Renker | [PATCH 03/37] dccp: List management for new feature negotiation |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
