Re: [PATCH] generic: test for seeing unseen fsync errors on newly open files

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



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
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux