From patchwork Mon May 7 08:37:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10383681 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 B2AA460159 for ; Mon, 7 May 2018 08:51:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA2B728B65 for ; Mon, 7 May 2018 08:51:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9DF9328BAA; Mon, 7 May 2018 08:51:05 +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=unavailable 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 DC3E428BB4 for ; Mon, 7 May 2018 08:51:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752090AbeEGItX (ORCPT ); Mon, 7 May 2018 04:49:23 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:43923 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752087AbeEGIiV (ORCPT ); Mon, 7 May 2018 04:38:21 -0400 Received: by mail-wr0-f193.google.com with SMTP id v15-v6so27834351wrm.10 for ; Mon, 07 May 2018 01:38:21 -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=6yzPimbMV3+mLZogENVfoMvxpfJF4P++9XueDc0406U=; b=HSU3O+VDws8PH2yHK9JPm2uOddJ2KXw0WRaWd4w//WH5VMUAP9Of+B2stxo3NhUr73 mMLqv+JQEgRCkIe2UAAY8Tvw/OJUyGSdClJadjTe1Mh/WQ5O6tzVRxZ4JDTcJ5lWUoZY 1ywMVrX6/clR92wWVsDG3lLkt6BHaoWZIMOAdSdUjC2r7m9UkjxXrZMMBrZCg2YUodmB lSI9aKotQqxSW50r80Cv2xdoX17PC8+etYexN1bek4/7uC3pOzNGp7vHa2TXiy9G9GTx thOg/FsNO3QkPGwUWPeDRWE3KZXflq6SRS4mLoqPm7mcxBPzuDLSPu4Zv+YQZ3wd42Dt +8Hg== X-Gm-Message-State: ALQs6tAthUG6LjpCtoTIQAo820UOSknCVWCYuNqeDjjM3tZVRokPdUG3 b3VhKFn8oGsw6aEZJjfR1gVP8w== X-Google-Smtp-Source: AB8JxZoGVVcgJgNyUo699H/9lBAGPEdQvU7lXX93voB+RsR6PTsyH1X0BiWRAMPVbn6OdN8MjyTDvg== X-Received: by 2002:adf:e092:: with SMTP id c18-v6mr28325610wri.70.1525682300747; Mon, 07 May 2018 01:38:20 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (C2B0E321.catv.pool.telekom.hu. [194.176.227.33]) by smtp.gmail.com with ESMTPSA id h8-v6sm5908050wmc.16.2018.05.07.01.38.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 May 2018 01:38:20 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 07/35] ovl: copy up inode flags Date: Mon, 7 May 2018 10:37:39 +0200 Message-Id: <20180507083807.28792-8-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180507083807.28792-1-mszeredi@redhat.com> References: <20180507083807.28792-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 271561fa7882..4e26778774c3 100644 --- a/fs/overlayfs/overlayfs.h +++ b/fs/overlayfs/overlayfs.h @@ -350,6 +350,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 30a05d1d679d..25d202b47326 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; }