All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH wip-fscrypt] ceph: reset "err = 0" after iov_get_pages_alloc in ceph_netfs_issue_read
@ 2022-07-07 14:08 Jeff Layton
  2022-07-08  0:27 ` Xiubo Li
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Layton @ 2022-07-07 14:08 UTC (permalink / raw)
  To: xiubli; +Cc: dhowells, ceph-devel, idryomov

Currently, when we call ceph_netfs_issue_read for an encrypted inode,
we'll call iov_iter_get_pages_alloc and assign its result to "err".
Later we'll end up inappropriately calling netfs_subreq_terminated with
that value after submitting the request. Ensure we reset "err = 0;"
after calling iov_iter_get_pages_alloc.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/ceph/addr.c | 1 +
 1 file changed, 1 insertion(+)

Probably this should get squashed into the patch that adds fscrypt
support to buffered reads.

diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index c713b5491012..64facef79883 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -376,6 +376,7 @@ static void ceph_netfs_issue_read(struct netfs_io_subrequest *subreq)
 		/* should always give us a page-aligned read */
 		WARN_ON_ONCE(page_off);
 		len = err;
+		err = 0;
 
 		osd_req_op_extent_osd_data_pages(req, 0, pages, len, 0, false, false);
 	} else {
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH wip-fscrypt] ceph: reset "err = 0" after iov_get_pages_alloc in ceph_netfs_issue_read
  2022-07-07 14:08 [PATCH wip-fscrypt] ceph: reset "err = 0" after iov_get_pages_alloc in ceph_netfs_issue_read Jeff Layton
@ 2022-07-08  0:27 ` Xiubo Li
  2022-07-08 10:57   ` Jeff Layton
  0 siblings, 1 reply; 4+ messages in thread
From: Xiubo Li @ 2022-07-08  0:27 UTC (permalink / raw)
  To: Jeff Layton; +Cc: dhowells, ceph-devel, idryomov


On 7/7/22 10:08 PM, Jeff Layton wrote:
> Currently, when we call ceph_netfs_issue_read for an encrypted inode,
> we'll call iov_iter_get_pages_alloc and assign its result to "err".
> Later we'll end up inappropriately calling netfs_subreq_terminated with
> that value after submitting the request. Ensure we reset "err = 0;"
> after calling iov_iter_get_pages_alloc.
>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>   fs/ceph/addr.c | 1 +
>   1 file changed, 1 insertion(+)
>
> Probably this should get squashed into the patch that adds fscrypt
> support to buffered reads.
>
> diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
> index c713b5491012..64facef79883 100644
> --- a/fs/ceph/addr.c
> +++ b/fs/ceph/addr.c
> @@ -376,6 +376,7 @@ static void ceph_netfs_issue_read(struct netfs_io_subrequest *subreq)
>   		/* should always give us a page-aligned read */
>   		WARN_ON_ONCE(page_off);
>   		len = err;
> +		err = 0;
>   
>   		osd_req_op_extent_osd_data_pages(req, 0, pages, len, 0, false, false);
>   	} else {
Looks good. Thanks Jeff!

Show we fold it into the previous patch ?

-- Xiubo



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH wip-fscrypt] ceph: reset "err = 0" after iov_get_pages_alloc in ceph_netfs_issue_read
  2022-07-08  0:27 ` Xiubo Li
@ 2022-07-08 10:57   ` Jeff Layton
  2022-07-11  4:37     ` Xiubo Li
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Layton @ 2022-07-08 10:57 UTC (permalink / raw)
  To: Xiubo Li; +Cc: dhowells, ceph-devel, idryomov

On Fri, 2022-07-08 at 08:27 +0800, Xiubo Li wrote:
> On 7/7/22 10:08 PM, Jeff Layton wrote:
> > Currently, when we call ceph_netfs_issue_read for an encrypted inode,
> > we'll call iov_iter_get_pages_alloc and assign its result to "err".
> > Later we'll end up inappropriately calling netfs_subreq_terminated with
> > that value after submitting the request. Ensure we reset "err = 0;"
> > after calling iov_iter_get_pages_alloc.
> > 
> > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > ---
> >   fs/ceph/addr.c | 1 +
> >   1 file changed, 1 insertion(+)
> > 
> > Probably this should get squashed into the patch that adds fscrypt
> > support to buffered reads.
> > 
> > diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
> > index c713b5491012..64facef79883 100644
> > --- a/fs/ceph/addr.c
> > +++ b/fs/ceph/addr.c
> > @@ -376,6 +376,7 @@ static void ceph_netfs_issue_read(struct netfs_io_subrequest *subreq)
> >   		/* should always give us a page-aligned read */
> >   		WARN_ON_ONCE(page_off);
> >   		len = err;
> > +		err = 0;
> >   
> >   		osd_req_op_extent_osd_data_pages(req, 0, pages, len, 0, false, false);
> >   	} else {
> Looks good. Thanks Jeff!
> 
> Show we fold it into the previous patch ?
> 
> -- Xiubo
> 
> 

Yes, please do.
-- 
Jeff Layton <jlayton@kernel.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH wip-fscrypt] ceph: reset "err = 0" after iov_get_pages_alloc in ceph_netfs_issue_read
  2022-07-08 10:57   ` Jeff Layton
@ 2022-07-11  4:37     ` Xiubo Li
  0 siblings, 0 replies; 4+ messages in thread
From: Xiubo Li @ 2022-07-11  4:37 UTC (permalink / raw)
  To: Jeff Layton; +Cc: dhowells, ceph-devel, idryomov


On 7/8/22 6:57 PM, Jeff Layton wrote:
> On Fri, 2022-07-08 at 08:27 +0800, Xiubo Li wrote:
>> On 7/7/22 10:08 PM, Jeff Layton wrote:
>>> Currently, when we call ceph_netfs_issue_read for an encrypted inode,
>>> we'll call iov_iter_get_pages_alloc and assign its result to "err".
>>> Later we'll end up inappropriately calling netfs_subreq_terminated with
>>> that value after submitting the request. Ensure we reset "err = 0;"
>>> after calling iov_iter_get_pages_alloc.
>>>
>>> Signed-off-by: Jeff Layton <jlayton@kernel.org>
>>> ---
>>>    fs/ceph/addr.c | 1 +
>>>    1 file changed, 1 insertion(+)
>>>
>>> Probably this should get squashed into the patch that adds fscrypt
>>> support to buffered reads.
>>>
>>> diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
>>> index c713b5491012..64facef79883 100644
>>> --- a/fs/ceph/addr.c
>>> +++ b/fs/ceph/addr.c
>>> @@ -376,6 +376,7 @@ static void ceph_netfs_issue_read(struct netfs_io_subrequest *subreq)
>>>    		/* should always give us a page-aligned read */
>>>    		WARN_ON_ONCE(page_off);
>>>    		len = err;
>>> +		err = 0;
>>>    
>>>    		osd_req_op_extent_osd_data_pages(req, 0, pages, len, 0, false, false);
>>>    	} else {
>> Looks good. Thanks Jeff!
>>
>> Show we fold it into the previous patch ?
>>
>> -- Xiubo
>>
>>
> Yes, please do.

Folded it into:

commit 7487b08568482dd113429134a2219e203214ae0d
Author: Jeff Layton <jlayton@kernel.org>
Date:   Sun Mar 20 09:35:58 2022 -0400

     ceph: add fscrypt decryption support to ceph_netfs_issue_op

     Force the use of sparse reads when the inode is encrypted, and add the
     appropriate code to decrypt the extent map after receiving.


Thanks!




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-07-11  4:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-07 14:08 [PATCH wip-fscrypt] ceph: reset "err = 0" after iov_get_pages_alloc in ceph_netfs_issue_read Jeff Layton
2022-07-08  0:27 ` Xiubo Li
2022-07-08 10:57   ` Jeff Layton
2022-07-11  4:37     ` Xiubo Li

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.