]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: implement online get/set fs label
authorEric Sandeen <sandeen@sandeen.net>
Tue, 15 May 2018 20:21:48 +0000 (13:21 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 16 May 2018 15:50:16 +0000 (08:50 -0700)
commitd8667aa30660d1b8ab202b0ca7b6449a76fbfd84
tree439142f0401d795c31bfbebe62f42b7e057fa446
parent29cc10a95352d3784f04a3629cf6b24c225fa432
xfs: implement online get/set fs label

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.

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>
fs/xfs/libxfs/xfs_format.h
fs/xfs/libxfs/xfs_sb.c
fs/xfs/libxfs/xfs_sb.h
fs/xfs/xfs_ioctl.c