public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* A question in the context of independent pquota
@ 2011-10-20 23:02 Chandra Seetharaman
  2011-10-25 11:54 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Chandra Seetharaman @ 2011-10-20 23:02 UTC (permalink / raw)
  To: XFS Mailing List

Hi All,

Few days back I posted a patchset to allow pquota and gquota to be used
together. I have a question in that context.

In order for the user space to get the stats for pguota and gquota
together (quotactl command Q_XGETQSTAT), I need to add a field to
fs_quota_stat. So, I have to change the version number.

But, the version number is only set in the kernel and not checked. Which
means the kernel cannot know what size of the fs_quota_stat data
structure the user space has provided in order to decide if the kernel
can copy the newer (bigger) data structure to the user space or not.

One option I see is to add a new command to the ioctl.

Is there any other options ? ( or am I totally missing it :) ?

Thanks

Chandra






_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: A question in the context of independent pquota
  2011-10-20 23:02 A question in the context of independent pquota Chandra Seetharaman
@ 2011-10-25 11:54 ` Christoph Hellwig
  2011-10-25 16:59   ` Chandra Seetharaman
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2011-10-25 11:54 UTC (permalink / raw)
  To: Chandra Seetharaman; +Cc: XFS Mailing List

Hi Chandra,

I don't think there is an easy way to add a field there.  Please
just add a new Q_XGETQSTAT_2 call that takes the new, larger structure.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: A question in the context of independent pquota
  2011-10-25 11:54 ` Christoph Hellwig
@ 2011-10-25 16:59   ` Chandra Seetharaman
  0 siblings, 0 replies; 3+ messages in thread
From: Chandra Seetharaman @ 2011-10-25 16:59 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: XFS Mailing List

On Tue, 2011-10-25 at 07:54 -0400, Christoph Hellwig wrote:
> Hi Chandra,
> 
> I don't think there is an easy way to add a field there.  Please
> just add a new Q_XGETQSTAT_2 call that takes the new, larger structure.

Christoph,

I came up with couple of ideas.

- Add a new version FS_QSTAT_VERSION2 (with a value of 2) that uses
  the newer fs_quota_stat
- Start using qs_version in the user space code, with the bigger 
  fs_quota_stat
- Define a macro to check if the given version is a valid one.
- In xfs_qm_scall_getqstat()(kernel), copy in the newer fs_quota_stat
  structure from user space.
  If copy in succeeded, check qs_version. 
     If valid, use the structure relevant to the version.
     If invalid, use structure for the version FS_QSTAT_VERSION.
  If copy in failed,
     use structure for the version FS_QSTAT_VERSION.

I think it should work with the current user space code.

Let me know what you think of it.

Thanks & Regards,

Chandra
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
> 


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2011-10-25 16:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-20 23:02 A question in the context of independent pquota Chandra Seetharaman
2011-10-25 11:54 ` Christoph Hellwig
2011-10-25 16:59   ` Chandra Seetharaman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox