mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-24 16:19:14 +07:00
Staging: Pohmelfs: Sync fs before killing it, since dentry cache is shrunk before writeback is invoked via generic_shutdown_super()
Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
e504342448
commit
cee9bb2ebd
@ -1908,11 +1908,29 @@ static int pohmelfs_get_sb(struct file_system_type *fs_type,
|
|||||||
mnt);
|
mnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We need this to sync all inodes earlier, since when writeback
|
||||||
|
* is invoked from the umount/mntput path dcache is already shrunk,
|
||||||
|
* see generic_shutdown_super(), and no inodes can access the path.
|
||||||
|
*/
|
||||||
|
static void pohmelfs_kill_super(struct super_block *sb)
|
||||||
|
{
|
||||||
|
struct writeback_control wbc = {
|
||||||
|
.sync_mode = WB_SYNC_ALL,
|
||||||
|
.range_start = 0,
|
||||||
|
.range_end = LLONG_MAX,
|
||||||
|
.nr_to_write = LONG_MAX,
|
||||||
|
};
|
||||||
|
generic_sync_sb_inodes(sb, &wbc);
|
||||||
|
|
||||||
|
kill_anon_super(sb);
|
||||||
|
}
|
||||||
|
|
||||||
static struct file_system_type pohmel_fs_type = {
|
static struct file_system_type pohmel_fs_type = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.name = "pohmel",
|
.name = "pohmel",
|
||||||
.get_sb = pohmelfs_get_sb,
|
.get_sb = pohmelfs_get_sb,
|
||||||
.kill_sb = kill_anon_super,
|
.kill_sb = pohmelfs_kill_super,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user