On Tue 25-04-23 20:47:35, Shiyang Ruan wrote: > > > 在 2023/4/20 20:09, Jan Kara 写道: > > On Thu 20-04-23 10:07:39, Shiyang Ruan wrote: > > > 在 2023/4/12 18:52, Shiyang Ruan 写道: > > > > This is a RFC HOTFIX. > > > > > > > > This hotfix adds a exclusive forzen state to make sure any others won't > > > > thaw the fs during xfs_dax_notify_failure(): > > > > > > > > #define SB_FREEZE_EXCLUSIVE (SB_FREEZE_COMPLETE + 2) > > > > Using +2 here is because Darrick's patch[0] is using +1. So, should we > > > > make these definitions global? > > > > > > > > Another thing I can't make up my mind is: when another freezer has freeze > > > > the fs, should we wait unitl it finish, or print a warning in dmesg and > > > > return -EBUSY? > > > > > > > > Since there are at least 2 places needs exclusive forzen state, I think > > > > we can refactor helper functions of freeze/thaw for them. e.g. > > > > int freeze_super_exclusive(struct super_block *sb, int frozen); > > > > int thaw_super_exclusive(struct super_block *sb, int frozen); > > > > > > > > [0] https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git/commit/?h=repair-fscounters&id=c3a0d1de4d54ffb565dbc7092dfe1fb851940669 > > > > I'm OK with the idea of new freeze state that does not allow userspace to > > thaw the filesystem. But I don't really like the guts of filesystem > > freezing being replicated inside XFS. It is bad enough that they are > > replicated in [0], replicating them *once more* in another XFS file shows > > we are definitely doing something wrong. And Luis will need yet another > > incantation of the exlusive freeze for suspend-to-disk. So please guys get > > together and reorganize the generic freezing code so that it supports > > exclusive freeze (for in-kernel users) and works for your usecases instead > > of replicating it inside XFS... > > I agree that too much replicating code is not good. It's necessary to > create a generic exclusive freeze/thaw for all users. But for me, I don't > have the confidence to do it well, because it requires good design and code > changes will involve other filesystems. It's diffcult. > > However, I hope to be able to make progress on this unbind feature. Thus, I > tend to refactor a common helper function for xfs first, and update the code > later when the generic freeze is done. I think Darrick was thinking about working on a proper generic interface. So please coordinate with him. Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR