From patchwork Wed Nov 23 22:20:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Bruce Fields" X-Patchwork-Id: 9444441 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4909A6075F for ; Wed, 23 Nov 2016 22:20:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40BF127DCE for ; Wed, 23 Nov 2016 22:20:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3330527E15; Wed, 23 Nov 2016 22:20:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9218327DCE for ; Wed, 23 Nov 2016 22:20:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933721AbcKWWU4 (ORCPT ); Wed, 23 Nov 2016 17:20:56 -0500 Received: from fieldses.org ([173.255.197.46]:57738 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933657AbcKWWUz (ORCPT ); Wed, 23 Nov 2016 17:20:55 -0500 Received: by fieldses.org (Postfix, from userid 2815) id 37D304CAD; Wed, 23 Nov 2016 17:20:54 -0500 (EST) Date: Wed, 23 Nov 2016 17:20:54 -0500 To: linux-fsdevel@vger.kernel.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH xfstests] dirstress: Allow ESTALE as well as ENOENT Message-ID: <20161123222054.GA7900@fieldses.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "J. Bruce Fields" In the NFS case an attempt to chdir out of a removed directory could result in ESTALE, and that should not cause the test to fail. This was causing intermittent failures on generic/011 on NFS. Signed-off-by: J. Bruce Fields --- src/dirstress.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) Sorry, who do xfstests patches go to?--b. diff --git a/src/dirstress.c b/src/dirstress.c index f8f7355..33a166c 100644 --- a/src/dirstress.c +++ b/src/dirstress.c @@ -203,8 +203,10 @@ dirstress( if (verbose) fprintf(stderr,"** [%d] chdir ..\n", pid); error = chdir(".."); if (error) { - /* If this is multithreaded, then expecting a ENOENT here is fine */ - if (nprocs_per_dir > 1 && errno == ENOENT) { + /* If this is multithreaded, then expecting a ENOENT here is fine, + * and ESTALE is normal in the NFS case. */ + if (nprocs_per_dir > 1 && + (errno == ENOENT || errno = ESTALE)) { return 0; } @@ -224,8 +226,10 @@ dirstress( if (verbose) fprintf(stderr,"** [%d] chdir ..\n", pid); error = chdir(".."); if (error) { - /* If this is multithreaded, then expecting a ENOENT here is fine */ - if (nprocs_per_dir > 1 && errno == ENOENT) { + /* If this is multithreaded, then expecting a ENOENT here is fine, + * and ESTALE is normal in the NFS case. */ + if (nprocs_per_dir > 1 && + (errno == ENOENT || errno = ESTALE)) { return 0; }