From patchwork Tue May 29 14:43:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10436095 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 5A20460327 for ; Tue, 29 May 2018 15:12:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BD4728823 for ; Tue, 29 May 2018 15:12:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4032128844; Tue, 29 May 2018 15:12:20 +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 E6CFC28823 for ; Tue, 29 May 2018 15:12:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935660AbeE2OoF (ORCPT ); Tue, 29 May 2018 10:44:05 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:50972 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935577AbeE2Ony (ORCPT ); Tue, 29 May 2018 10:43:54 -0400 Received: by mail-wm0-f66.google.com with SMTP id t11-v6so41396597wmt.0 for ; Tue, 29 May 2018 07:43:53 -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=o1Sy5DbksDhNBDMLCFAASrgbFJBn2APgDA51tu5PUAE=; b=NGEGTezGTSWS5mqTZELJ/ilL4mTnq6RAT6GL6X5/dHEA2aSaG0FflBvmdUpPoCDs0b +biWUiCY46rD/PK5w+y0hVphexro13hF9OKGgWcIUlhYJgyrB4aXVkKiV3L/273MA3iu x+0/YHVBI5rXhVK9XwYiBSlUIPh0MABeozlnqEPhBUFL0vWzOsk9gdHS/H8HpjkgOPKO PihxOiUoLecddJvR02oWUo+I+mafD5l00/vOqgQc+yTiV1Q610BrM85MI/FQrObbneOh jiEqRI8i6Daw7pHRvjAEOqtYxAiXYpVyI4ww1PGEds5EaXR27mWGKSeKh2+nxhoxg07o ezbQ== X-Gm-Message-State: ALKqPwckPBeiKgWrXPDPss5zOqjJC9PDJDws2a3uWMU0MwSb/jMcBXOS lSBMIMmvz/rKHY/Bv5k4/usx9w== X-Google-Smtp-Source: ADUXVKJiMhRbbefCG1RSRVRdtnwves/SKI1YyEdLnfTMfMpiQOqSEsmA0g1nJvQmTxT3fE+H6cWUzw== X-Received: by 2002:a1c:3505:: with SMTP id c5-v6mr12957872wma.35.1527605033173; Tue, 29 May 2018 07:43:53 -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 t198-v6sm18834422wmt.23.2018.05.29.07.43.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 May 2018 07:43:52 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/39] ovl: copy up inode flags Date: Tue, 29 May 2018 16:43:10 +0200 Message-Id: <20180529144339.16538-11-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180529144339.16538-1-mszeredi@redhat.com> References: <20180529144339.16538-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 eeaad0710704..e9dab319c8b2 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; int ovl_cleanup_and_whiteout(struct dentry *workdir, struct inode *dir, 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; }