Re: [PATCH 7/7] porting: document block device freeze and thaw changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed 27-09-23 08:19:11, Darrick J. Wong wrote:
> On Wed, Sep 27, 2023 at 03:21:20PM +0200, Christian Brauner wrote:
> > Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx>
> > ---
> >  Documentation/filesystems/porting.rst | 25 +++++++++++++++++++++++++
> >  1 file changed, 25 insertions(+)
> > 
> > diff --git a/Documentation/filesystems/porting.rst b/Documentation/filesystems/porting.rst
> > index 4d05b9862451..fef97a2e6729 100644
> > --- a/Documentation/filesystems/porting.rst
> > +++ b/Documentation/filesystems/porting.rst
> > @@ -1045,3 +1045,28 @@ filesystem type is now moved to a later point when the devices are closed:
> >  As this is a VFS level change it has no practical consequences for filesystems
> >  other than that all of them must use one of the provided kill_litter_super(),
> >  kill_anon_super(), or kill_block_super() helpers.
> > +
> > +---
> > +
> > +**mandatory**
> > +
> > +Block device freezing and thawing have been moved to holder operations. As we
> > +can now go straight from block devcie to superblock the get_active_super()
> 
> s/devcie/device/
> 
> > +and bd_fsfreeze_sb members in struct block_device are gone.
> > +
> > +The bd_fsfreeze_mutex is gone as well since we can rely on the bd_holder_lock
> > +to protect against concurrent freeze and thaw.
> > +
> > +Before this change, get_active_super() would only be able to find the
> > +superblock of the main block device, i.e., the one stored in sb->s_bdev. Block
> > +device freezing now works for any block device owned by a given superblock, not
> > +just the main block device.
> 
> You might want to document this new fs_holder_ops scheme:
> 
> "Filesystems opening a block device must pass the super_block object
> and fs_holder_ops as the @holder and @hops parameters."
> 
> Though TBH I see a surprising amount of fs code that doesn't do this, so
> perhaps it's not so mandatory?

This is actually a good point. For the main device, fs/super.c takes care
of this (perhaps except for btrfs). So this patch set should not regress
anything. But for other devices such as the journal device or similar,
passing proper holder and holder_ops from the filesystem is necessary.

								Honza
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux