]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
errseq: Always report a writeback error once
authorMatthew Wilcox <willy@infradead.org>
Tue, 24 Apr 2018 21:02:57 +0000 (14:02 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 Aug 2018 10:25:16 +0000 (12:25 +0200)
commitf90ef7b5e30f1a7d8e0f120140d97c5d9566a8bd
treed4f8ec3d5c571596c0b84851e6eed789f2227971
parentc33ccf8c0e6c998d9c8b5cff6c55b1af6b6d3ff8
errseq: Always report a writeback error once

BugLink: http://bugs.launchpad.net/bugs/1778759
commit b4678df184b314a2bd47d2329feca2c2534aa12b upstream.

The errseq_t infrastructure assumes that errors which occurred before
the file descriptor was opened are of no interest to the application.
This turns out to be a regression for some applications, notably Postgres.

Before errseq_t, a writeback error would be reported exactly once (as
long as the inode remained in memory), so Postgres could open a file,
call fsync() and find out whether there had been a writeback error on
that file from another process.

This patch changes the errseq infrastructure to report errors to all
file descriptors which are opened after the error occurred, but before
it was reported to any file descriptor.  This restores the user-visible
behaviour.

Cc: stable@vger.kernel.org
Fixes: 5660e13d2fd6 ("fs: new infrastructure for writeback error handling and reporting")
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
lib/errseq.c