kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "libaokun (A)" <libaokun1@huawei.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Steve French <sfrench@samba.org>, <linux-cifs@vger.kernel.org>,
	<samba-technical@lists.samba.org>,
	<kernel-janitors@vger.kernel.org>,
	"Hulk Robot" <hulkci@huawei.com>
Subject: Re: [PATCH -next] cifs: convert list_for_each to entry variant in smb2misc.c
Date: Fri, 18 Jun 2021 09:18:18 +0800	[thread overview]
Message-ID: <e1804505-b984-ac6b-a204-22d24ef7ae21@huawei.com> (raw)
In-Reply-To: <20210617141717.GF1861@kadam>

Thank you for your advice.

I'm about to send a patch v2 with the changes suggested by you.

Best Regards.


在 2021/6/17 22:17, Dan Carpenter 写道:
> On Thu, Jun 17, 2021 at 09:22:50PM +0800, Baokun Li wrote:
>> @@ -628,9 +624,7 @@ smb2_is_valid_lease_break(char *buffer)
>>   
>>   	/* look up tcon based on tid & uid */
>>   	spin_lock(&cifs_tcp_ses_lock);
>> -	list_for_each(tmp, &cifs_tcp_ses_list) {
>> -		server = list_entry(tmp, struct TCP_Server_Info, tcp_ses_list);
>> -
>> +	list_for_each_entry(server, &cifs_tcp_ses_list, tcp_ses_list) {
>>   		list_for_each(tmp1, &server->smb_ses_list) {
>>   			ses = list_entry(tmp1, struct cifs_ses, smb_ses_list);
>                          ^^^^^^^^^^^^^^^^
>
> Please convert this one as well.
>
>>   
>> @@ -687,7 +681,7 @@ bool
>>   smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
>>   {
>>   	struct smb2_oplock_break *rsp = (struct smb2_oplock_break *)buffer;
>> -	struct list_head *tmp, *tmp1, *tmp2;
>> +	struct list_head *tmp1, *tmp2;
>>   	struct cifs_ses *ses;
>>   	struct cifs_tcon *tcon;
>>   	struct cifsInodeInfo *cinode;
>> @@ -710,9 +704,7 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
>>   
>>   	/* look up tcon based on tid & uid */
>>   	spin_lock(&cifs_tcp_ses_lock);
>> -	list_for_each(tmp, &server->smb_ses_list) {
>> -		ses = list_entry(tmp, struct cifs_ses, smb_ses_list);
>> -
>> +	list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) {
>>   		list_for_each(tmp1, &ses->tcon_list) {
>>   			tcon = list_entry(tmp1, struct cifs_tcon, tcon_list);
>                          ^^^^^^^^^^^^^^^^^
> And this one.
>
> regards,
> dan carpenter
>
>>   
> .

      reply	other threads:[~2021-06-18  1:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17 13:22 [PATCH -next] cifs: convert list_for_each to entry variant in smb2misc.c Baokun Li
2021-06-17 14:17 ` Dan Carpenter
2021-06-18  1:18   ` libaokun (A) [this message]

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=e1804505-b984-ac6b-a204-22d24ef7ae21@huawei.com \
    --to=libaokun1@huawei.com \
    --cc=dan.carpenter@oracle.com \
    --cc=hulkci@huawei.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=samba-technical@lists.samba.org \
    --cc=sfrench@samba.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).