From owner-freebsd-fs@freebsd.org Wed Dec 21 04:00:47 2016 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE007C8A881 for ; Wed, 21 Dec 2016 04:00:47 +0000 (UTC) (envelope-from 010001591f89c531-9df17b6f-0a7d-421b-89eb-c3bfa8da6b9a-000000@amazonses.com) Received: from a8-176.smtp-out.amazonses.com (a8-176.smtp-out.amazonses.com [54.240.8.176]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9460D1598 for ; Wed, 21 Dec 2016 04:00:46 +0000 (UTC) (envelope-from 010001591f89c531-9df17b6f-0a7d-421b-89eb-c3bfa8da6b9a-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=vnqrkfnvu6csdl6mwgk5t6ix3nnepx57; d=tarsnap.com; t=1482292839; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=x+7g5jupKI639KOd9WT/hSrJcQLZtu0/AKGiuM5d1xs=; b=py60HILIRBthrly6176nbUu/qm6cl772DsSo25azwPZnFFDM1ZPhvlfYqK+4URR7 A9CYVtYK2M5AaL0JTabRVy0i/62DotLYmhfYtZ1vS5NBcJf+NtAmkhgHmoZy7q2f4nk byFSLA7fiPMhaE8kHAtvdTqYkOtRQ6Fr3qus2eDY= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1482292839; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=x+7g5jupKI639KOd9WT/hSrJcQLZtu0/AKGiuM5d1xs=; b=vG1eEpWEb+1x61Ch7adSq+ti4VxXT8+iqYU3HuV4Ca20zbtexYUS3yZH/kF230Wu o5EcreIAEuYVazuSxRIk4PLBwHrI/EKaZIx8uM/Vy8RLQcZPRQ+AXAerByPRIWkDS+k 8/Pmc1afWHGmbvZT+0XqGKVHmX3dEBcpMit6krGc= Subject: Re: ESTALE after cwd deleted by same NFS client To: Don Lewis , rmacklem@uoguelph.ca References: <201612210325.uBL3PVtg006345@gw.catspoiler.org> Cc: freebsd-fs@freebsd.org From: Colin Percival Message-ID: <010001591f89c531-9df17b6f-0a7d-421b-89eb-c3bfa8da6b9a-000000@email.amazonses.com> Date: Wed, 21 Dec 2016 04:00:39 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: <201612210325.uBL3PVtg006345@gw.catspoiler.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2016.12.21-54.240.8.176 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2016 04:00:47 -0000 On 12/20/16 19:25, Don Lewis wrote: >>> Colin Percival wrote: >>>> In UFS there are checks for effnlink == 0 which result in e.g. ufs_lookup >>>> returning ENOENT; would it make sense to add NREMOVED to struct nfsnode.n_flag >>>> and check this in the appropriate nfs_* calls? > > It sort of seems like this should be handled at the vfs level. Once > rmdir() succeeds, there should be no calls to the underlying fs code. > Maybe add a deleted flag to the vnode ... Or perhaps to the nfsnode, as I suggested a few emails ago? > Dunno how ufs and zfs handle this, but the right thing happens: I haven't looked at ZFS, but in UFS there are checks for effnlink == 0 which result in calls returning ENOENT. -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid