Re: [PATCH] fs: fat: Make the volume label writable when mounted

From: Pali Rohár
Date: Sun Oct 10 2021 - 08:38:10 EST


On Sunday 10 October 2021 14:18:16 Pali Rohár wrote:
> Hello!
>
> On Sunday 10 October 2021 21:06:52 OGAWA Hirofumi wrote:
> > > diff --git a/include/uapi/linux/msdos_fs.h b/include/uapi/linux/msdos_fs.h
> > > index a5773899f4d9..b666bca09238 100644
> > > --- a/include/uapi/linux/msdos_fs.h
> > > +++ b/include/uapi/linux/msdos_fs.h
> > > @@ -104,6 +104,7 @@ struct __fat_dirent {
> > > #define FAT_IOCTL_SET_ATTRIBUTES _IOW('r', 0x11, __u32)
> > > /*Android kernel has used 0x12, so we use 0x13*/
> > > #define FAT_IOCTL_GET_VOLUME_ID _IOR('r', 0x13, __u32)
> > > +#define VFAT_IOCTL_SET_LABEL _IOW('r', 0x14, __u32)
> >
> > maybe FAT_IOCTL_SET_LABEL is better.
>
> Please do not introduce a new fs specific ioctls. There is already
> vfs-agnostic FS_IOC_SETFSLABEL ioctl, look at manpage:
> https://man7.org/linux/man-pages/man2/ioctl_fslabel.2.html
>
> I have WIP patches which adds support for FS_IOC_SETFSLABEL ioctl into
> kernel vfat driver. But it is not possible to implement this ioctl
> properly until issues with encoding are fixed in vfat driver. Some of
> dependency patches I have sent to ML as RFC series:
> https://lore.kernel.org/lkml/20210808162453.1653-1-pali@xxxxxxxxxx/

Also look at important details about encoding in discussion:
https://lore.kernel.org/lkml/20200107231522.GC472641@magnolia/

> If you have a time and motivation, I can send you my unfinished WIP
> patches which implements FS_IOC_SETFSLABEL ioctl for vfat.