Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1726768 > unrolled thread

Changing FAT label of mounted file system

Started byPali Rohár <pali.rohar@gmail.com>
First post2017-09-05 16:20 +0200
Last post2017-09-05 18:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  Changing FAT label of mounted file system Pali Rohár <pali.rohar@gmail.com> - 2017-09-05 16:20 +0200
    Re: Changing FAT label of mounted file system OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> - 2017-09-05 18:10 +0200

#1726768 — Changing FAT label of mounted file system

FromPali Rohár <pali.rohar@gmail.com>
Date2017-09-05 16:20 +0200
SubjectChanging FAT label of mounted file system
Message-ID<ummRP-3Lb-1@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

Hello!

On most file system it is possible to change its label at anytime, when 
mounted or unmounted. But FAT is such special file system on which is 
label stored in two location, plus one is in directory structure (which 
cannot be modified when file system is mounted).

I would like to ask what about providing FAT specific IOCTL for vfat 
kernel driver which would allow to change volume label?

Currently vfat provides FAT_IOCTL_GET_VOLUME_ID which returns volume 
serial number, so in similar way it could be extended to provide 
FAT_IOCTL_GET_VOLUME_LABEL and FAT_IOCTL_SET_VOLUME_LABEL.

Now when partition manager program wants to change label of FAT 
partition, it first needs to unmount it, then change label and after 
that mount it again. Providing IOCTL would help partition manager 
programs to implement operation for changing volume label easier. Also 
unmounting partition is now always possible (when busy).

Next typical usage is opening file manager and in its window "renaming" 
volume label. Currently such thing is not possible to implement (without 
hacks) for FAT as once file manager has opened location of FAT partition 
it needs to be mounted -- and changing volume label is not possible.

Other file systems do not have this problem as label is not stored in 
directory structure, managed by kernel driver.

-- 
Pali Rohár
pali.rohar@gmail.com

[toc] | [next] | [standalone]


#1726833

FromOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Date2017-09-05 18:10 +0200
Message-ID<umoAi-4Y9-37@gated-at.bofh.it>
In reply to#1726768
Pali Rohár <pali.rohar@gmail.com> writes:

> Hello!

Hi,

> On most file system it is possible to change its label at anytime, when 
> mounted or unmounted. But FAT is such special file system on which is 
> label stored in two location, plus one is in directory structure (which 
> cannot be modified when file system is mounted).
>
> I would like to ask what about providing FAT specific IOCTL for vfat 
> kernel driver which would allow to change volume label?

I have no objection to add this ioctl though, there is really needs of
apps?

For example, ext4's volume name is sb->s_volume_name, right? And no
ioctl to change it, so I guess the app does read-modify-write
superblock. If so, there is theoretical race with umount and super block
update of ext4 (yes, although updating superblock is rare timing).  So
ext4 is unsafe actually to rewrite volume_name on the mounted fs.

Well, anyway, if there is the patch to add ioctl, again, I have no
objection.

Thanks.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web