From patchwork Tue Oct 25 20:50:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Weinberger X-Patchwork-Id: 79275 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp68720qge; Tue, 25 Oct 2016 13:50:25 -0700 (PDT) X-Received: by 10.99.53.75 with SMTP id c72mr35602300pga.168.1477428625422; Tue, 25 Oct 2016 13:50:25 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id su1si18859288pab.291.2016.10.25.13.50.25; Tue, 25 Oct 2016 13:50:25 -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; 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 S1759550AbcJYUuW (ORCPT + 27 others); Tue, 25 Oct 2016 16:50:22 -0400 Received: from b.ns.miles-group.at ([95.130.255.144]:44723 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751573AbcJYUuV (ORCPT ); Tue, 25 Oct 2016 16:50:21 -0400 Received: (qmail 20599 invoked by uid 89); 25 Oct 2016 20:50:18 -0000 Received: by simscan 1.3.1 ppid: 20593, pid: 20597, t: 0.0513s scanners: attach: 1.3.1 Received: from unknown (HELO ?192.168.0.14?) (richard@nod.at@213.47.184.186) by radon.swed.at with ESMTPA; 25 Oct 2016 20:50:18 -0000 Subject: Re: Regression caused by commit c83ed4c9dbb3 "ubifs: Abort readdir on error" To: Peter Rosin , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org References: From: Richard Weinberger Message-ID: <2e3cf9f7-d747-7129-455f-a1105f5474de@nod.at> Date: Tue, 25 Oct 2016 22:50:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Peter, On 25.10.2016 22:09, Richard Weinberger wrote: >> /bin/mkdir -p /mnt/ovl/ovl >> /bin/mkdir -p /mnt/ovl/work >> # with c83ed4c9dbb3, the following mount fails with >> # mount: mounting overlay on /mnt/merge failed: No such file or directory >> /bin/mount -t overlay -o lowerdir=/,upperdir=/mnt/ovl/ovl,workdir=/mnt/ovl/work overlay /mnt/merge > > Uhhhh! Thanks for catching this. > I think I know what is going on, the fix exposes now internal UBIFS return codes to VFS. > Let me prepare a fix. Does the attached patch cure the issue? Thanks, //richard diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index bd4a5e8ce441..ca16c5d7bab1 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -543,6 +543,14 @@ static int ubifs_readdir(struct file *file, struct dir_context *ctx) if (err != -ENOENT) ubifs_err(c, "cannot find next direntry, error %d", err); + else + /* + * -ENOENT is a non-fatal error in this context, the TNC uses + * it to indicate that the cursor moved past the current directory + * and readdir() has to stop. + */ + err = 0; + /* 2 is a special value indicating that there are no more direntries */ ctx->pos = 2;