Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp4655727ybh; Tue, 6 Aug 2019 15:43:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrh2rk/lqO86TSTmrDXaQStEsJGYzBOVZbTB/qsHqkx0Yzl9HhXrua8LLhmlqXob9NWWG6 X-Received: by 2002:aa7:9a92:: with SMTP id w18mr6063023pfi.167.1565131411805; Tue, 06 Aug 2019 15:43:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565131411; cv=none; d=google.com; s=arc-20160816; b=nAzJG+MxC9VwTdsauWhONuhgn605nTF0naqgDbyivDrIoIR8fPinTphO3Gmh7sa3iJ +QAliRCwSdbvY1XO/5VNuoOjcpsM24vAium3WM+j8A5kV8X4C8MZwvur2qTtlKi0VtPP EjjwMP8PefruiAhCGZY9ZVasAt4SgyMQ/pAdbcL/UHx6Kh8vaLbwGnmAMFraEYwV4Wiq xbeEBOSUW3M6wxsxYxqH/t1oblq6Ms9ib/TzcG0Mrax1lQh+rFYZlWxkV4CJsppUJhTE SP5TUipadcNAJJBHyR/y8v6EmLZYY6QjZ0IP2snP/QTTanwpyPxk34KsNTL4XW5cCi8F 8MCg== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=PnfhT3YzRmz35cH8ZOrR6oP4yHb98Vh83kbdIRLjI/k=; b=ICTLdK22POpay1g73R08g1bRYsxL443zyDN0TRDfCR2Y59uE1rhrDBfqrs+T67CKPq uZSxSUdTF4glja2n84s2/IyOw4vSaiv4kb0ep8PFPeMlxiCpSzcLRLo2roRz7xTQac2O enYY+ThxaWwbhjBTCZ6Fn1LoULLFM/OMnOhRD8906ccksJRlR3xihPuctmrNbN46GE6b +zORdVoPj2pJsVbEIh9Lm8yoU1iTD1Tiq00GmZuvCLM3dPICfXftHCnw1pb+oHrt35WW TlGYOHPjvDv9wSaIKG7g5wMeGdSSJsJZThNmw3niqW+5QqLwapdlCiy+bk5tZOka10qr yybg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cRh0QGv3; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9si1956468pgv.225.2019.08.06.15.43.16; Tue, 06 Aug 2019 15:43:31 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=cRh0QGv3; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727123AbfHFWmf (ORCPT + 99 others); Tue, 6 Aug 2019 18:42:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:50214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725974AbfHFWmf (ORCPT ); Tue, 6 Aug 2019 18:42:35 -0400 Received: from localhost.localdomain (c-73-223-200-170.hsd1.ca.comcast.net [73.223.200.170]) (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 59715216F4; Tue, 6 Aug 2019 22:42:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565131354; bh=EknRqymxoTJDoep6zXcHd2kEz6NOkgX5lpboEZyvK0A=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cRh0QGv3KwTTqbv+C7Ks/mBaeOIGhCJHLj3nOSKzHlIKAhpFAmN1MWab7DWF8nx8I WHnTV4WsnnbNtCgS8xeKytBXCWAIaXnnmy/UCklx3tamhutLFKYv1VtIrbLYJTnU7d YG5Jq9zrIGWI62RQa/qPahOdYTKYpqWdHbsu9V0s= Date: Tue, 6 Aug 2019 15:42:33 -0700 From: Andrew Morton To: NeilBrown Cc: Alexander Viro , Sergei Turchanov , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] seq_file: fix problem when seeking mid-record. Message-Id: <20190806154233.5b16a91fd27c6cf129770566@linux-foundation.org> In-Reply-To: <87mugojl0f.fsf@notabene.neil.brown.name> References: <3bd775ab-9e31-c6b3-374e-7a9982a9a8cd@farpost.com> <5c4c0648-2a96-4132-9d22-91c22e7c7d4d@huawei.com> <877e7xl029.fsf@notabene.neil.brown.name> <2d54ca59-9c22-0b75-3087-3718b30b8d11@farpost.com> <87mugojl0f.fsf@notabene.neil.brown.name> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 05 Aug 2019 14:26:08 +1000 NeilBrown wrote: > If you use lseek or similar (e.g. pread) to access > a location in a seq_file file that is within a record, > rather than at a record boundary, then the first read > will return the remainder of the record, and the second > read will return the whole of that same record (instead > of the next record). > Whnn seeking to a record boundary, the next record is > correctly returned. ouch. I'm surprised it took this long to be noticed. Maybe we need a seqfile-basher in tools/testing/selftests/proc or somewhere.