xfs
[Top] [All Lists]

Re: [PATCH 04/11] splice: lift pipe_lock out of splice_to_pipe()

To: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Subject: Re: [PATCH 04/11] splice: lift pipe_lock out of splice_to_pipe()
From: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 23 Sep 2016 12:45:53 -0700
Cc: Dave Chinner <david@xxxxxxxxxxxxx>, CAI Qian <caiqian@xxxxxxxxxx>, linux-xfs <linux-xfs@xxxxxxxxxxxxxxx>, xfs@xxxxxxxxxxx, Jens Axboe <axboe@xxxxxxxxx>, Nick Piggin <npiggin@xxxxxxxxx>, linux-fsdevel <linux-fsdevel@xxxxxxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=SQLeVweDZCgIXcCtPchXyxuHhz8iItANZdDotlPBQGw=; b=tIt7rCC5S2hFDPxNuJJTl7+lNmyMB1DmKjEhmdsn3oJyDkbSKfLBSEy8cwYQ31cQy3 Yg4d9Z68yDGUrWzgY6ThKgJgFBZ8P6SfMoVIy61TavMaoL0IO9rTMRTcBrVzdyX4Bimu vISBfEnobNuBMS/t25x44pQe/yPgbKkqa8oLxgeMLiWlk832/wMjBMabF8Zzg0l7zmmr UlLUKkfwX2VzYc0xiOUCVaCjNiypdmYpIzY6zn8k91W1+xUgrgNdjIafNVk/m+zuU5wA IJy6r3pIagaWZCHULTGIagJSfeX6PHMauTl4wsJaxdZDQd23CtOQZxDK4sDybjV5VjhJ p0IQ==
In-reply-to: <20160923190326.GB2356@xxxxxxxxxxxxxxxxxx>
References: <20160909023452.GO2356@xxxxxxxxxxxxxxxxxx> <CA+55aFwHQMjO4-vtfB9-ytc=o+DRo-HXVGckvXLboUxgpwb7_g@xxxxxxxxxxxxxx> <20160909221945.GQ2356@xxxxxxxxxxxxxxxxxx> <CA+55aFzTOOB6oEVaaGD0N7Uznk-W9+ULPwzsxS_L_oZqGVSeLA@xxxxxxxxxxxxxx> <20160914031648.GB2356@xxxxxxxxxxxxxxxxxx> <CA+55aFznQaOWoSMNphgGJJWZ=8-odrc0DAUMzfGPQe+_N4UgNA@xxxxxxxxxxxxxx> <20160914042559.GC2356@xxxxxxxxxxxxxxxxxx> <20160917082007.GA6489@xxxxxxxxxxxxxxxxxx> <20160917190023.GA8039@xxxxxxxxxxxxxxxxxx> <20160923190032.GA25771@xxxxxxxxxxxxxxxxxx> <20160923190326.GB2356@xxxxxxxxxxxxxxxxxx>
Sender: linus971@xxxxxxxxx
On Fri, Sep 23, 2016 at 12:03 PM, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
> @@ -1421,8 +1406,25 @@ static long do_splice(struct file *in, loff_t __user 
> *off_in,
> +               ret = 0;
> +               pipe_lock(opipe);
> +               bogus_count = opipe->buffers;
> +               do {
> +                       bogus_count += opipe->nrbufs;
> +                       ret = do_splice_to(in, &offset, opipe, len, flags);
> +                       if (ret > 0) {
> +                               total += ret;
> +                               len -= ret;
> +                       }
> +                       bogus_count -= opipe->nrbufs;
> +                       if (bogus_count <= 0)
> +                               break;

I was like "oh, I'm sure this is some temporary hack, it will be gone
by the end of the series".

It wasn't gone by the end.

There's two copies of that pattern, and at the very least it needs a
big comment about what this pattern does and why.

But other than that reaction, I didn't get any hives from this. I
didn't *test* it, only looking at patches, but no red flags I could
notice.

               Linus

<Prev in Thread] Current Thread [Next in Thread>