linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Gabriel Krisman Bertazi <krisman@collabora.com>
Cc: jack@suse.com, amir73il@gmail.com, repnop@google.com,
	linux-ext4@vger.kernel.org, kernel@collabora.com,
	khazhy@google.com, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v3 5/9] syscalls/fanotify21: Validate incoming FID in FAN_FS_ERROR
Date: Fri, 5 Nov 2021 10:49:54 +0100	[thread overview]
Message-ID: <YYT+Qm/Sy3drGR1+@pevik> (raw)
In-Reply-To: <20211029211732.386127-6-krisman@collabora.com>

Hi all,

Reviewed-by: Petr Vorel <pvorel@suse.cz>

...
> +int check_error_event_info_fid(struct fanotify_event_info_fid *fid,
> +				 const struct test_case *ex)
> +{
> +	struct file_handle *fh = (struct file_handle *) &fid->handle;
> +
> +	if (memcmp(&fid->fsid, &ex->fid->fsid, sizeof(fid->fsid))) {
> +		tst_res(TFAIL, "%s: Received bad FSID type (%x...!=%x...)",
> +			ex->name, FSID_VAL_MEMBER(fid->fsid, 0),
> +			FSID_VAL_MEMBER(ex->fid->fsid, 0));
Correct way is (I'll fix it before pushing this PR):

	if (memcmp(&fid->fsid, &ex->fid->fsid, sizeof(fid->fsid))) {
		tst_res(TFAIL, "%s: Received bad FSID type (%x...!=%x...)",
			ex->name, FSID_VAL_MEMBER(fid->fsid, 0),
			ex->fid->fsid.val[0]);

Using FSID_VAL_MEMBER() is invalid, it broke compilation for musl.
FSID_VAL_MEMBER was created to fix musl compilations, but it should be used only
for struct fanotify_event_info_fid, using it for struct event_t (which has also
__kernel_fsid_t fsid) is invalid and causes this error:

In file included from fanotify21.c:35:
fanotify21.c: In function 'check_error_event_info_fid':
fanotify.h:200:41: error: 'lapi_fsid_t' has no member named '__val'; did you mean 'val'?
  200 | # define FSID_VAL_MEMBER(fsid, i) (fsid.__val[i])
      |                                         ^~~~~
../../../../include/tst_test.h:58:54: note: in expansion of macro 'FSID_VAL_MEMBER'
   58 |   tst_res_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
      |                                                      ^~~~~~~~~~~
fanotify21.c:132:3: note: in expansion of macro 'tst_res'
  132 |   tst_res(TFAIL, "%s: Received bad FSID type (%x...!=%x...)",
      |   ^~~~~~~
make: *** [../../../../include/mk/rules.mk:37: fanotify21] Error 1

Sorry for confusion, not sure how to improve FSID_VAL_MEMBER() to avoid these
errors.

See f37704d6c ("fanotify: Fix FSID_VAL_MEMBER() usage")

Kind regards,
Petr

  reply	other threads:[~2021-11-05  9:49 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-29 21:17 [PATCH v3 0/9] Test the new fanotify FAN_FS_ERROR event Gabriel Krisman Bertazi
2021-10-29 21:17 ` [PATCH v3 1/9] syscalls: fanotify: Add macro to require specific mark types Gabriel Krisman Bertazi
2021-11-02 11:27   ` Matthew Bobrowski
2021-11-02 12:13     ` Amir Goldstein
2021-11-03 16:13       ` [LTP] " Petr Vorel
2021-10-29 21:17 ` [PATCH v3 2/9] syscalls: fanotify: Add macro to require specific events Gabriel Krisman Bertazi
2021-10-30  6:11   ` Amir Goldstein
2021-11-02 11:58   ` Matthew Bobrowski
2021-11-02 12:11     ` Amir Goldstein
2021-10-29 21:17 ` [PATCH v3 3/9] syscalls/fanotify21: Introduce FAN_FS_ERROR test Gabriel Krisman Bertazi
2021-10-30  6:15   ` Amir Goldstein
2021-11-05  8:59     ` [LTP] " Petr Vorel
2021-10-29 21:17 ` [PATCH v3 4/9] syscalls/fanotify21: Validate the generic error info Gabriel Krisman Bertazi
2021-10-29 21:17 ` [PATCH v3 5/9] syscalls/fanotify21: Validate incoming FID in FAN_FS_ERROR Gabriel Krisman Bertazi
2021-11-05  9:49   ` Petr Vorel [this message]
2021-10-29 21:17 ` [PATCH v3 6/9] syscalls/fanotify21: Support submission of debugfs commands Gabriel Krisman Bertazi
2021-10-29 21:17 ` [PATCH v3 7/9] syscalls/fanotify21: Create a corrupted file Gabriel Krisman Bertazi
2021-10-29 21:17 ` [PATCH v3 8/9] syscalls/fanotify21: Test file event with broken inode Gabriel Krisman Bertazi
2021-10-29 21:17 ` [PATCH v3 9/9] syscalls/fanotify21: Test capture of multiple errors Gabriel Krisman Bertazi
2021-10-30  6:21 ` [PATCH v3 0/9] Test the new fanotify FAN_FS_ERROR event Amir Goldstein
2021-11-05 10:10 ` [LTP] " Petr Vorel
2021-11-05 13:02   ` Amir Goldstein
2021-11-05 13:10     ` Petr Vorel
2021-11-15 21:26 ` Petr Vorel

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=YYT+Qm/Sy3drGR1+@pevik \
    --to=pvorel@suse.cz \
    --cc=amir73il@gmail.com \
    --cc=jack@suse.com \
    --cc=kernel@collabora.com \
    --cc=khazhy@google.com \
    --cc=krisman@collabora.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=ltp@lists.linux.it \
    --cc=repnop@google.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).