[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211122030038.1938875-3-cgxu519@mykernel.net>
Date: Mon, 22 Nov 2021 11:00:33 +0800
From: Chengguang Xu <cgxu519@...ernel.net>
To: miklos@...redi.hu, jack@...e.cz, amir73il@...il.com
Cc: linux-unionfs@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org,
Chengguang Xu <charliecgxu@...cent.com>
Subject: [RFC PATCH V6 2/7] ovl: mark overlayfs inode dirty when it has upper
From: Chengguang Xu <charliecgxu@...cent.com>
We simply mark overlayfs inode dirty when it has upper,
it's much simpler than mark dirtiness on modification.
Signed-off-by: Chengguang Xu <charliecgxu@...cent.com>
---
fs/overlayfs/inode.c | 4 +++-
fs/overlayfs/util.c | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c
index 1f36158c7dbe..027ffc0a2539 100644
--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -778,8 +778,10 @@ void ovl_inode_init(struct inode *inode, struct ovl_inode_params *oip,
{
struct inode *realinode;
- if (oip->upperdentry)
+ if (oip->upperdentry) {
OVL_I(inode)->__upperdentry = oip->upperdentry;
+ mark_inode_dirty(inode);
+ }
if (oip->lowerpath && oip->lowerpath->dentry)
OVL_I(inode)->lower = igrab(d_inode(oip->lowerpath->dentry));
if (oip->lowerdata)
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c
index f48284a2a896..a1922af32a13 100644
--- a/fs/overlayfs/util.c
+++ b/fs/overlayfs/util.c
@@ -421,6 +421,7 @@ void ovl_inode_update(struct inode *inode, struct dentry *upperdentry)
inode->i_private = upperinode;
__insert_inode_hash(inode, (unsigned long) upperinode);
}
+ mark_inode_dirty(inode);
}
static void ovl_dir_version_inc(struct dentry *dentry, bool impurity)
--
2.27.0
Powered by blists - more mailing lists