From patchwork Sun Jan 7 18:07:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 10148437 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 B8CCF601BE for ; Sun, 7 Jan 2018 18:07:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE2AA28628 for ; Sun, 7 Jan 2018 18:07:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A288028633; Sun, 7 Jan 2018 18:07:08 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 2F6EC28628 for ; Sun, 7 Jan 2018 18:07:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754355AbeAGSGn (ORCPT ); Sun, 7 Jan 2018 13:06:43 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:34654 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754254AbeAGSGj (ORCPT ); Sun, 7 Jan 2018 13:06:39 -0500 Received: by mail-wm0-f65.google.com with SMTP id y82so12951590wmg.1; Sun, 07 Jan 2018 10:06:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=K/0vSSnmuLh/Z6aJwnUGhLMGzIdqlhyPGQJGDNJS3Uk=; b=YVEZrnThh55bzvZq5MReHxl2cXFay9KuV4LboDvssRoM0Po0jtTmblXilSHdTYx99A F6olIVNMTgQ0g6k57IAiIb0LmKFq4U4867EW3YhDy2VJ2UfwER6NOQFqmaqwqHeLTxh/ O1kcnZJhbB11HE2ea+3xBMcIhE++FbjBdKEmqamQUB6MgbD3mOQT6rBmC80ZaIZEU7Ia TfMqf13wmbyKd6DAWkpFidQR+5czG03/ysbXsENKW6FzQBoJ6QPfWTSkfdzRtqq8KK5u 4E52+pR8Dig1Ogs3v3dEjGUpO7i2waSNtBVVTPuM4VXrEzKoD92HvO/GwsLn4XZIi89z vptA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=K/0vSSnmuLh/Z6aJwnUGhLMGzIdqlhyPGQJGDNJS3Uk=; b=XaovxHcxvv6BXkGBGri0rtEEOPML2xRdSnlR4xdXTVD6mgOKeadmHlr6bb4Q1p4Y0L vSLw2cYrsTwfWYAMqItbHGBMBuEAftZ4fQc1Nha5Q/jVYxFRGBMaO0bBb2ENPwGveLEj abBv+pSeLYPwZTJ1FVEqmogsdQjUNs/mm2Gpxmry6xcR/G4bUhWb8xPp1OMC1GhJ5dW4 s4EZ0CIxwjRBQQyzsfyfHSuLFX7i2LF+3CNyAs7ZM+W3zcFEIwGkcMGDfKTA0CbfG+bB EWiGQiTCarFL2+G1ro4P9tDw/ejtPIG2R5Kn8PdCjp/TNLzrwwAbYm7KARToc29gUZDL Oohg== X-Gm-Message-State: AKGB3mIQYOlhUNWdDzJg/OGg2IHRZMqEoOpVgdFLqbttOCQCvi2alkM+ JqT+MoA7VJrHX41LDKAXcbc= X-Google-Smtp-Source: ACJfBosUkCHirY0OzLbpvzvMEIcEnocCCU1sCDvIUGndnLeXubcGt0HobUQzoM5sFPFWE9p0n0o/mQ== X-Received: by 10.28.173.1 with SMTP id w1mr7494666wme.113.1515348398144; Sun, 07 Jan 2018 10:06:38 -0800 (PST) Received: from localhost.localdomain (bzq-166-168-31-246.red.bezeqint.net. [31.168.166.246]) by smtp.gmail.com with ESMTPSA id k42sm11433750wrf.37.2018.01.07.10.06.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 07 Jan 2018 10:06:37 -0800 (PST) From: Amir Goldstein To: Eryu Guan Cc: Jeff Layton , "J . Bruce Fields" , Miklos Szeredi , fstests@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org Subject: [PATCH 2/7] open_by_handle: verify dir content only with -r flag Date: Sun, 7 Jan 2018 20:07:20 +0200 Message-Id: <1515348445-1403-3-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515348445-1403-1-git-send-email-amir73il@gmail.com> References: <1515348445-1403-1-git-send-email-amir73il@gmail.com> Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Without -r flag file handles are opened, but file content is not read. Treat dir file hanldes, similarly. without -r flag, open dir file handle, but don't verify its content. This is going to be used by tests for which dir content is changed between encode and decode of dir file handle. Signed-off-by: Amir Goldstein --- src/open_by_handle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/open_by_handle.c b/src/open_by_handle.c index f9dfefc..5b7a592 100644 --- a/src/open_by_handle.c +++ b/src/open_by_handle.c @@ -472,7 +472,7 @@ int main(int argc, char **argv) if (!nlink) { printf("open_by_handle(%s) opened an unlinked dir!\n", dname); return EXIT_FAILURE; - } else { + } else if (rd) { /* * Sanity check dir fd - expect to access orig file IFF * it was not unlinked nor renamed.