FS/XFS testing framework
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Filipe Manana <fdmanana@kernel.org>
Cc: Dave Chinner <david@fromorbit.com>,
	fstests <fstests@vger.kernel.org>,
	linux-btrfs <linux-btrfs@vger.kernel.org>,
	Filipe Manana <fdmanana@suse.com>
Subject: Re: [PATCH 2/7] fsstress: add operation for setting xattrs on files and directories
Date: Fri, 29 Mar 2019 15:34:51 -0700	[thread overview]
Message-ID: <20190329223451.GF6537@magnolia> (raw)
In-Reply-To: <CAL3q7H6uHcsEvBCTaBaTeCPhsQ2XHDRqVu7tVa-bPc9iHP6pNw@mail.gmail.com>

On Thu, Mar 28, 2019 at 10:36:37PM +0000, Filipe Manana wrote:
> On Thu, Mar 28, 2019 at 9:48 PM Dave Chinner <david@fromorbit.com> wrote:
> >
> > On Thu, Mar 28, 2019 at 06:54:04PM +0000, fdmanana@kernel.org wrote:
> > > From: Filipe Manana <fdmanana@suse.com>
> > >
> > > Currently fsstress does not exercise creating, reading or deleting xattrs
> > > on files or directories. This change adds support for setting xattrs on
> > > files and directories, using only the xattr user namespace (the other
> > > namespaces are not general purpose and are used for security, capabilities,
> > > ACLs, etc). This adds a counter for each file entry structure that keeps
> > > track of the number of xattrs set for the file entry, and each new xattr
> > > has a name that includes the counter's value (example: "user.x4").
> > > Values for the xattrs have at most 100 bytes, which is much more than
> > > the maximum size supported for all major filesystems.
> > >
> > > Signed-off-by: Filipe Manana <fdmanana@suse.com>
> > > ---
> > >  ltp/fsstress.c | 150 +++++++++++++++++++++++++++++++++++++++++++++++++++++----
> > >  1 file changed, 141 insertions(+), 9 deletions(-)
> > >
> > > diff --git a/ltp/fsstress.c b/ltp/fsstress.c
> > > index cc4f520e..03e40eb6 100644
> > > --- a/ltp/fsstress.c
> > > +++ b/ltp/fsstress.c
> > > @@ -27,6 +27,7 @@
> > >  io_context_t io_ctx;
> > >  #endif
> > >  #include <sys/syscall.h>
> > > +#include <sys/xattr.h>
> > >
> > >  #ifndef FS_IOC_GETFLAGS
> > >  #define FS_IOC_GETFLAGS                 _IOR('f', 1, long)
> > > @@ -85,6 +86,7 @@ typedef enum {
> > >       OP_RESVSP,
> > >       OP_RMDIR,
> > >       OP_SETATTR,
> > > +     OP_SETXATTR,
> > >       OP_SPLICE,
> > >       OP_STAT,
> > >       OP_SYMLINK,
> > > @@ -110,6 +112,7 @@ typedef struct opdesc {
> > >  typedef struct fent {
> > >       int     id;
> > >       int     parent;
> > > +     int     xattr_counter;
> > >  } fent_t;
> > >
> > >  typedef struct flist {
> > > @@ -195,6 +198,7 @@ void      rename_f(int, long);
> > >  void resvsp_f(int, long);
> > >  void rmdir_f(int, long);
> > >  void setattr_f(int, long);
> > > +void setxattr_f(int, long);
> > >  void splice_f(int, long);
> > >  void stat_f(int, long);
> > >  void symlink_f(int, long);
> > > @@ -246,6 +250,7 @@ opdesc_t  ops[] = {
> > >       { OP_RESVSP, "resvsp", resvsp_f, 1, 1 },
> > >       { OP_RMDIR, "rmdir", rmdir_f, 1, 1 },
> > >       { OP_SETATTR, "setattr", setattr_f, 0, 1 },
> > > +     { OP_SETXATTR, "setxattr", setxattr_f, 4, 1 },
> >
> > Ok, now that I see this, the penny drops - you can't do this as
> > it changes the CLI interface in a way that will make existing
> > scripts do something entirely different to what they used to do.
> >
> > i.e. "-f setxattr=n" is used to specify the frequency of this
> > specific operation. It used to control the project ID setting, now
> > with this change it controls extended attribute frequency. There are
> > some tests that actually use "-f setxattr=n" (and who knows how many
> > custom test scripts using fsstress built from fstests), so I don't
> > think we should be renaming existing operations to something else
> > and then reusing the name for a new type of operation like this....
> 
> Any idea for a good name? (Not too long, or too similar like setextattr)

setfattr, seeing as it's a cli tool already anyway?

--D

> 
> 
> >
> > I certainly agree with the idea of adding extended attributes to
> > fsstress, just not this way...
> >
> > Cheers,
> >
> > Dave.
> > --
> > Dave Chinner
> > david@fromorbit.com

  reply	other threads:[~2019-03-29 22:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-28 18:54 [PATCH 2/7] fsstress: add operation for setting xattrs on files and directories fdmanana
2019-03-28 21:48 ` Dave Chinner
2019-03-28 22:36   ` Filipe Manana
2019-03-29 22:34     ` Darrick J. Wong [this message]
2019-03-29 22:46       ` Filipe Manana

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=20190329223451.GF6537@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=david@fromorbit.com \
    --cc=fdmanana@kernel.org \
    --cc=fdmanana@suse.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    /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