Re: Is is reasonable to support quota in fuse?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue 04-06-24 21:49:20, JunChao Sun wrote:
> Jan Kara <jack@xxxxxxx> 于2024年6月4日周二 17:27写道:
> > On Tue 04-06-24 14:54:01, JunChao Sun wrote:
> > > Miklos Szeredi <miklos@xxxxxxxxxx> 于2024年6月4日周二 14:40写道:
> > > >
> > > > On Mon, 3 Jun 2024 at 13:37, JunChao Sun <sunjunchao2870@xxxxxxxxx> wrote:
> > > >
> > > > > Given these challenges, I would like to inquire about the community's
> > > > > perspective on implementing quota functionality at the FUSE kernel
> > > > > part. Is it feasible to implement quota functionality in the FUSE
> > > > > kernel module, allowing users to set quotas for FUSE just as they
> > > > > would for ext4 (e.g., using commands like quotaon /mnt/fusefs or
> > > > > quotaset /mnt/fusefs)?  Would the community consider accepting patches
> > > > > for this feature?
> > > >
> > > >
> > > > > I would say yes, but I have no experience with quota in any way, so
> > > > > cannot help with the details.
> > >
> > > Thanks for your reply. I'd like try to implement this feature.
> >
> > Nice idea! But before you go and spend a lot of time trying to implement
> > something, I suggest that you write down a design how you imagine all this
> > to work and we can talk about it. Questions like: Do you have particular
> > usecases in mind? Where do you plan to perform the accounting /
> > enforcement? Where do you want to store quota information? How do you want
> > to recover from unclean shutdowns? Etc...
> 
> Thanks a lot for your suggestions.
> 
> I am reviewing the quota code of ext4 and the fuse code to determine
> if the implementation method used in ext4 can be ported to fuse. Based
> on my current understanding, the key issue is that ext4 reserves
> several inodes for quotas and can manage the disk itself, allowing it
> to directly flush quota data to the disk blocks corresponding to the
> quota inodes within the kernel.

Yes.

> However, fuse does not seem to manage
> the disk itself; it sends all read and write requests to user space
> for completion. Therefore, it may not be possible to directly flush
> the data in the quota inode to the disk in fuse.

Yes, ext4 uses journalling to keep filesystem state consistent with quota
information. Doing this within FUSE would be rather difficult (essentially
you would have to implement journal within FUSE with will have rather high
performace overhead).

But that's why I'm asking for usecases. For some usecases it may be fine
that in case of unclean shutdown you run quotacheck program to update quota
information based on current usage - non-journalling filesystems use this
method. So where do you want to use quotas on a FUSE filesystem?

> I am considering whether it would be feasible to implement the quota
> inode in user space in a similar manner. For example, users could
> reserve a few regular files that are invisible to actual file system
> users to store the contents of quota. When updating the quota, the
> user would be notified to flush the quota data to the disk. The
> benefit of this approach is that it can directly reuse the quota
> metadata format from the kernel, users do not need to redesign
> metadata. However, performance might be an issue with this approach.

Yes, storing quota data in some files inside the filesystem is probably the
easiest way to go. I'd just not bother with flushing because as you say
the performance would suck in that case.

								Honza
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux