From: Jan Kara <jack@suse.cz>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Jan Kara <jack@suse.cz>, linux-ext4 <linux-ext4@vger.kernel.org>,
Ted Tso <tytso@mit.edu>,
Ross Zwisler <ross.zwisler@linux.intel.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
linux-nvdimm@lists.01.org
Subject: Re: [PATCH 1/2] dax: Pass detailed error code from dax_iomap_fault()
Date: Tue, 2 Jan 2018 19:54:40 +0100 [thread overview]
Message-ID: <20180102185440.GD4911@quack2.suse.cz> (raw)
In-Reply-To: <CAPcyv4jYKqEr+y8Uon3ddSvqskAiT_xKMNgnY7=UJkE=3xEM5A@mail.gmail.com>
On Thu 21-12-17 09:12:52, Dan Williams wrote:
> On Thu, Dec 21, 2017 at 8:30 AM, Jan Kara <jack@suse.cz> wrote:
> > Ext4 needs to pass through error from its iomap handler to the page
> > fault handler so that it can properly detect ENOSPC and force
> > transaction commit and retry the fault (and block allocation). Add
> > argument to dax_iomap_fault() for passing such error.
> >
> > Signed-off-by: Jan Kara <jack@suse.cz>
> > ---
> > fs/dax.c | 9 ++++++---
> > fs/ext2/file.c | 2 +-
> > fs/ext4/file.c | 2 +-
> > fs/xfs/xfs_file.c | 2 +-
> > include/linux/dax.h | 2 +-
> > 5 files changed, 10 insertions(+), 7 deletions(-)
> >
> > diff --git a/fs/dax.c b/fs/dax.c
> > index 95981591977a..f3afa1d6156c 100644
> > --- a/fs/dax.c
> > +++ b/fs/dax.c
> > @@ -1096,7 +1096,7 @@ static bool dax_fault_is_synchronous(unsigned long flags,
> > }
> >
> > static int dax_iomap_pte_fault(struct vm_fault *vmf, pfn_t *pfnp,
> > - const struct iomap_ops *ops)
> > + int *iomap_errp, const struct iomap_ops *ops)
> > {
> > struct vm_area_struct *vma = vmf->vma;
> > struct address_space *mapping = vma->vm_file->f_mapping;
> > @@ -1149,6 +1149,8 @@ static int dax_iomap_pte_fault(struct vm_fault *vmf, pfn_t *pfnp,
> > * that we never have to deal with more than a single extent here.
> > */
> > error = ops->iomap_begin(inode, pos, PAGE_SIZE, flags, &iomap);
> > + if (iomap_errp)
> > + *iomap_errp = error;
>
> Since we already have 'struct iomap' tracking the state of the iomap
> should we track the error status there as well? I.e. move the on
> stack allocation of struct iomap to the per-fs dax fault handlers.
I don't think that's really adequate. Firstly because at least part of
struct iomap needs to be initialized inside dax_iomap_fault() and secondly
because by the time dax_iomap_fault() returns, mapping information in struct
iomap may be invalid (as we unlocked radix tree entry). So I think it is
really better to pass back only the error code and keep struct iomap
internal to dax_iomap_fault().
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
WARNING: multiple messages have this Message-ID (diff)
From: Jan Kara <jack@suse.cz>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Ted Tso <tytso@mit.edu>,
linux-nvdimm@lists.01.org,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Jan Kara <jack@suse.cz>, linux-ext4 <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH 1/2] dax: Pass detailed error code from dax_iomap_fault()
Date: Tue, 2 Jan 2018 19:54:40 +0100 [thread overview]
Message-ID: <20180102185440.GD4911@quack2.suse.cz> (raw)
In-Reply-To: <CAPcyv4jYKqEr+y8Uon3ddSvqskAiT_xKMNgnY7=UJkE=3xEM5A@mail.gmail.com>
On Thu 21-12-17 09:12:52, Dan Williams wrote:
> On Thu, Dec 21, 2017 at 8:30 AM, Jan Kara <jack@suse.cz> wrote:
> > Ext4 needs to pass through error from its iomap handler to the page
> > fault handler so that it can properly detect ENOSPC and force
> > transaction commit and retry the fault (and block allocation). Add
> > argument to dax_iomap_fault() for passing such error.
> >
> > Signed-off-by: Jan Kara <jack@suse.cz>
> > ---
> > fs/dax.c | 9 ++++++---
> > fs/ext2/file.c | 2 +-
> > fs/ext4/file.c | 2 +-
> > fs/xfs/xfs_file.c | 2 +-
> > include/linux/dax.h | 2 +-
> > 5 files changed, 10 insertions(+), 7 deletions(-)
> >
> > diff --git a/fs/dax.c b/fs/dax.c
> > index 95981591977a..f3afa1d6156c 100644
> > --- a/fs/dax.c
> > +++ b/fs/dax.c
> > @@ -1096,7 +1096,7 @@ static bool dax_fault_is_synchronous(unsigned long flags,
> > }
> >
> > static int dax_iomap_pte_fault(struct vm_fault *vmf, pfn_t *pfnp,
> > - const struct iomap_ops *ops)
> > + int *iomap_errp, const struct iomap_ops *ops)
> > {
> > struct vm_area_struct *vma = vmf->vma;
> > struct address_space *mapping = vma->vm_file->f_mapping;
> > @@ -1149,6 +1149,8 @@ static int dax_iomap_pte_fault(struct vm_fault *vmf, pfn_t *pfnp,
> > * that we never have to deal with more than a single extent here.
> > */
> > error = ops->iomap_begin(inode, pos, PAGE_SIZE, flags, &iomap);
> > + if (iomap_errp)
> > + *iomap_errp = error;
>
> Since we already have 'struct iomap' tracking the state of the iomap
> should we track the error status there as well? I.e. move the on
> stack allocation of struct iomap to the per-fs dax fault handlers.
I don't think that's really adequate. Firstly because at least part of
struct iomap needs to be initialized inside dax_iomap_fault() and secondly
because by the time dax_iomap_fault() returns, mapping information in struct
iomap may be invalid (as we unlocked radix tree entry). So I think it is
really better to pass back only the error code and keep struct iomap
internal to dax_iomap_fault().
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
next prev parent reply other threads:[~2018-01-02 18:54 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-21 16:30 [PATCH 0/2 v2] ext4: Fix ENOSPC handling for DAX faults Jan Kara
2017-12-21 16:30 ` Jan Kara
2017-12-21 16:30 ` [PATCH 1/2] dax: Pass detailed error code from dax_iomap_fault() Jan Kara
2017-12-21 16:30 ` Jan Kara
[not found] ` <20171221163055.3943-2-jack-AlSwsSmVLrQ@public.gmane.org>
2017-12-21 17:12 ` Dan Williams
2017-12-21 17:12 ` Dan Williams
2017-12-21 17:12 ` Dan Williams
2018-01-02 18:54 ` Jan Kara [this message]
2018-01-02 18:54 ` Jan Kara
2018-01-02 18:57 ` Dan Williams
2018-01-02 18:57 ` Dan Williams
2017-12-21 17:16 ` Ross Zwisler
2017-12-21 17:16 ` Ross Zwisler
[not found] ` <20171221163055.3943-1-jack-AlSwsSmVLrQ@public.gmane.org>
2017-12-21 16:30 ` [PATCH 2/2] ext4: Fix ENOSPC handling in DAX page fault handler Jan Kara
2017-12-21 16:30 ` Jan Kara
2017-12-21 16:30 ` Jan Kara
[not found] ` <20171221163055.3943-3-jack-AlSwsSmVLrQ@public.gmane.org>
2017-12-21 17:17 ` Ross Zwisler
2017-12-21 17:17 ` Ross Zwisler
2017-12-21 17:17 ` Ross Zwisler
-- strict thread matches above, loose matches on Subject: below --
2018-01-03 10:08 [PATCH 0/2 v3] ext4: Fix ENOSPC handling for DAX faults Jan Kara
[not found] ` <20180103100844.12787-1-jack-AlSwsSmVLrQ@public.gmane.org>
2018-01-03 10:08 ` [PATCH 1/2] dax: Pass detailed error code from dax_iomap_fault() Jan Kara
2018-01-03 10:08 ` Jan Kara
2018-01-03 10:08 ` Jan Kara
2018-01-07 21:51 ` Theodore Ts'o
2018-01-07 21:51 ` Theodore Ts'o
2017-12-13 9:13 [PATCH 0/2] ext4: Fix ENOSPC handling for DAX faults Jan Kara
[not found] ` <20171213091352.23448-1-jack-AlSwsSmVLrQ@public.gmane.org>
2017-12-13 9:13 ` [PATCH 1/2] dax: Pass detailed error code from dax_iomap_fault() Jan Kara
2017-12-13 9:13 ` Jan Kara
2017-12-13 9:13 ` Jan Kara
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=20180102185440.GD4911@quack2.suse.cz \
--to=jack@suse.cz \
--cc=dan.j.williams@intel.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nvdimm@lists.01.org \
--cc=ross.zwisler@linux.intel.com \
--cc=tytso@mit.edu \
/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.