From owner-freebsd-fs@freebsd.org Thu Dec 22 01:27:24 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 F1A28C8BAAA for ; Thu, 22 Dec 2016 01:27:24 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0059.outbound.protection.outlook.com [104.47.41.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB0F9D7A; Thu, 22 Dec 2016 01:27:23 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM (10.165.218.133) by YTXPR01MB0192.CANPRD01.PROD.OUTLOOK.COM (10.165.218.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.789.14; Wed, 21 Dec 2016 23:52:59 +0000 Received: from YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM ([10.165.218.133]) by YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM ([10.165.218.133]) with mapi id 15.01.0789.018; Wed, 21 Dec 2016 23:52:59 +0000 From: Rick Macklem To: Don Lewis CC: "cperciva@tarsnap.com" , "freebsd-fs@freebsd.org" Subject: Re: ESTALE after cwd deleted by same NFS client Thread-Topic: ESTALE after cwd deleted by same NFS client Thread-Index: AQHSVANFVKFixagVOUGZ8mLDXQwbl6EDzQuAgAC4aM2AAVLGrIABN7mAgABdEGCAAjtv0oAFKIhagAEJ9wSAAJ6iAIABFdOMgAA8WICAAVBkMg== Date: Wed, 21 Dec 2016 23:52:59 +0000 Message-ID: References: , <201612210325.uBL3PVtg006345@gw.catspoiler.org> In-Reply-To: <201612210325.uBL3PVtg006345@gw.catspoiler.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-ms-office365-filtering-correlation-id: a69b3b2c-aae7-47f6-7996-08d429fc7e88 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:YTXPR01MB0192; x-microsoft-exchange-diagnostics: 1; YTXPR01MB0192; 7:9XtLcnJV16sHMG3chPvjNElszB8vHLEZOBXXwVLW56+D1OEvx9kaxAaGTqW6CFAhjFkFXk4t0BMLpU02eeexEYAM4CNgSatnGFKVV07fuJOeqXZPBPgKWiBNgJHkOreAe6PFdPbvverDiLNsnKkTUKlsepvRmrCc0zCIv+s9rj+XxMWKzWfaFj2cN1N1h2zMlkir4d3pqfTcdtugS8iKlq6JEg3yuDKCtHThjoSU6UGJXreyAHXw6C3xbUM1+JnfSbsFD+wOwf/vd8xZoIwuwNbgRY5K8ECGWtI67ajU5RhatoS1OCdZBdSuWQhPxz9DWAyK18sjcQUrZq8zVqo0SIaA7uQKD18M0YYBNaGt70m40sCbmC6ba5J2mPNfVfqr4pat7QSpFcL8DfHm0lBIYoRuCpHeZtqedrmtK6U9xHAENhQ7pK9uvSqWvOkaI/OuY+9oWNbt/0C4c5Gk0+hdxA== x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040375)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123564025)(20161123560025)(20161123562025)(20161123555025)(6072148); SRVR:YTXPR01MB0192; BCL:0; PCL:0; RULEID:; SRVR:YTXPR01MB0192; x-forefront-prvs: 01630974C0 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39450400003)(189002)(24454002)(199003)(77096006)(6436002)(8936002)(8676002)(92566002)(2906002)(305945005)(81156014)(81166006)(229853002)(38730400001)(105586002)(2900100001)(54356999)(122556002)(76176999)(74482002)(68736007)(106356001)(9686002)(3280700002)(102836003)(50986999)(6506006)(3660700001)(106116001)(101416001)(110136003)(2950100002)(6916009)(97736004)(7696004)(5660300001)(33656002)(4326007)(86362001)(74316002)(189998001); DIR:OUT; SFP:1101; SCL:1; SRVR:YTXPR01MB0192; H:YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Dec 2016 23:52:59.6292 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTXPR01MB0192 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: Thu, 22 Dec 2016 01:27:25 -0000 Don Lewis wrote: [stuff snipped] > Dunno how ufs and zfs handle this, but the right thing happens: > > %mkdir /tmp/barf1 > %cd /tmp/barf1 > %rmdir /tmp/barf1 > %touch barf2 > touch: barf2: No such file or directory > %ls I tried this as "root" (the only user that matters;-) on a UFS file system = and got the above, but also observed a couple of interesting things: 1 - "ls -a" returned without showing "." or "..". 2 - "cat -v ." worked and showed a directory block with "." and ".." in it. The entries looked valid and did not have d_fileno =3D=3D 0. If root does a getdents() it returns a 0 reply instead of the directory blo= ck with "." and ".." in it. I think this explains why "ls -a" shows nothing, b= ut does not see an error. (getdents() would return -1 for an error, but it returns = 0 for EOF on the directory.) I suppose that nfs_readdir() could fake #1 by just returning without an err= or (ie no data) when it gets ESTALE. I don't think support of #2 is required? Not a POSIX guy, so I don't know what POSIX defines/expects for this case? rick