From patchwork Thu Apr 12 15:07:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10338669 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 56610602D8 for ; Thu, 12 Apr 2018 15:08:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A7F226D08 for ; Thu, 12 Apr 2018 15:08:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F1DB26E74; Thu, 12 Apr 2018 15:08:47 +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.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, 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 D57C626D08 for ; Thu, 12 Apr 2018 15:08:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753326AbeDLPIn (ORCPT ); Thu, 12 Apr 2018 11:08:43 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:54056 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753268AbeDLPIi (ORCPT ); Thu, 12 Apr 2018 11:08:38 -0400 Received: by mail-wm0-f67.google.com with SMTP id 66so12327280wmd.3 for ; Thu, 12 Apr 2018 08:08:38 -0700 (PDT) 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=383PHKTwQqLsQkT23B7VGZZmCC/EJ2Lj2+BIXNuH3f8=; b=sTKXVr9KNhXTMuuK+4m7oFr0DK8DSNAzQ77ug9DXn2GnyT1rsk+XIbl17rQIKNgGhf MUCuM5YhTvtETRJUX8UbrMdoYlFiLH7zahMkqYwA4zPx3TrXfF6vSpZ07z+ITEBllfU4 V3IzrjR4dCVso9UMjDUtLmCz5F5iVO/ccRVIpdt71X9JuLsrsIMAp31zFC4jsUivOKgv O0n+eX0uxPvY113+QgMR5vzeQTGZWgMo812mdX402Ynw+0Gby67cjti5Y0ot++f4m6db NTDDyauS0eEo6s1VFnYSdgRf+eFlMxPJtQzbbzC9viuha0y0GfwvcTeCdzrvxonjfN7E 0wQg== X-Gm-Message-State: ALQs6tCZqZ7SfOl70nFhsoMT/P3axZ17+V/7/vQjGKadioLeW+TUj+WL hR4dzVtrWoYTbO1TLp73SFIGAWXqafY= X-Google-Smtp-Source: AIpwx49zwyxXcwsdz3jUmZItcAXOjHahtw/haO3ZYPy5JCsUG9Z0Cs8Zdk87XOgRzCqi9F/7kBi3Tg== X-Received: by 10.28.216.69 with SMTP id p66mr1103026wmg.84.1523545717436; Thu, 12 Apr 2018 08:08:37 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (catv-176-63-54-97.catv.broadband.hu. [176.63.54.97]) by smtp.gmail.com with ESMTPSA id p197sm2621783wme.43.2018.04.12.08.08.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Apr 2018 08:08:36 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 05/35] ovl: copy up inode flags Date: Thu, 12 Apr 2018 17:07:56 +0200 Message-Id: <20180412150826.20988-6-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180412150826.20988-1-mszeredi@redhat.com> References: <20180412150826.20988-1-mszeredi@redhat.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 On inode creation copy certain inode flags from the underlying real inode to the overlay inode. This is in preparation for moving overlay functionality out of the VFS. Signed-off-by: Miklos Szeredi --- fs/overlayfs/overlayfs.h | 7 +++++++ fs/overlayfs/util.c | 1 + 2 files changed, 8 insertions(+) diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h index eef720ef0f07..265cb288417a 100644 --- a/fs/overlayfs/overlayfs.h +++ b/fs/overlayfs/overlayfs.h @@ -357,6 +357,13 @@ static inline void ovl_copyattr(struct inode *from, struct inode *to) to->i_ctime = from->i_ctime; } +static inline void ovl_copyflags(struct inode *from, struct inode *to) +{ + unsigned int mask = S_SYNC | S_IMMUTABLE | S_APPEND | S_NOATIME; + + inode_set_flags(to, from->i_flags & mask, mask); +} + /* dir.c */ extern const struct inode_operations ovl_dir_inode_operations; struct dentry *ovl_lookup_temp(struct dentry *workdir); diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index 11e62e70733a..586f8d7440bb 100644 --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c @@ -310,6 +310,7 @@ void ovl_inode_init(struct inode *inode, struct dentry *upperdentry, OVL_I(inode)->lower = igrab(d_inode(lowerdentry)); ovl_copyattr(realinode, inode); + ovl_copyflags(realinode, inode); if (!inode->i_ino) inode->i_ino = realinode->i_ino; }