public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@lst.de>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 2/4] kill struct xfs_mount_args
Date: Thu, 24 Jul 2008 17:05:42 +1000	[thread overview]
Message-ID: <20080724070541.GT6761@disturbed> (raw)
In-Reply-To: <20080525190741.GB13372@lst.de>

On Sun, May 25, 2008 at 09:07:41PM +0200, Christoph Hellwig wrote:
> No need to parse the mount option into a structure before applying it
> to struct xfs_mount.
> 
> The content of xfs_start_flags gets merged into xfs_parseargs.  Calls
> inbetween don't care and can use mount members instead of the args
> struct.
> 
> This patch uncovered that the mount option for shared filesystems wasn't
> ever exposed on Linux.  The code to handle it is #if 0'ed in this patch
> pending a decision on this feature.  I'll send a writeup about it to
> the list soon.

Overall is good - cleans up a lot of mess, but a couple of things
need fixing:

> @@ -228,7 +231,9 @@ xfs_parseargs(
>  					this_char);
>  				return EINVAL;
>  			}
> -			strncpy(args->mtpt, value, MAXNAMELEN);
> +			*mtpt = kstrndup(value, MAXNAMELEN, GFP_KERNEL);
> +			if (!*mtpt)
> +				return ENOMEM;

It's a double ptr that dup'd the mtpt= value to successfully.
we check we have a string, but it still count be a null string.

> -	if ((args->flags & XFSMNT_DMAPI) && *args->mtpt == '\0') {
> +	if ((mp->m_flags & XFS_MOUNT_DMAPI) && !mtpt) {

Which means that check is not doing the same thing. Did you mean
to check it was not a null string like the original code
(i.e !**mtpt)?

Also, a comment needs to be made in the function header that mtpt
needs to be freed by the caller.

> @@ -131,9 +130,11 @@ static struct xfs_qmops xfs_qmcore_stub 
>  };
>  
>  int
> -xfs_qmops_get(struct xfs_mount *mp, struct xfs_mount_args *args)
> +xfs_qmops_get(struct xfs_mount *mp)
>  {
> -	if (args->flags & (XFSMNT_UQUOTA | XFSMNT_PQUOTA | XFSMNT_GQUOTA)) {
> +	if (mp->m_qflags & (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE |
> +			    XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE |
> +			    XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE)) {
>  		struct xfs_qmops *ops;
>  
>  		ops = symbol_get(xfs_qmcore_xfs);

I think *QUOTA_ACTIVE implies *QUOTA_ACCT. i.e. the quota can't
be active if we are not accounting it. Hence I think this can
be simplified to :

	if (XFS_IS_QUOTA_RUNNING(mp)) {

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  parent reply	other threads:[~2008-07-24  7:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-25 19:07 [PATCH 2/4] kill struct xfs_mount_args Christoph Hellwig
2008-07-23  8:05 ` Christoph Hellwig
2008-08-28 23:17   ` Christoph Hellwig
2008-10-18 12:35     ` Christoph Hellwig
2008-10-21  6:18       ` Donald Douwsma
2008-07-24  7:05 ` Dave Chinner [this message]
2008-07-24 19:53   ` Christoph Hellwig
2008-07-24 23:12     ` Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080724070541.GT6761@disturbed \
    --to=david@fromorbit.com \
    --cc=hch@lst.de \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox