All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Jeff Layton <jlayton@kernel.org>
Cc: viro@zeniv.linux.org.uk, jack@suse.com,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	lurodriguez@suse.de
Subject: Re: [PATCH v2] vfs: avoid dereferencing pointers in iterate_supers callbacks
Date: Thu, 17 May 2018 11:26:38 -0700	[thread overview]
Message-ID: <20180517182638.GD26718@bombadil.infradead.org> (raw)
In-Reply-To: <20180517174336.18529-1-jlayton@kernel.org>

On Thu, May 17, 2018 at 01:43:36PM -0400, Jeff Layton wrote:
> @@ -107,12 +109,10 @@ static void fdatawait_one_bdev(struct block_device *bdev, void *arg)
>   */
>  void ksys_sync(void)
>  {
> -	int nowait = 0, wait = 1;
> -
>  	wakeup_flusher_threads(WB_REASON_SYNC);
>  	iterate_supers(sync_inodes_one_sb, NULL);
> -	iterate_supers(sync_fs_one_sb, &nowait);
> -	iterate_supers(sync_fs_one_sb, &wait);
> +	iterate_supers(sync_fs_one_sb, NULL);
> +	iterate_supers(sync_fs_one_sb, (void *)1UL);

I think this is actually less clear.  How about:

	void *wait = (void *)1UL;

	iterate_supers(sync_fs_one_sb, !wait);
	iterate_supers(sync_fs_one_sb, wait);

  reply	other threads:[~2018-05-17 18:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17 15:46 [PATCH] vfs: change iterate_supers callback to take an int arg instead of a void * Jeff Layton
2018-05-17 16:39 ` Jan Kara
2018-05-17 16:55   ` Jeff Layton
2018-05-17 17:43 ` [PATCH v2] vfs: avoid dereferencing pointers in iterate_supers callbacks Jeff Layton
2018-05-17 18:26   ` Matthew Wilcox [this message]
2018-05-17 18:55     ` Jeff Layton
2018-05-17 21:54 ` [PATCH v3] " Jeff Layton
2018-05-18  9:32   ` Jan Kara

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=20180517182638.GD26718@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=jack@suse.com \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lurodriguez@suse.de \
    --cc=viro@zeniv.linux.org.uk \
    /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.