From patchwork Thu Jan 4 17:20:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 10145225 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 052B06034B for ; Thu, 4 Jan 2018 17:20:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3C0128731 for ; Thu, 4 Jan 2018 17:20:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C764728757; Thu, 4 Jan 2018 17:20:44 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, 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 6821728731 for ; Thu, 4 Jan 2018 17:20:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751935AbeADRUm (ORCPT ); Thu, 4 Jan 2018 12:20:42 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:38937 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751679AbeADRUj (ORCPT ); Thu, 4 Jan 2018 12:20:39 -0500 Received: by mail-wr0-f194.google.com with SMTP id o101so2148138wrb.6; Thu, 04 Jan 2018 09:20: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=8WM5fYTjSsW+Mha1jTTZGUWZWs6g/fmYDBdxRKyJN1g=; b=IUb6xbTmI8BibOj/ssKTNEFizSyIMpkxe4plTTnAnUhAJrhYT+E++kD5S7DqktjgDG FUUa9BjWGKSQu+VICYSvdiya3hvZIuEZ6zIRCrQLVJ+LjERI70uemJJkPbR/90/XgqpY 0YMXQa+5URcUwcWA6Y8pljfeIkqMK8GNtZt0W2kr9Za5DZeJl7aQH8g7zLJI2K7gpjUa LS3GdsbBS4GZWOFlDUcxAZO51BkyIRBVYNGkVsErQj3Ef83/06ZEbKEujVosHqrvukqq OiNsyrURDHan1i3BmQrXeRTj5I07fau2AYYVJny+RVXQuwZn6Vb1pHrbxjUsyDSEHur7 1XYw== 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=8WM5fYTjSsW+Mha1jTTZGUWZWs6g/fmYDBdxRKyJN1g=; b=Bl2cbf4RZbGhe/GLQoRo6N/DdwQj3BMTlcXWAMbuZyKyx/7Tr47kSroyqa+MyUAXmH kmx+PCQ8aUjCs4WJ97oNNzKxl0dpCRoXq03fDriiTCmeHdAy68WQ/Au4ZQsmsCtobrWI 6cNHLU1vQidpOXnJyipGKYnShqmoWa7JSpdUumOFiEqW2mwLywxPpjf7vcUv6JT3mgZc 0zskMQdLJ3mRadmLNzQHIJYc3ZpgxaC6YPDsvztxNJ0SbfdiQlJDYHdcmnC7gElP/HyW QtUKsBnGmq0GIt0GMo5mZmgTLE34QBjzLLixaFl4c7RnvqZ6vqFHikTrfH/oVtWv4ATN lXdg== X-Gm-Message-State: AKGB3mIHGM7mBrZ+8rKOeAp9t8ZdWVvBvkA5qIzVHrZfC5Yd9Xap9xby S8Z9oGZ72+aEJYJXwg9dfro= X-Google-Smtp-Source: ACJfBottzYw/Dzshy6vuVOLSmIdHzr1iFimDUvD1rGFH+FBSHolvdLkrnrmHo9cWqf088l5faxSdUg== X-Received: by 10.223.189.13 with SMTP id j13mr251038wrh.19.1515086438187; Thu, 04 Jan 2018 09:20: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 c6sm2777750wmd.21.2018.01.04.09.20.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Jan 2018 09:20:37 -0800 (PST) From: Amir Goldstein To: Miklos Szeredi Cc: Jeff Layton , "J . Bruce Fields" , linux-unionfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v2 01/17] ovl: document NFS export Date: Thu, 4 Jan 2018 19:20:33 +0200 Message-Id: <1515086449-26563-2-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515086449-26563-1-git-send-email-amir73il@gmail.com> References: <1515086449-26563-1-git-send-email-amir73il@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Amir Goldstein --- Documentation/filesystems/overlayfs.txt | 59 +++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/Documentation/filesystems/overlayfs.txt b/Documentation/filesystems/overlayfs.txt index 00e0595f3d7e..9e21c14c914c 100644 --- a/Documentation/filesystems/overlayfs.txt +++ b/Documentation/filesystems/overlayfs.txt @@ -315,6 +315,65 @@ origin file handle that was stored at copy_up time. If a found lower directory does not match the stored origin, that directory will not be merged with the upper directory. + +NFS export +---------- + +When the underlying filesystems supports NFS export and the "verify" +feature is enabled, an overlay filesystem may be exported to NFS. + +With the "verify" feature, on copy_up of any lower object, an index +entry is created under the index directory. The index entry name is the +hexadecimal representation of the copy up origin file handle. For a +non-directory object, the index entry is a hard link to the upper inode. +For a directory object, the index entry has an extended attribute +"trusted.overlay.origin" with an encoded file handle of the upper +directory inode. + +When encoding a file handle from an overlay filesystem object, the +following rules apply: + +1. For a non-upper object, encode a lower file handle from lower inode +2. For an indexed object, encode a lower file handle from copy_up origin +3. For a pure-upper object and for an existing non-indexed upper object, + encode an upper file handle from upper inode + +Encoding of a non-upper directory object is not supported when overlay +filesystem has multiple lower layers. In this case, the directory will +be copied up first, and then encoded as an upper file handle. + +The encoded overlay file handle includes: + - Header including path type information (e.g. lower/upper) + - UUID of the underlying filesystem + - Underlying filesystem encoding of underlying inode + +This encoding is identical to the encoding of copy_up origin stored in +"trusted.overlay.origin". + +When decoding an overlay file handle, the following steps are followed: + +1. Find underlying layer by UUID and path type information. +2. Decode the underlying filesystem file handle to underlying dentry. +3. For a lower file handle, lookup the handle in index directory by name. +4. If a whiteout is found in index, return ESTALE. This represents an + overlay object that was deleted after its file handle was encoded. +5. For a non-directory, instantiate a disconnected overlay dentry from the + decoded underlying dentry, the path type and index inode, if found. +6. For a directory, use the connected underlying decoded dentry, path type + and index, to lookup a connected overlay dentry. + +The "verify" feature ensures, that a decoded overlay directory object will +be equivalent to the object that was used to encode the file handle. + +Decoding a non-directory file handle may return a disconnected dentry. +copy_up of that disconnected dentry will create an upper index entry with +no upper alias. + +The overlay filesystem does not support non-directory connectable file +handles, so exporting with the 'subtree_check' exportfs configuration will +cause failures to lookup files over NFS. + + Testsuite ---------