Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp696924ybl; Thu, 23 Jan 2020 06:13:09 -0800 (PST) X-Google-Smtp-Source: APXvYqwMPyqUkhV+6MWBKTGoqLWmASeQIGGyaZ5JxZgcCerI4ctguMzqk0s4bBNRxE1sw/oFULnf X-Received: by 2002:aca:f305:: with SMTP id r5mr10841796oih.174.1579788789040; Thu, 23 Jan 2020 06:13:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579788789; cv=none; d=google.com; s=arc-20160816; b=da8eA4oFP/YUmrrh4YceWDn49eB9UViNm07znu0Oyg2Kdi3bb412d7UDckKr4hQYLG ThmFBitTE5mlMuJnCeEEEw8nI90zsi26dYzyro0uN3sdCGMSRzuqjmfwjm4YvNwx+Bsx 3lfs2Z+bNKuQRVoj/tTJgdndixxjC/roF+GLxGGJw5eglO0t6SP5m1Y+OuLfWR3x84GE WqEBTFpDnNEMg641+GKnRc2IOXM3tP/AWVXZPfDIvOHo7ZDVLIPnldRCs5AD5cXJaGLZ /WjI2hr7AQG+Y3wkhNt1dQvZJlFvuY7Ki5KwTmMhJYYLRvM/dH4g88Pwn1NEZDd2Hoy1 HYmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=kdiT33hhBUsdKQNuXLednAtcom1E2WGLWBgxIgy/+Hk=; b=YmE4w3a52/QsSlpQtBNvQjyfv7JSdW69QzWaR/dvxFuXbmlfMy0o0FPAEt7fxQByBV pI5MM9EPFK4Q1jHrpznwaaFDTh7rVBZTgfq9xfSFbdwvuRUcOJshdC4sRDofxCi2ISW+ mYcv5HLPo8nY1f1of3JHJH4gICrS/ng8x2D4JLOv9fwd8DnB6AeMqTZYgolPt1xQ6EL7 9UjVGRZ91Tk+fpEOSLepcrSJKaZRcMaspfzaDPD6jxiJPYX2O6z8r77ceA4uooxxGuaa DeBnz8fvmLRsrWIBkwbf+MOadel9ffRmUiuVEB9OqztdGzRQ4akRVOzlqggY3281mkWn QQjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v10si1049287ote.97.2020.01.23.06.12.44; Thu, 23 Jan 2020 06:13:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726232AbgAWOMN (ORCPT + 99 others); Thu, 23 Jan 2020 09:12:13 -0500 Received: from mx2.suse.de ([195.135.220.15]:53476 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726227AbgAWOMN (ORCPT ); Thu, 23 Jan 2020 09:12:13 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CEF66B1BF; Thu, 23 Jan 2020 14:12:11 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id E60F81E0B01; Thu, 23 Jan 2020 15:02:43 +0100 (CET) Date: Thu, 23 Jan 2020 15:02:43 +0100 From: Jan Kara To: Vasily Averin Cc: Jan Kara , linux-ext4@vger.kernel.org, Theodore Ts'o , Jan Kara Subject: Re: [PATCH 1/1] jbd2_seq_info_next should increase position index Message-ID: <20200123140243.GA7914@quack2.suse.cz> References: <20200123111543.GC5728@quack2.suse.cz> <43e6a168-63b6-4a82-7b3d-5dd676b9f9bb@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43e6a168-63b6-4a82-7b3d-5dd676b9f9bb@virtuozzo.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu 23-01-20 14:30:14, Vasily Averin wrote: > > > On 1/23/20 2:15 PM, Jan Kara wrote: > > On Thu 23-01-20 12:05:10, Vasily Averin wrote: > >> if seq_file .next fuction does not change position index, > >> read after some lseek can generate unexpected output. > >> > >> Script below generates endless output > >> $ q=;while read -r r;do echo "$((++q)) $r";done > > > I've just tried and this works for me just fine with openSUSE 15.1 > > (4.12.14-based) kernel. Is it some recent regression? > > I think it depends on > commit 1f4aace60b0e ("fs/seq_file.c: simplify seq_file iteration code and interface") > In OpenVz7 we got complain after backport of this patch. I see. OK. So please add tag: Fixes: 1f4aace60b0e ("fs/seq_file.c: simplify seq_file iteration code and interface") likely also: CC: stable@vger.kernel.org and you can also add: Reviewed-by: Jan Kara Thanks! Honza > > I've reproduced it on last ubuntu kernel > > $ uname -a > Linux vvs-ws 5.3.0-24-generic #26~18.04.2-Ubuntu SMP Tue Nov 26 12:34:22 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux > > $ q=;while read -r r;do echo "$((++q)) $r";done 1 151327 transactions (132200 requested), each up to 65536 blocks > 2 average: > 3 0ms waiting for transaction > 4 0ms request delay > 5 3816ms running transaction > 6 0ms transaction was being locked > 7 0ms flushing data (in ordered mode) > 8 36ms logging transaction > 9 29753us average transaction commit time > 10 1587 handles per transaction > 11 32 blocks per transaction > 12 33 logged blocks per transaction > 13 151327 transactions (132200 requested), each up to 65536 blocks > 14 151327 transactions (132200 requested), each up to 65536 blocks > 15 151327 transactions (132200 requested), each up to 65536 blocks > 16 151327 transactions (132200 requested), each up to 65536 blocks > 17 151327 transactions (132200 requested), each up to 65536 blocks > 18 151327 transactions (132200 requested), each up to 65536 blocks > 19 151327 transactions (132200 requested), each up to 65536 blocks > 20 151327 transactions (132200 requested), each up to 65536 blocks > > >> https://bugzilla.kernel.org/show_bug.cgi?id=206283 > >> Signed-off-by: Vasily Averin > >> --- > >> fs/jbd2/journal.c | 1 + > >> 1 file changed, 1 insertion(+) > >> > >> diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c > >> index 5e408ee..b3e2433 100644 > >> --- a/fs/jbd2/journal.c > >> +++ b/fs/jbd2/journal.c > >> @@ -982,6 +982,7 @@ static void *jbd2_seq_info_start(struct seq_file *seq, loff_t *pos) > >> > >> static void *jbd2_seq_info_next(struct seq_file *seq, void *v, loff_t *pos) > >> { > >> + (*pos)++; > >> return NULL; > >> } > >> > >> -- > >> 1.8.3.1 > >> -- Jan Kara SUSE Labs, CR