xfs
[Top] [All Lists]

Re: [PATCH v11 3/4] xfs: Add proper versioning support to fs_quota_stat

To: Chandra Seetharaman <sekharan@xxxxxxxxxx>
Subject: Re: [PATCH v11 3/4] xfs: Add proper versioning support to fs_quota_stat
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Thu, 11 Jul 2013 18:11:13 +1000
Cc: xfs@xxxxxxxxxxx, jack@xxxxxxx, swhiteho@xxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1373518843-1492-4-git-send-email-sekharan@xxxxxxxxxx>
References: <1373518843-1492-1-git-send-email-sekharan@xxxxxxxxxx> <1373518843-1492-4-git-send-email-sekharan@xxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Thu, Jul 11, 2013 at 12:00:42AM -0500, Chandra Seetharaman wrote:
> Added appropriate pads and code for backward compatibility.
> 
> Copied over the old version as it is different from the newer padded
> version.
> 
> New callers of the system call have to set the version of the data
> structure being passed, and kernel will fill as much data as requested.
> 
> Signed-off-by: Chandra Seetharaman <sekharan@xxxxxxxxxx>

Oh, and I forgot to mention:

> +             /*
> +              * For forward compatibility. Check against all supported
> +              * versions, and if the version provided is not supported
> +              * by the kernel, set to the highest version supported.
> +              * For now only FS_QSTAT_VERSION_2 is supported.
> +              */
> +             if (fqs.qs_version != FS_QSTAT_VERSION_2)
> +                     fqs.qs_version = FS_QSTAT_VERSION_2;

New API, new version number and enforcement: if the version number
passed in from userspace  is not understood, -EINVAL or an
equivalent "parameter not understood" error should be returned.
If the kernel doesn't understand what it is being passed, then
there's no guarantee that anything quota info we return can be
understood by the caller.

And while I remember, we'll also need quotactl(2) man page updates
for the new API.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>