linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Jeff Layton <jlayton@kernel.org>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	sargun@sargun.me, amir73il@gmail.com, vgoyal@redhat.com
Subject: Re: [PATCH][RESEND] vfs: serialize updates to file->f_sb_err with f_lock
Date: Mon, 4 Jan 2021 18:57:17 +0000	[thread overview]
Message-ID: <20210104185717.GK3579531@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20210104184347.90598-1-jlayton@kernel.org>

On Mon, Jan 04, 2021 at 01:43:47PM -0500, Jeff Layton wrote:
> @@ -172,7 +172,12 @@ SYSCALL_DEFINE1(syncfs, int, fd)
>  	ret = sync_filesystem(sb);
>  	up_read(&sb->s_umount);
>  
> -	ret2 = errseq_check_and_advance(&sb->s_wb_err, &f.file->f_sb_err);
> +	if (errseq_check(&sb->s_wb_err, f.file->f_sb_err)) {
> +		/* Something changed, must use slow path */
> +		spin_lock(&f.file->f_lock);
> +		ret2 = errseq_check_and_advance(&sb->s_wb_err, &f.file->f_sb_err);
> +		spin_unlock(&f.file->f_lock);
> +	}

	Is there any point bothering with the fastpath here?
I mean, look at the up_read() immediately prior to that thing...

  reply	other threads:[~2021-01-04 19:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-04 18:43 [PATCH][RESEND] vfs: serialize updates to file->f_sb_err with f_lock Jeff Layton
2021-01-04 18:57 ` Al Viro [this message]
2021-01-04 19:00   ` Jeff Layton

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=20210104185717.GK3579531@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=amir73il@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sargun@sargun.me \
    --cc=vgoyal@redhat.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).