Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp285390ybl; Thu, 23 Jan 2020 23:51:29 -0800 (PST) X-Google-Smtp-Source: APXvYqxGVLnb3Uy4+dtE/ysW7mAUhi7B8aASsN1T5iqme0ytA0Mh9LcWqYRSwhM71jVTWn+n/P/L X-Received: by 2002:a05:6808:8f5:: with SMTP id d21mr1273279oic.58.1579852289146; Thu, 23 Jan 2020 23:51:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579852289; cv=none; d=google.com; s=arc-20160816; b=aFsQWv8cE8pC7KIIdKBG32Gev44Szf4JlEPSvxIauYIkhIKbWIgJzKoDkHsWehV8bw QptbjomIYIgRdYuoi+pp9lAxvGbwzH1IioxYs9lYZw7EnrqE3skMANsxyIzH5AIBTMlH Y1Kts4E45cAO9enjuVNKtcvBuvaRa8Ojjb1rsFW+r05L+ZxsLHh8C6TYnNmeplVYis11 ee67s9bFgscAqc9qAShk505WniGxQFu5CTkxmbdHFTGI8IUzXXSLIWb5xmUeJqyhKrab 6O04yx2b5c/LEgh4Mkpiy/PE/4IZdnVAgWnfmLSAyRvoD8AzuMULIJdbVrAp6OA60XWV efiQ== 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:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from; bh=3icYdx5HBQ7v7wKYUj1eNNPWq0LDITeywbwBFYtNSwM=; b=kMD6mOgXNhe52sx/ldN0j3eDplMO0Kt5F+d7Ae/rXoql2vTeuAFeKrMGWptmAbPPUb x6fvp0oZGab+W7Fd4TM5SsUSLak/IUNEvsOD/1yH8oWRaY/33UjQ7uliyiM0WJ5Q6/Xk UodSSL8E7l6DIqZr2BLkWuun2gw258cmarktgZICRNnKPk0Ef4PPMqajeMcxgVtqoyyn UEG/tnASxieZvEtRYMcCNbJmnx4MpEAiI/htaIjwoASCXlveU8BFE32Gbe9llllnx4oR J/eyvFEgLAmIL7lF9SKNltN8ELOf3IWN70TxBGJURq+kbe2G4/SAGb2Mvdtdoj9Z2GPF ZuBA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 b17si2361073otl.320.2020.01.23.23.51.16; Thu, 23 Jan 2020 23:51:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1729889AbgAXHr1 (ORCPT + 99 others); Fri, 24 Jan 2020 02:47:27 -0500 Received: from relay.sw.ru ([185.231.240.75]:54378 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725821AbgAXHr1 (ORCPT ); Fri, 24 Jan 2020 02:47:27 -0500 Received: from vvs-ws.sw.ru ([172.16.24.21]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1iutgQ-0008M2-HG; Fri, 24 Jan 2020 10:47:14 +0300 From: Vasily Averin Subject: [PATCH] seq_read: info message about buggy .next functions To: linux-kernel@vger.kernel.org Cc: NeilBrown References: <244674e5-760c-86bd-d08a-047042881748@virtuozzo.com> Message-ID: <7c24087c-e280-e580-5b0c-0cdaeb14cd18@virtuozzo.com> Date: Fri, 24 Jan 2020 10:47:13 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <244674e5-760c-86bd-d08a-047042881748@virtuozzo.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It helps to detect missed or out-of-tree incorect .next seq_file functions https://bugzilla.kernel.org/show_bug.cgi?id=206283 Signed-off-by: Vasily Averin --- fs/seq_file.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/seq_file.c b/fs/seq_file.c index 1600034..07c6909 100644 --- a/fs/seq_file.c +++ b/fs/seq_file.c @@ -256,9 +256,12 @@ ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos) loff_t pos = m->index; p = m->op->next(m, p, &m->index); - if (pos == m->index) - /* Buggy ->next function */ + if (pos == m->index) { + pr_info("buggy seq_file .next function %ps " + "did not updated position index\n", + m->op->next); m->index++; + } if (!p || IS_ERR(p)) { err = PTR_ERR(p); break; -- 1.8.3.1