Page MenuHomeFreeBSD

Expose ZFS quotas over nfs
Needs ReviewPublic

Authored by sef on Jun 18 2018, 6:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 18, 7:49 AM
Unknown Object (File)
Mon, Nov 18, 2:03 AM
Unknown Object (File)
Sun, Nov 17, 1:55 AM
Unknown Object (File)
Sun, Nov 17, 1:42 AM
Unknown Object (File)
Sun, Nov 17, 1:27 AM
Unknown Object (File)
Feb 16 2024, 2:19 AM
Unknown Object (File)
Jan 28 2024, 2:45 PM
Unknown Object (File)
Dec 20 2023, 7:14 AM

Details

Summary

This allows NFS quotas to query ZFS quotas. Note that it only works with querying (quota administration still needs to be done via the normal methods on the servers). It also generalizes some of the quota support in the commands and libraries, so it's not checking only for ufs, so it should also work on any other filesystem that supports the VFS calls. Although obviously I've only tested it with ZFS.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Is it possible to provide a switch to disable the SETQUOTA RPC? (Assuming I'm understanding correctly that no additional authentication is done before it's permitted; rpc.rquotad runs at root privilege so when it issues vfs_quotactl it would not fail because insufficient privilege).

By the way I think there should be a CLI tool that invokes SETQUOTA (Linux have a package called quota-tools) for completeness.

include/rpcsvc/rquota.x
10

Since this was moved to header and was already commented out, maybe just delete the whole ifndef lint block here?

lib/libutil/quotafile.c
136

qf is leaked here?

libexec/rpc.rquotad/rquotad.c
305

opoen: typo. Should be open.

307

Is the pointer value meaningful for a system administrator?

sef marked an inline comment as done.Jun 18 2018, 7:16 PM

Is it possible to provide a switch to disable the SETQUOTA RPC?

I'm not sure what you mean by a switch there?

include/rpcsvc/rquota.x
10

I have no objection to that :).

lib/libutil/quotafile.c
136

Fixed, will be in next version I upload in a bit

libexec/rpc.rquotad/rquotad.c
307

It's for debug, so I consider it more meaningful for a developer. I print out the entire set of function arguments, so I included the pointer. That's about it.

Incorporate feedback from delphij.

In D15886#336048, @sef wrote:

Is it possible to provide a switch to disable the SETQUOTA RPC?

I'm not sure what you mean by a switch there?

Sorry, I meant a command line option to rpc.rquotad if it's not clear.

In D15886#336048, @sef wrote:

Is it possible to provide a switch to disable the SETQUOTA RPC?

Sorry, I meant a command line option to rpc.rquotad if it's not clear.

I don't have any code in there right now that handles the SETQUOTA RPC, so I'm still confused. Want to discuss it in email?

In D15886#336083, @sef wrote:
In D15886#336048, @sef wrote:

Is it possible to provide a switch to disable the SETQUOTA RPC?

Sorry, I meant a command line option to rpc.rquotad if it's not clear.

I don't have any code in there right now that handles the SETQUOTA RPC, so I'm still confused. Want to discuss it in email?

Oh right, it was me who was confused (somehow I thought you have implemented the RPC already, but it's only in the kernel for ZFS). LGTM now.

This revision is now accepted and ready to land.Jul 3 2018, 7:52 PM
This revision was automatically updated to reflect the committed changes.

Hey Guys, it's possible that this could have caused a regression with quota on NFS. Please take a look at: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239552