All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Jeff Layton <jlayton@kernel.org>
Cc: fstests@vger.kernel.org, eguan@redhat.com, willy@infradead.org,
	david@fromorbit.com
Subject: Re: [PATCH] generic: test for seeing unseen fsync errors on newly open files
Date: Fri, 27 Apr 2018 09:58:30 -0700	[thread overview]
Message-ID: <20180427165830.xekrvdv2my6nxjsr@alap3.anarazel.de> (raw)
In-Reply-To: <20180427163833.21882-1-jlayton@kernel.org>

Hi,

On 2018-04-27 12:38:33 -0400, Jeff Layton wrote:
> This is motivated by some rather odd behavior done by the PostgreSQL
> project. The main database writers will offload the fsync calls to a
> separate process, which can open files after a writeback error has
> already occurred.

;)


> +	ret = pwrite(fd1, buf, bufsize, 0);
> +	if (ret < 0) {
> +		printf("Second write on fd1 failed: %m\n");
> +		return 1;
> +	}
> +
> +	/* Ensure writeback occurs, but don't scrape the error */
> +	sync();

It might be a good idea to also add a second version of this that
additionally evicts inodes after the sync? I think that should be
simulatable with "echo 2 > /proc/sys/vm/drop_caches" or such? That'd
obviously fail for now...

Thanks for the test,

Andres Freund

  reply	other threads:[~2018-04-27 16:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-27 16:38 [PATCH] generic: test for seeing unseen fsync errors on newly open files Jeff Layton
2018-04-27 16:58 ` Andres Freund [this message]
2018-04-27 17:20   ` Jeff Layton
2018-04-28  7:27 ` Amir Goldstein
2018-04-28 12:05   ` Jeff Layton
2018-04-28 14:59 ` [PATCH v2] " Jeff Layton
2018-04-28 15:19   ` Amir Goldstein
2018-04-28 23:06   ` [PATCH v3] " Jeff Layton
2018-05-02  5:50     ` Eryu Guan
2018-05-08 12:46       ` 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=20180427165830.xekrvdv2my6nxjsr@alap3.anarazel.de \
    --to=andres@anarazel.de \
    --cc=david@fromorbit.com \
    --cc=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=jlayton@kernel.org \
    --cc=willy@infradead.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 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.