]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: implement online get/set fs label
authorEric Sandeen <sandeen@sandeen.net>
Thu, 28 Jun 2018 20:11:57 +0000 (15:11 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 28 Jun 2018 20:11:57 +0000 (15:11 -0500)
commit691fdd72188171652d8a541695949856da1af5c9
tree3d2a02d161c63bb2d104b7830a74e91185783801
parent8a8954203d7bbabf5508b176477385d8987cc682
xfs: implement online get/set fs label

Source kernel commit: f7664b31975bd893190708e76b2c424328f0c49b

The GET ioctl is trivial, just return the current label.

The SET ioctl is more involved:
It transactionally modifies the superblock to write a new filesystem
label to the primary super.

A new variant of xfs_sync_sb then writes the superblock buffer
immediately to disk so that the change is visible from userspace.

It then invalidates any page cache that userspace might have previously
read on the block device so that i.e. blkid can see the change
immediately, and updates all secondary superblocks as userspace relable
does.

Also includes for bisectability:

xfs: use xfs_trans_getsb in xfs_sync_sb_buf

Source kernel commit: 89c2e71123badc1e75316ccd969ee8a5c6fd921a

Use xfs_trans_getsb rather than reaching right in for
mp->m_sb_bp; I think this is more correct, and it facilitates
building this libxfs code in userspace as well.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
[darrick: use dchinner's new xfs_update_secondary_sbs function]
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_format.h
libxfs/xfs_sb.c
libxfs/xfs_sb.h