From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752299AbcF3Jch (ORCPT ); Thu, 30 Jun 2016 05:32:37 -0400 Received: from verein.lst.de ([213.95.11.211]:59868 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751865AbcF3Jcf (ORCPT ); Thu, 30 Jun 2016 05:32:35 -0400 Date: Thu, 30 Jun 2016 11:32:32 +0200 From: Christoph Hellwig To: Tal Shorer Cc: "" , Joel Becker , hch@lst.de Subject: Re: Possible unwanted behaviour in configfs Message-ID: <20160630093232.GA9287@lst.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 25, 2016 at 12:43:34PM +0300, Tal Shorer wrote: > I traced this to the function configfs_read_file in fs/configfs/file.c > and have two fixes in mind: > 1. In fill_read_buffer(), If an error is returned by show(), don't set > buffer->needs_read_fill to zero, making the next read() call show() > again and either get an error or data. > 2. Add an "err" field to struct configfs_buffer and keep the returned > error from show() there. Any additional read() on this file will > return this error. > > Any thoughts? I think fix 1 is a good idea and I'd love to see a patch for it. Fix 2 might be problematic as the errors don't need to be persistent, but I think fix 1 alone should be enough anyway.