All of lore.kernel.org
 help / color / mirror / Atom feed
From: "xuyang2018.jy@fujitsu.com" <xuyang2018.jy@fujitsu.com>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: "ltp@lists.linux.it" <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v4 6/6] syscalls/quotactl07: Add quotactl_fd test variant
Date: Mon, 10 Jan 2022 09:03:26 +0000	[thread overview]
Message-ID: <61DBF68E.7070902@fujitsu.com> (raw)
In-Reply-To: <YdhkRDQ9uD3goDpV@yuki>

Hi Cyril
> Hi!
>> Also man-pages has error that Q_XQUOTARM was not introduced by kernel
>> 3.16. So use invalid type directly
>
> Have you send a patch to man-pages to get this fixed?
Yes, but offical  man-pages[1] hasn't updated for serval months.
The updates is on alejandro-colomar(man-pages new co-maintainer) main 
branch[2][3].

This patch will get unexpect EINVAL error when kernel commit 40b52225e 
("xfs: remove support for disabling quota accounting on a mounted file 
system")[4] was introduced.

the unexpected EINVAL error position: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/xfs/xfs_qm_syscalls.c#n108

if we want to disable quota account feature before Q_XQUOTARM, we must 
need to remount with noquota like xfs maintainer does in xfstests 
xfs/220 [5].


So , I will modify this case as below:

/* Include a valid quota type to avoid other EINVAL error */
static unsigned int invalid_type = XFS_GROUP_QUOTA << 1 | XFS_USER_QUOTA;
static int mount_flag;

static void verify_quota(void)
{
         TEST(do_quotactl(fd, QCMD(Q_XQUOTARM, USRQUOTA), 
tst_device->dev, 0, (void *)&invalid_type));
         if (TST_ERR == EINVAL)
                 tst_res(TPASS, "Q_XQUOTARM has quota type check");
         else
                 tst_res(TFAIL, "Q_XQUOTARM doesn't have quota type check");
}

static void setup(void)
{
         quotactl_info();

         /* ensure superblock has quota data, but not running */
         SAFE_MOUNT(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, 
"usrquota");
         mount_flag = 1;
         SAFE_UMOUNT(MNTPOINT);
         mount_flag = 0;
         SAFE_MOUNT(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, 
"noquota");
         mount_flag = 1;

         fd = SAFE_OPEN(MNTPOINT, O_RDONLY);
}

static void cleanup(void)
{
         if (fd > -1)
                 SAFE_CLOSE(fd);
         if (mount_flag && tst_umount(MNTPOINT))
                 tst_res(TWARN | TERRNO, "umount(%s)", MNTPOINT);
}

static struct tst_test test = {
         .setup = setup,
         .cleanup = cleanup,
         .needs_root = 1,
         .needs_kconfigs = (const char *[]) {
                 "CONFIG_XFS_QUOTA",
                 NULL
         },
         .test_all = verify_quota,
         .format_device = 1,
         .dev_fs_type = "xfs",
         .mntpoint = MNTPOINT,


[1]https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/
[2]https://github.com/alejandro-colomar/man-pages/commit/38bccbcf4f51c5370a1060e6a80b90d68b0dcdc8
[3]https://github.com/alejandro-colomar/man-pages/commit/26f3978f04a1aeeb5397a5facebaef40a341afb6
[4]https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=40b52225e58cd3adf9358146b4b39dccfbfe5892
[5]https://patchwork.kernel.org/project/fstests/patch/20220105195352.GM656707@magnolia/

I will send a v5 for this patchset and add TST_EXP* usage.

Best Regards
Yang Xu
>
> Reviewed-by: Cyril Hrubis<chrubis@suse.cz>
>

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2022-01-10  9:03 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-09 10:54 [LTP] [PATCH v3 06/12] lapi/quotactl.h: Add fallback for quotactl_fd Yang Xu
2021-11-09 10:54 ` [LTP] [PATCH v3 07/12] syscalls/quotactl08: Test quoatctl01 but quota info hidden in filesystem Yang Xu
2021-11-10 16:32   ` Cyril Hrubis
2021-11-11  8:48     ` xuyang2018.jy
2021-11-11 14:30       ` Cyril Hrubis
2021-11-26  9:32         ` xuyang2018.jy
2021-12-13  7:26         ` [LTP] [PATCH v4 1/6] " Yang Xu
2021-12-13  7:26           ` [LTP] [PATCH v4 2/6] syscalls/quotactl02, 5: Add quotactl_fd test variant Yang Xu
2022-01-07 14:30             ` Cyril Hrubis
2021-12-13  7:26           ` [LTP] [PATCH v4 3/6] syscalls/quotactl03: " Yang Xu
2022-01-07 14:59             ` Cyril Hrubis
2021-12-13  7:26           ` [LTP] [PATCH v4 4/6] syscalls/quotactl04: " Yang Xu
2022-01-07 15:35             ` Cyril Hrubis
2022-01-10 10:09               ` xuyang2018.jy
2021-12-13  7:26           ` [LTP] [PATCH v4 5/6] syscalls/quotactl09: Test error when quota info hidden in filesystem Yang Xu
2022-01-07 15:50             ` Cyril Hrubis
2022-01-10  6:48               ` xuyang2018.jy
2022-01-10 14:46                 ` Cyril Hrubis
2022-01-11  6:51                   ` xuyang2018.jy
2022-01-11 10:55                     ` Cyril Hrubis
2022-01-12  1:52                       ` xuyang2018.jy
2022-01-12  8:31                         ` Cyril Hrubis
2022-01-12  9:24                           ` xuyang2018.jy
2021-12-13  7:26           ` [LTP] [PATCH v4 6/6] syscalls/quotactl07: Add quotactl_fd test variant Yang Xu
2022-01-07 16:03             ` Cyril Hrubis
2022-01-10  9:03               ` xuyang2018.jy [this message]
2021-12-23  8:03           ` [LTP] [PATCH v4 1/6] syscalls/quotactl08: Test quoatctl01 but quota info hidden in filesystem xuyang2018.jy
2022-01-07 14:09           ` Cyril Hrubis
2022-01-10  6:37             ` xuyang2018.jy
2022-01-10 14:46               ` Cyril Hrubis
2021-11-09 10:54 ` [LTP] [PATCH v3 08/12] syscalls/quotactl02, 5: Add quotactl_fd test variant Yang Xu
2021-11-09 10:54 ` [LTP] [PATCH v3 09/12] syscalls/quotactl03: " Yang Xu

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=61DBF68E.7070902@fujitsu.com \
    --to=xuyang2018.jy@fujitsu.com \
    --cc=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.