linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Changing FAT label of mounted file system
@ 2017-09-05 14:14 Pali Rohár
  2017-09-05 15:35 ` OGAWA Hirofumi
  0 siblings, 1 reply; 3+ messages in thread
From: Pali Rohár @ 2017-09-05 14:14 UTC (permalink / raw)
  To: OGAWA Hirofumi, linux-kernel, linux-fsdevel

[-- Attachment #1: Type: Text/Plain, Size: 1408 bytes --]

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

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Changing FAT label of mounted file system
  2017-09-05 14:14 Changing FAT label of mounted file system Pali Rohár
@ 2017-09-05 15:35 ` OGAWA Hirofumi
  2017-10-30 15:35   ` Pali Rohár
  0 siblings, 1 reply; 3+ messages in thread
From: OGAWA Hirofumi @ 2017-09-05 15:35 UTC (permalink / raw)
  To: Pali Rohár; +Cc: linux-kernel, linux-fsdevel

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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Changing FAT label of mounted file system
  2017-09-05 15:35 ` OGAWA Hirofumi
@ 2017-10-30 15:35   ` Pali Rohár
  0 siblings, 0 replies; 3+ messages in thread
From: Pali Rohár @ 2017-10-30 15:35 UTC (permalink / raw)
  To: OGAWA Hirofumi, Andrius Štikonas, Curtis Gedak,
	Andreas Bombe
  Cc: linux-kernel, linux-fsdevel, Karel Zak, util-linux

On Wednesday 06 September 2017 00:35:10 OGAWA Hirofumi wrote:
> 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?

Lets ask other people, maintainers of the GUI & command line tools which
are already used by lot of users.

Andrius, Curtis and Andreas, what do you think?

> 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.

You are right. But IIRC in the worst case label of ext4 would not be
changed (overwritten by the old label when kernel ext4 driver changes
superblock).

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

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-30 15:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-05 14:14 Changing FAT label of mounted file system Pali Rohár
2017-09-05 15:35 ` OGAWA Hirofumi
2017-10-30 15:35   ` Pali Rohár

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).