From: Jeff Layton <jlayton@redhat.com>
To: "Yan, Zheng" <zyan@redhat.com>
Cc: ceph-devel <ceph-devel@vger.kernel.org>,
Sage Weil <sage@redhat.com>, Ilya Dryomov <idryomov@gmail.com>,
John Spray <jspray@redhat.com>
Subject: Re: [PATCH v4 5/6] Revert "ceph: SetPageError() for writeback pages if writepages fails"
Date: Fri, 10 Feb 2017 06:53:42 -0500 [thread overview]
Message-ID: <1486727622.4233.8.camel@redhat.com> (raw)
In-Reply-To: <D37683D2-E73B-486C-BE6B-14DD65172700@redhat.com>
On Fri, 2017-02-10 at 19:22 +0800, Yan, Zheng wrote:
> > On 9 Feb 2017, at 22:48, Jeff Layton <jlayton@redhat.com> wrote:
> >
> > This reverts commit b109eec6f4332bd517e2f41e207037c4b9065094.
> >
> > If I'm filling up a filesystem with this sort of command:
> >
> > $ dd if=/dev/urandom of=/mnt/cephfs/fillfile bs=2M oflag=sync
> >
> > ...then I'll eventually get back EIO on a write. Further calls
> > will give us ENOSPC.
> >
> > I'm not sure what prompted this change, but I don't think it's what we
> > want to do. If writepages failed, we will have already set the mapping
> > error appropriately, and that's what gets reported by fsync() or
> > close().
> >
> > __filemap_fdatawait_range however, does this:
> >
> > wait_on_page_writeback(page);
> > if (TestClearPageError(page))
> > ret = -EIO;
> >
> > ...and that -EIO ends up trumping the mapping's error if one exists.
> >
> > When writepages fails, we only want to set the error in the mapping,
> > and not flag the individual pages.
>
> I think you are right. Maybe we should also remove the SetPageError in writepage_nounlock
>
Yeah, good catch. The last patch in this series should probably also
call ceph_set/clear_error_write in that function as well.
> >
> > Signed-off-by: Jeff Layton <jlayton@redhat.com>
> > ---
> > fs/ceph/addr.c | 4 +---
> > 1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
> > index 308787eeee2c..040d05c8f4a2 100644
> > --- a/fs/ceph/addr.c
> > +++ b/fs/ceph/addr.c
> > @@ -668,6 +668,7 @@ static void writepages_finish(struct ceph_osd_request *req)
> > struct ceph_fs_client *fsc = ceph_inode_to_client(inode);
> > bool remove_page;
> >
> > +
> > dout("writepages_finish %p rc %d\n", inode, rc);
> > if (rc < 0)
> > mapping_set_error(mapping, rc);
> > @@ -702,9 +703,6 @@ static void writepages_finish(struct ceph_osd_request *req)
> > clear_bdi_congested(&fsc->backing_dev_info,
> > BLK_RW_ASYNC);
> >
> > - if (rc < 0)
> > - SetPageError(page);
> > -
> > ceph_put_snap_context(page_snap_context(page));
> > page->private = 0;
> > ClearPagePrivate(page);
> > --
> > 2.9.3
> >
>
>
--
Jeff Layton <jlayton@redhat.com>
next prev parent reply other threads:[~2017-02-10 11:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-09 14:48 [PATCH v4 0/6] ceph: implement new-style ENOSPC handling in kcephfs Jeff Layton
2017-02-09 14:48 ` [PATCH v4 1/6] libceph: allow requests to return immediately on full conditions if caller wishes Jeff Layton
2017-02-10 11:41 ` Yan, Zheng
2017-02-10 11:52 ` Jeff Layton
2017-02-10 12:37 ` Ilya Dryomov
2017-02-10 12:44 ` Jeff Layton
2017-02-09 14:48 ` [PATCH v4 2/6] libceph: abort already submitted but abortable requests when map or pool goes full Jeff Layton
2017-02-10 12:01 ` Yan, Zheng
2017-02-10 12:07 ` Jeff Layton
2017-02-10 12:59 ` Ilya Dryomov
2017-02-09 14:48 ` [PATCH v4 3/6] libceph: add an epoch_barrier field to struct ceph_osd_client Jeff Layton
2017-02-09 14:48 ` [PATCH v4 4/6] ceph: handle epoch barriers in cap messages Jeff Layton
2017-02-09 14:48 ` [PATCH v4 5/6] Revert "ceph: SetPageError() for writeback pages if writepages fails" Jeff Layton
2017-02-10 11:22 ` Yan, Zheng
2017-02-10 11:53 ` Jeff Layton [this message]
2017-02-09 14:48 ` [PATCH v4 6/6] ceph: when seeing write errors on an inode, switch to sync writes 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=1486727622.4233.8.camel@redhat.com \
--to=jlayton@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=idryomov@gmail.com \
--cc=jspray@redhat.com \
--cc=sage@redhat.com \
--cc=zyan@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 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.