Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp529364ybl; Thu, 23 Jan 2020 03:16:38 -0800 (PST) X-Google-Smtp-Source: APXvYqyN/hLDfzRa6co435Mmd65YrCSBUPXLUqAWK2Mga40PHETicbh8gQ2EL6Ei2YC8u5juRaw/ X-Received: by 2002:a9d:7f83:: with SMTP id t3mr10457741otp.115.1579778198178; Thu, 23 Jan 2020 03:16:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579778198; cv=none; d=google.com; s=arc-20160816; b=JK3M0EgkgPmEKXs8wQCwwuAkPi9UNxE97tAmsjAr8s3tEIq0CyCEbXOXJcABjshRTS N7YMCM3dmoUNiPOUSE10aTIIhb2OmURmUcAB4BnBp4/iIP8sef0DlPC5RxQs93auCAv9 IE0sU5WzODBwehKBFlQEDIhQykI0kwESyP+InEZl/5QJnsP52TBPfy/Zeuzoao9wkTlg KAcyhSn9K9/3NMHmB1b21WwToz1xO0Jct7R7nqbz5QEjP7VBvrmIRGD3noLYJDRjAb0p UOpoeaVRLet+lbcTMxSwdMGKnpaZvgqEuwkFnJlsG56xMV+EG9d8ncHMUHz6eZ9mk/V5 /2ww== 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=dgP+Fe61SBjymK4DELftuRGj3a9B0X5Pnot0s9lv2Cw=; b=DCw05WEgpkoSa/Hchzh0zXw0bu8qyxY+2KQqW0eTnYkGIMzjM5pnCFzeWo/HWnaN4Y ODVx+nK/FjXySWX38uj4+Cj4g1mVLJ1BdpbrcN52SrmR/qumv+eiRnjyHw32gOUH0It2 vUwruhmH+St3wqIuMa3UQPIeg1WYu3pXDhjZp445u666irTzxdjxEtT04eRsUlGk/LYv C3LGCF3PaAIMGN8GxFDtoLsvYGCLMjZrJghPAP5CqR2cEd6x0Zzc7KliI0+xEq/egOnu cXuVXDF+Maxk/AW3Ruz9WbmCjkYxUz6CLkLMcQO2SAFwd38LoY/5UGIYpGLpvy1RENqy 9rUA== 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 l189si677325oih.166.2020.01.23.03.16.16; Thu, 23 Jan 2020 03:16:38 -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 S1726219AbgAWLPw (ORCPT + 99 others); Thu, 23 Jan 2020 06:15:52 -0500 Received: from mx2.suse.de ([195.135.220.15]:54290 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726026AbgAWLPv (ORCPT ); Thu, 23 Jan 2020 06:15:51 -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 31D0EB260; Thu, 23 Jan 2020 11:15:50 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id E21241E0B01; Thu, 23 Jan 2020 12:15:43 +0100 (CET) Date: Thu, 23 Jan 2020 12:15:43 +0100 From: Jan Kara To: Vasily Averin Cc: 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: <20200123111543.GC5728@quack2.suse.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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 > 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