[PATCH] tools/xenstored: Remove redundant check in socket_can_process()

Julien Grall posted 1 patch 2 years, 10 months ago
Test gitlab-ci failed
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20210624144655.12900-1-julien@xen.org
tools/xenstore/xenstored_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] tools/xenstored: Remove redundant check in socket_can_process()
Posted by Julien Grall 2 years, 10 months ago
From: Julien Grall <jgrall@amazon.com>

Commit 3adfb50315d9 ("tools/xenstored: Introduce a wrapper for
conn->funcs->can_{read, write}") consolidated the check
!conn->is_ignored in two new wrappers.

This means the check in socket_can_process() is now redundant. In
fact it should have been removed in orignal commit (as it was done
for the domain helpers).

Reported-by: Raphael Ning <raphning@amazon.com
Signed-off-by: Julien Grall <jgrall@amazon.com>
---
 tools/xenstore/xenstored_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
index 9ffd2ac66d3e..cf7297a96cb1 100644
--- a/tools/xenstore/xenstored_core.c
+++ b/tools/xenstore/xenstored_core.c
@@ -1752,7 +1752,7 @@ static bool socket_can_process(struct connection *conn, int mask)
 		return false;
 	}
 
-	return (fds[conn->pollfd_idx].revents & mask) && !conn->is_ignored;
+	return (fds[conn->pollfd_idx].revents & mask);
 }
 
 static bool socket_can_write(struct connection *conn)
-- 
2.17.1


Re: [PATCH] tools/xenstored: Remove redundant check in socket_can_process()
Posted by Juergen Gross 2 years, 10 months ago
On 24.06.21 16:46, Julien Grall wrote:
> From: Julien Grall <jgrall@amazon.com>
> 
> Commit 3adfb50315d9 ("tools/xenstored: Introduce a wrapper for
> conn->funcs->can_{read, write}") consolidated the check
> !conn->is_ignored in two new wrappers.
> 
> This means the check in socket_can_process() is now redundant. In
> fact it should have been removed in orignal commit (as it was done
> for the domain helpers).
> 
> Reported-by: Raphael Ning <raphning@amazon.com
> Signed-off-by: Julien Grall <jgrall@amazon.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen
Re: [PATCH] tools/xenstored: Remove redundant check in socket_can_process()
Posted by Julien Grall 2 years, 10 months ago
Hi Juergen,

On 24/06/2021 16:53, Juergen Gross wrote:
> On 24.06.21 16:46, Julien Grall wrote:
>> From: Julien Grall <jgrall@amazon.com>
>>
>> Commit 3adfb50315d9 ("tools/xenstored: Introduce a wrapper for
>> conn->funcs->can_{read, write}") consolidated the check
>> !conn->is_ignored in two new wrappers.
>>
>> This means the check in socket_can_process() is now redundant. In
>> fact it should have been removed in orignal commit (as it was done
>> for the domain helpers).
>>
>> Reported-by: Raphael Ning <raphning@amazon.com
>> Signed-off-by: Julien Grall <jgrall@amazon.com>
> 
> Reviewed-by: Juergen Gross <jgross@suse.com>

Thanks! Committed.

Cheers,

-- 
Julien Grall