From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751106AbdANNYo (ORCPT ); Sat, 14 Jan 2017 08:24:44 -0500 Received: from wylie.me.uk ([82.68.155.94]:40918 "EHLO mail.wylie.me.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751002AbdANNYm (ORCPT ); Sat, 14 Jan 2017 08:24:42 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <22650.9362.298194.720245@wylie.me.uk> Date: Sat, 14 Jan 2017 13:16:02 +0000 X-Clacks-Overhead: GNU Terry Pratchett From: "Alan J. Wylie" To: Al Viro Cc: Linus Torvalds , Thorsten Leemhuis , linux-kernel Subject: Re: 4.9.0 regression in pipe-backed iov_iter with systemd-nspawn In-Reply-To: <20170113225058.GW1555@ZenIV.linux.org.uk> References: <20170113102019.GK1555@ZenIV.linux.org.uk> <20170113111842.GL1555@ZenIV.linux.org.uk> <20170113200826.GP1555@ZenIV.linux.org.uk> <20170113201121.GQ1555@ZenIV.linux.org.uk> <20170113204731.GS1555@ZenIV.linux.org.uk> <20170113215504.GT1555@ZenIV.linux.org.uk> <20170113215919.GU1555@ZenIV.linux.org.uk> <20170113221308.GV1555@ZenIV.linux.org.uk> <20170113225058.GW1555@ZenIV.linux.org.uk> X-Mailer: VM 8.2.0b under 24.5.1 (x86_64-pc-linux-gnu) X-Clacks-Overhead: GNU Terry Pratchett Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org at 22:50 on Fri 13-Jan-2017 Al Viro (viro@ZenIV.linux.org.uk) wrote: > Or, even better, we can get rid of all wraparound-related crap if we > calculate the final value of pipe->nrbufs and watch for _that_ as > loop condition: > > diff --git a/lib/iov_iter.c b/lib/iov_iter.c > index 25f572303801..e68604ae3ced 100644 > --- a/lib/iov_iter.c > +++ b/lib/iov_iter.c > @@ -730,43 +730,50 @@ size_t iov_iter_copy_from_user_atomic(struct page *page, > } > EXPORT_SYMBOL(iov_iter_copy_from_user_atomic); > > +static inline void pipe_truncate(struct iov_iter *i) ... I've dragged an old box out of the storeroom and upgraded and configured it so it reproduced the problem. With the patch, the mail is sent with no hang # uname -a Linux maglor 4.9.3-dirty #3 SMP Sat Jan 14 12:13:45 GMT 2017 x86_64 AMD Athlon(tm) II X2 270 Processor AuthenticAMD GNU/Linux Jan 14 12:56:01 maglor cron[741]: (root) CMD (date; /work/chroot-shared/test.sh; date) Jan 14 12:56:01 maglor postfix/pickup[649]: 8577A604F2: uid=0 from= Jan 14 12:56:01 maglor postfix/cleanup[752]: 8577A604F2: message-id=<20170114125601.8577A604F2@maglor.localdomain> Jan 14 12:56:01 maglor postfix/qmgr[650]: 8577A604F2: from=, size=735, nrcpt=1 (queue active) Jan 14 12:56:01 maglor postfix/smtp[754]: 8577A604F2: to=, orig_to=, relay=frodo.localnet[192.168.21.2]:25, delay=0.54, delays=0.43/0/0.04/0.07, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as A08CC440065) Jan 14 12:56:01 maglor postfix/qmgr[650]: 8577A604F2: removed No other problems are apparent. I'll run this for a bit, then apply it to my workstation (which I'm rather fond of) and make sure there are no new regressions. -- Alan J. Wylie http://www.wylie.me.uk/ Dance like no-one's watching. / Encrypt like everyone is. Security is inversely proportional to convenience