From patchwork Tue Jan 23 20:59:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 10181045 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 DCB7F6019D for ; Tue, 23 Jan 2018 20:58:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D07A1287C9 for ; Tue, 23 Jan 2018 20:58:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C561F287ED; Tue, 23 Jan 2018 20:58:17 +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 787C4287C9 for ; Tue, 23 Jan 2018 20:58:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751803AbeAWU6R (ORCPT ); Tue, 23 Jan 2018 15:58:17 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:43913 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752656AbeAWU6Q (ORCPT ); Tue, 23 Jan 2018 15:58:16 -0500 Received: by mail-wm0-f68.google.com with SMTP id g1so4415272wmg.2; Tue, 23 Jan 2018 12:58:15 -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=fk+dbqB48Yu+WVgCmd0gI2q9ngC8E0PgtOvMLhzTwYs=; b=ghVwGIQJ54kvD+IHgUzoBpQBm+8Sl5QsBT9pOo1j5jhHV1EkPsnZgD7/6s2oZkg809 m3J/mPSLOnG2vdMPoMQSt6tq5QeiRA4aFHL5zvAuxbzVIlJQZNYES4ovWONHQtDaPaGL F/olIsNxiDHEfhU2JtLFs5DhFu5UbWaD7IiNv55qRfOwYoAhr7RXDhLA/2QFc/apMfY2 DSfeApsZsnjhRPkJ6EYMdMxcihfok9oDW6OtIkkiYqE9Rd2SdI3KpY7TVMO6TmgxPmAS oNnqdCD8WCWYFhl6V+FNw9KjlOGq1AhegBRfI+idjd2aJMbmdm0L2FJOW03BWGJ6PzZj 1bSQ== 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=fk+dbqB48Yu+WVgCmd0gI2q9ngC8E0PgtOvMLhzTwYs=; b=pUW8MuTuTXQX6JKBQ0C6R2HDOAt0f5oLjtZ8/527WCxNl6/GhthNLHUyMsfAvU1X/h dgLn07BSIeSCmVmE16tYYYTk2q64h47dCeAGbwCY0++t5zScnZg2ohvnav4yqBQ/aP2q r4hR2BMw34IxqE4SWQBOk/4NA424q01BxDhHZmSzHCLJPt8MR7D+K7HW8e9zRvF9BvNP xD0BQNKsT28/C6K2fX+J+xKhw7Ji+oD2Sfx8AmDRdB9/5ShmdzlTdJ539bUKg42q/Wkr wTF0XUfGG8vX9OlM7UBFSdy7QKY/6SC2BQx+TxDwqKyu6wqD7xFwWnNFQm6Qim3rdPLX c04w== X-Gm-Message-State: AKwxyte+uDAjteWCl1/xSnuh0LW+k+bH2ZexS5nNsj3Yql1e41866phy 0L/XJyum5wdnupcVAMGpG5b03Q== X-Google-Smtp-Source: AH8x224uRI5GJbO0KmEpy21Si1luybW62xx888rpCSJ8MhJhfhC9udWW0TOEXjDWsRW0P0M8qTGaww== X-Received: by 10.28.21.73 with SMTP id 70mr2784717wmv.152.1516741095044; Tue, 23 Jan 2018 12:58:15 -0800 (PST) Received: from localhost.localdomain ([141.226.181.178]) by smtp.gmail.com with ESMTPSA id k125sm30308195wmd.48.2018.01.23.12.58.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Jan 2018 12:58:14 -0800 (PST) From: Amir Goldstein To: Eryu Guan Cc: Miklos Szeredi , linux-unionfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH v2 1/7] open_by_handle: verify dir content only with -r flag Date: Tue, 23 Jan 2018 22:59:06 +0200 Message-Id: <1516741152-20345-2-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516741152-20345-1-git-send-email-amir73il@gmail.com> References: <1516741152-20345-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 dbc5b0f..9c13b2a 100644 --- a/src/open_by_handle.c +++ b/src/open_by_handle.c @@ -412,7 +412,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.