From patchwork Thu Feb 27 13:36:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 230229 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F133C35E1C for ; Thu, 27 Feb 2020 14:36:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0D7EB2469C for ; Thu, 27 Feb 2020 14:36:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582814188; bh=UKNtu5XRs/pDceewTzCYEE9giWtipSmHD1MFay/pACc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=evjL7idVqyGhK1lDpYChaZ9ic5P7laHOwFZczYd7bB6VeobwRbYgypF4cvuUZaTRz /dwIEFm6/U1mgDczzqwjy9k9cEJ1H3UQSlh3xIzmm37ihNtkfKnHwPepQyQiIA8+5y yp1J6lxSrsQtYGFOupHSgJHpndBq0XvToNLtzCm0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731375AbgB0OgX (ORCPT ); Thu, 27 Feb 2020 09:36:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:60454 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732563AbgB0N7G (ORCPT ); Thu, 27 Feb 2020 08:59:06 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1795A2073D; Thu, 27 Feb 2020 13:59:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582811945; bh=UKNtu5XRs/pDceewTzCYEE9giWtipSmHD1MFay/pACc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ip2KPLxBLY2JSiuBIcQPdO2kmRcjpF3gRtqxTllXcsaYlAnfF86Vimc20/x0pTRmE 1QaQQ7jsELPUTOhkcpIZJ9AwHWGWOjSRYTiLkQq8UOntghxFzQf3sg1vVT9pQHOI8r CZUyWvgjs2kprCXdME1eaRjSkFGFZHmgzXMabbeE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vasily Averin , Mike Marshall , Sasha Levin Subject: [PATCH 4.14 163/237] help_next should increase position index Date: Thu, 27 Feb 2020 14:36:17 +0100 Message-Id: <20200227132308.489928813@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200227132255.285644406@linuxfoundation.org> References: <20200227132255.285644406@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Vasily Averin [ Upstream commit 9f198a2ac543eaaf47be275531ad5cbd50db3edf ] if seq_file .next fuction does not change position index, read after some lseek can generate unexpected output. https://bugzilla.kernel.org/show_bug.cgi?id=206283 Signed-off-by: Vasily Averin Signed-off-by: Mike Marshall Signed-off-by: Sasha Levin --- fs/orangefs/orangefs-debugfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/orangefs/orangefs-debugfs.c b/fs/orangefs/orangefs-debugfs.c index 1c59dff530dee..34d1cc98260d2 100644 --- a/fs/orangefs/orangefs-debugfs.c +++ b/fs/orangefs/orangefs-debugfs.c @@ -305,6 +305,7 @@ static void *help_start(struct seq_file *m, loff_t *pos) static void *help_next(struct seq_file *m, void *v, loff_t *pos) { + (*pos)++; gossip_debug(GOSSIP_DEBUGFS_DEBUG, "help_next: start\n"); return NULL;