From: Dave Chinner <david@fromorbit.com>
To: Bill O'Donnell <billodo@redhat.com>
Cc: xfs@oss.sgi.com, "Darrick J. Wong" <darrick.wong@oracle.com>
Subject: Re: [PATCH] xfsprogs: don't populate fs table with foreign fs paths unless foreign_allowed
Date: Tue, 30 Aug 2016 09:16:49 +1000 [thread overview]
Message-ID: <20160829231649.GP19025@dastard> (raw)
In-Reply-To: <20160829154349.GA4643@redhat.com>
On Mon, Aug 29, 2016 at 10:43:49AM -0500, Bill O'Donnell wrote:
> On Mon, Aug 29, 2016 at 08:13:23AM -0700, Darrick J. Wong wrote:
> > On Mon, Aug 29, 2016 at 08:40:12AM -0500, Bill O'Donnell wrote:
> > > Commits b20b6c2 and 29647c8 modified xfs_quota for use on
> > > non-XFS filesystems. One modification in fs_initialise_mounts
> > > (paths.c) resulted in an xfstest fail (xfs/261), due to foreign
> > > fs paths entering the fs table.
> > >
> > > This patch reverts the behavior in fs_initialise_mounts back
> > > to skip populating the table with foreign paths, unless the
> > > -f flag is thrown in xfs_quota to set foreign_allowed true.
> > >
> > > Signed-off-by: Bill O'Donnell <billodo@redhat.com>
> > > ---
> > > libxcmd/paths.c | 5 +++++
> > > quota/init.c | 1 -
> > > 2 files changed, 5 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/libxcmd/paths.c b/libxcmd/paths.c
> > > index 4158688..7375c0e 100644
> > > --- a/libxcmd/paths.c
> > > +++ b/libxcmd/paths.c
> > > @@ -34,6 +34,7 @@ extern char *progname;
> > > int fs_count;
> > > struct fs_path *fs_table;
> > > struct fs_path *fs_path;
> > > +bool foreign_allowed = false; /* foreign filesystems not allowed (default) */
> >
> > /me wonders if this would be better as a parameter to
> > fs_table_initialise_mounts() ?
>
> Hrmm, it could be, but my notion is that keeping it global
> is a bit cleaner than having to add automatics in 4
> function calls.
For some definition of "cleaner" (i.e. less code change), yes.
However, hiding behavioural state in library globals hides the
connection between the program code that sets it and the library
code that uses it. It's better to explicitly pass function behaviour
control parameters as function parameters, that way you can just
follow the call chain to know what is supposed to be happening as
you read the source....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2016-08-29 23:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-29 13:40 [PATCH] xfsprogs: don't populate fs table with foreign fs paths unless foreign_allowed Bill O'Donnell
2016-08-29 15:13 ` Darrick J. Wong
2016-08-29 15:43 ` Bill O'Donnell
2016-08-29 23:16 ` Dave Chinner [this message]
2016-08-29 23:28 ` Bill O'Donnell
2016-08-29 23:12 ` Dave Chinner
2016-08-29 23:26 ` Bill O'Donnell
2016-08-29 23:40 ` Dave Chinner
2016-08-29 23:47 ` Bill O'Donnell
2016-08-30 0:25 ` Dave Chinner
2016-08-30 0:53 ` Bill O'Donnell
2016-09-01 22:07 ` Bill O'Donnell
2016-09-02 21:22 ` [PATCH v2] xfsprogs: (xfs_quota) foreign fs path handling changes Bill O'Donnell
2016-09-02 22:57 ` Eric Sandeen
2016-09-02 23:10 ` Bill O'Donnell
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=20160829231649.GP19025@dastard \
--to=david@fromorbit.com \
--cc=billodo@redhat.com \
--cc=darrick.wong@oracle.com \
--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;
as well as URLs for NNTP newsgroup(s).