public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Jens Axboe <axboe@suse.de>, Eric Dumazet <dada1@cosmosbay.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] splice: fix deadlock
Date: Sun, 18 Jan 2009 19:20:43 +0100	[thread overview]
Message-ID: <20090118182042.GD30821@kernel.dk> (raw)
In-Reply-To: <20090118153221.GA20980@localhost.localdomain>

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


  reply	other threads:[~2009-01-18 18:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-18 15:32 [RFC][PATCH] splice: fix deadlock Vegard Nossum
2009-01-18 18:20 ` Jens Axboe [this message]
2009-04-06 18:56   ` Pekka Enberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090118182042.GD30821@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=axboe@suse.de \
    --cc=dada1@cosmosbay.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vegard.nossum@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox