Skip to contentSkip to conversation

ceph: call netfs_subreq_terminated with was_async == false

PATCH In review Jeff Layton 2 participants 2 messages Jun 7, 2022 – Jun 11, 2022 Ceph client

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: call netfs_subreq_terminated with was_async == false

"was_async" is a bit misleadingly named. It's supposed to indicate whether it's safe to call blocking operations from the context you're calling it from, but it sounds like it's asking whether this was done via async operation. For ceph, this it's always called from kernel thread context so it should be safe to set this to false.

---
 fs/ceph/addr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/addr.c +1 -1
index 3489444c55b9..39e2c64d008f 100644
@@ -241,7 +241,7 @@ static void finish_netfs_read(struct ceph_osd_request *req)
 	if (err >= 0 && err < subreq->len)
 		__set_bit(NETFS_SREQ_CLEAR_TAIL, &subreq->flags);
 
-	netfs_subreq_terminated(subreq, err, true);
+	netfs_subreq_terminated(subreq, err, false);
 
 	num_pages = calc_pages_for(osd_data->alignment, osd_data->length);
 	ceph_put_page_vector(osd_data->pages, num_pages, false);
Signature · 1 line
2.36.1
#1 lore raw
Quoted 17 lines · Jeff Layton

"was_async" is a bit misleadingly named. It's supposed to indicate whether it's safe to call blocking operations from the context you're calling it from, but it sounds like it's asking whether this was done via async operation. For ceph, this it's always called from kernel thread context so it should be safe to set this to false.

---
  fs/ceph/addr.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/addr.c +0 -0
index 3489444c55b9..39e2c64d008f 100644

fs/ceph/addr.c static void finish_netfs_read(struct ceph_osd_request *req) · line 247

Quoted 8 lines
fs/ceph/addr.c +1 -1
@@ -241,7 +241,7 @@ static void finish_netfs_read(struct ceph_osd_request *req)
  	if (err >= 0 && err < subreq->len)
  		__set_bit(NETFS_SREQ_CLEAR_TAIL, &subreq->flags);
 
-	netfs_subreq_terminated(subreq, err, true);
+	netfs_subreq_terminated(subreq, err, false);
 
  	num_pages = calc_pages_for(osd_data->alignment, osd_data->length);
  	ceph_put_page_vector(osd_data->pages, num_pages, false);

Sorry, I think I missed this one.

LGTM. Thanks Jeff !

-- Xiubo