On Tue, Aug 15, 2023 at 10:36:52PM +0200, Miklos Szeredi wrote: > On Tue, 15 Aug 2023 at 21:51, Amir Goldstein <amir73il@xxxxxxxxx> wrote: > > > What I meant is, except from emergency remount rdonly and fs specific > > cases like ext4 remount-ro on error, is there a way via new mount API > > that users can request remount of the upper SB rdonly, despite the > > fact that this sb has private writable mount clones? > > even if ovl has elevated mnt_writers of upper_mnt? > > Private and public mounts are completely equal in this regard. So no, > you can't remount rdonly if upper mnt has an elevated mnt_writers. It's worth noting that during _emergency_ rw->ro remount writers on mounts are ignored. IOW, if SB_FORCE is set then we don't call sb_prepare_remount_readonly() which would otherwise walk all mounts of the superblock marking them as about to be made ro and would fail the rw->ro if there are any active writers. And a real emergency ro remount would make all active superblocks ro including any overlayfs ones. But for a regular rw->ro any writable mount with active writers would prevent the sb from going ro.