@@ -79,6 +79,9 @@ struct ovl_fs {
atomic_long_t last_ino;
/* Whiteout dentry cache */
struct dentry *whiteout;
+ /* syncfs waiting list and lock */
+ struct list_head syncfs_wait_list;
+ spinlock_t syncfs_wait_list_lock;
};
static inline struct vfsmount *ovl_upper_mnt(struct ovl_fs *ofs)
@@ -129,6 +132,8 @@ struct ovl_inode {
/* synchronize copy up and more */
struct mutex lock;
+ /* link to ofs->syncfs_wait_list */
+ struct list_head wait_list;
};
static inline struct ovl_inode *OVL_I(struct inode *inode)
@@ -184,6 +184,7 @@ static struct inode *ovl_alloc_inode(struct super_block *sb)
oi->lower = NULL;
oi->lowerdata = NULL;
mutex_init(&oi->lock);
+ INIT_LIST_HEAD(&oi->wait_list);
return &oi->vfs_inode;
}
@@ -1869,6 +1870,9 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
if (!ofs)
goto out;
+ INIT_LIST_HEAD(&ofs->syncfs_wait_list);
+ spin_lock_init(&ofs->syncfs_wait_list_lock);
+
err = super_setup_bdi(sb);
if (err)
goto out_err;
Introduce extra waiting list to collect inodes which are in writeback process. Signed-off-by: Chengguang Xu <cgxu519@mykernel.net> --- fs/overlayfs/ovl_entry.h | 5 +++++ fs/overlayfs/super.c | 4 ++++ 2 files changed, 9 insertions(+)