From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941913AbcJYUKG (ORCPT ); Tue, 25 Oct 2016 16:10:06 -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 S932338AbcJYUKE (ORCPT ); Tue, 25 Oct 2016 16:10:04 -0400 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: Date: Tue, 25 Oct 2016 22:09:59 +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: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Peter, On 25.10.2016 21:39, Peter Rosin wrote: > Hi! > > Early on in my boot procedure I create an overlay and shuffle > things around a bit so that the original rootfs stays readonly > at the bottom of an overlayed readwrite fs. This way I can just > toss out the overlayed fs and have a clean and reliable way to > do a "factory-reset". Both the read-only root and and the overlay > are ubifs on nand. > > Bisection points to commit c83ed4c9dbb3 "ubifs: Abort readdir > on error". Reverting that commit on top of v4.9-rc2 fixes things. > > My "shuffle script" is as follows (with an added comment > indicating the first point of failure) and runs as the first > script by init. > > If I add a line > ls -l /mnt || echo "ls -l /mnt failed" > where that comment is right before the failure, I get no failure > indication even with the broken commit, so directory traversal > seems ok. > > Cheers, > Peter > > #! /bin/bash > > test "x$1" == xstart || exit 0 > > mkdir /tmp/log > > /bin/mount -o remount,rw /dev > > /bin/mount | /bin/grep -q "^overlay on / type overlay" && exit 0 > > if test -e /etc/factory-reset; then > /usr/sbin/ubiformat /dev/mtd7 > rm /etc/factory-reset > fi > > /usr/sbin/ubiattach /dev/ubi_ctrl -m 7 > /usr/sbin/ubimkvol /dev/ubi1 -N ovl -m > > /bin/mkdir -p /mnt/ovl > /bin/mkdir -p /mnt/roroot > /bin/mkdir -p /mnt/merge > /bin/mount -t ubifs /dev/ubi1_0 /mnt/ovl > > /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. Thanks, //richard