Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp428157ybl; Thu, 23 Jan 2020 01:05:40 -0800 (PST) X-Google-Smtp-Source: APXvYqzwlHpvnFkyk6VqISkdt+MN5FTPnrniwLfeeRUaS+KbcRRFCffV9e/JncNAhAd4LCsD8Rb3 X-Received: by 2002:a05:6830:44e:: with SMTP id d14mr10090015otc.228.1579770340692; Thu, 23 Jan 2020 01:05:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579770340; cv=none; d=google.com; s=arc-20160816; b=TMLDQa5df5i4p1zhEsgd9XZpIgluDfng859PcLqCIH1N8Rv9d6h9XjLgRuu/Fq1Exm pFCdZA9pkmZfzbqPf5JlEciAgqCXSxtqHTqqIBtG9mlsDdIcAFWo+V/G67NHW0ETJx5L JfFVlukEG9Jpprd3XMtnMOBYBysJH9L0CBZy0hNcx6kZJ1lxPT1u7amtXBmrqt88tr8t c/0mCxwlyu5PQecrttnWrs1Krkbq876WLAvm29P3yV18L16rDdcAX9/0+Ni0e0b/BJ1j 5eJB2tCX8mXSS9DDU6vjsfMmzJgq2eCGgSGI6JdQzLZ3C8jZww9uxfKhtTPoRpRulAeC r3Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:cc:to :subject:from; bh=YSPBWeIvsQyQdTIsNSWaxDtB8VLEoCJCSetT/Yc4me0=; b=rZLolkcWKnjQrGufa7dhssl0vnrwQgkqZdoWUxogP2uC+cAwrviqL1/kG6x6oWuPf0 D4NdJLF+6GcRNij9t5MbipkN0wxmq7NrPrEe67s/c6PRV9S+8ajNtv8gPEpdbSmJJ5OO UQ+qcT5NEjR7wPMutxqYTOH33853r+0m7EJ0yAL1HBKhSG1EUX6mIelIPUklSnqh56B4 c0Lfj73Bdp7Ss4RwQh7sLZPcVSeJlinHBgACdxIu4YUvjaKd8VhzHfKdEBOB6Yk0sjpn smOF/IYK/3UT7tUbYl5nwmw770ckD8wgnji+morENkT8KsxeKrBcs13Ky0gx4bATqKO2 OePg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l26si784636oti.152.2020.01.23.01.05.20; Thu, 23 Jan 2020 01:05:40 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726170AbgAWJFR (ORCPT + 99 others); Thu, 23 Jan 2020 04:05:17 -0500 Received: from relay.sw.ru ([185.231.240.75]:39818 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726188AbgAWJFR (ORCPT ); Thu, 23 Jan 2020 04:05:17 -0500 Received: from vvs-ws.sw.ru ([172.16.24.21]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1iuYQJ-0006pD-8x; Thu, 23 Jan 2020 12:05:11 +0300 From: Vasily Averin Subject: [PATCH 1/1] jbd2_seq_info_next should increase position index To: linux-ext4@vger.kernel.org, Theodore Ts'o Cc: Jan Kara Message-ID: Date: Thu, 23 Jan 2020 12:05:10 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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 --- 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