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, Apr 22, 12:36 AM
Unknown Object (File)
Mon, Apr 22, 12:36 AM
Unknown Object (File)
Mon, Apr 22, 12:36 AM
Unknown Object (File)
Mon, Apr 22, 12:36 AM
Unknown Object (File)
Mon, Apr 22, 12:20 AM
Unknown Object (File)
Fri, Apr 19, 3:44 PM
Unknown Object (File)
Tue, Apr 16, 6:20 AM
Unknown Object (File)
Wed, Apr 10, 9:14 PM

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 Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #44019)

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 ↗(On Diff #44019)

qf is leaked here?

libexec/rpc.rquotad/rquotad.c
305 ↗(On Diff #44019)

opoen: typo. Should be open.

307 ↗(On Diff #44019)

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 ↗(On Diff #44019)

I have no objection to that :).

lib/libutil/quotafile.c
136 ↗(On Diff #44019)

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

libexec/rpc.rquotad/rquotad.c
307 ↗(On Diff #44019)

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