lkml.org 
[lkml]   [2009]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH] splice: fix deadlock
On Sun, Jan 18 2009, Vegard Nossum wrote:
> From 8e1d58b03b47d937bc5e53d902bac6e690709034 Mon Sep 17 00:00:00 2001
> From: Vegard Nossum <vegard.nossum@gmail.com>
> Date: Sun, 18 Jan 2009 16:07:29 +0100
> Subject: [PATCH] splice: fix deadlock
>
> splice from a file or socket needs to lock both the file/socket and the
> pipe inodes. pipe_wait() unlocks only the pipe lock, regardless of the
> order in which they were taken.
>
> This patch adds an additional (optional) argument to pipe_wait(); if
> specified, pipe_wait() will unlock and reacquire both inode locks.
>
> It fixes the lockup that occurs with the test-case below, but please
> review carefully. Consider this patch a proposal rather than a fix.

Thanks for the bug report and test case, it is indeed buggy! Good
spotting. I'll review your patch thoroughly and test it, and then
integrate your patch.

--
Jens Axboe



\
 
 \ /
  Last update: 2009-01-18 19:25    [W:0.048 / U:0.724 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site