linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Aurélien Aptel" <aaptel@suse.com>
To: Steve French <smfrench@gmail.com>, CIFS <linux-cifs@vger.kernel.org>
Subject: Re: [PATCH] cifs: correct comments explaining internal semaphore usage in the module
Date: Mon, 12 Apr 2021 18:16:13 +0200	[thread overview]
Message-ID: <87h7kb32cy.fsf@suse.com> (raw)
In-Reply-To: <CAH2r5mvmsdai3iCwpohqUeeiW5tPSeiQgCH8DcpicWntc25rNg@mail.gmail.com>

Steve French <smfrench@gmail.com> writes:
> A few of the semaphores had been removed, and one additional one
> needed to be noted in the comments.   (Additional updates to the
> semaphore/mutex/lock descriptions in the comments in cifsglob.h
> could be helpful to make sure they accurately reflect what protects
> what).

That's a very good idea. A good starting point would be:

  $ grep 'struct[\t ]*mutex\|spinlock_t\|rw_semaphore\|seqlock_t\|rcu_.*lock' fs/cifs/*[ch]

  fs/cifs/cifs_fs_sb.h:   spinlock_t tlink_tree_lock;
  fs/cifs/cifsglob.h:     spinlock_t req_lock;  /* protect the two values above */
  fs/cifs/cifsglob.h:     struct mutex srv_mutex;
  fs/cifs/cifsglob.h:     struct mutex reconnect_mutex; /* prevent simultaneous reconnects */
  fs/cifs/cifsglob.h:     struct mutex session_mutex;
  fs/cifs/cifsglob.h:     spinlock_t iface_lock;
  fs/cifs/cifsglob.h:     struct mutex fid_mutex;
  fs/cifs/cifsglob.h:     spinlock_t open_file_lock; /* protects list above */
  fs/cifs/cifsglob.h:     spinlock_t stat_lock;  /* protects the two fields above */
  fs/cifs/cifsglob.h:     spinlock_t file_info_lock; /* protects four flag/count fields above */
  fs/cifs/cifsglob.h:     struct mutex fh_mutex; /* prevents reopen race after dead ses*/
  fs/cifs/cifsglob.h:     struct mutex            aio_mutex;
  fs/cifs/cifsglob.h:     struct rw_semaphore lock_sem;   /* protect the fields above */
  fs/cifs/cifsglob.h:     spinlock_t      open_file_lock; /* protects openFileList */
  fs/cifs/cifsglob.h:     spinlock_t writers_lock;
  fs/cifs/cifsglob.h:GLOBAL_EXTERN spinlock_t             cifs_tcp_ses_lock;
  fs/cifs/cifsglob.h:GLOBAL_EXTERN spinlock_t GlobalMid_Lock;  /* protects above & list operations */
  fs/cifs/cifsproto.h:extern void cifs_down_write(struct rw_semaphore *sem);
  fs/cifs/dfs_cache.c:    spinlock_t ctx_lock;
  fs/cifs/dir.c:  rcu_read_lock();
  fs/cifs/dir.c:                  rcu_read_unlock();
  fs/cifs/dir.c:  rcu_read_unlock();
  fs/cifs/dir.c:  rcu_read_lock();
  fs/cifs/dir.c:                  rcu_read_unlock();
  fs/cifs/dir.c:  rcu_read_unlock();
  fs/cifs/file.c:cifs_down_write(struct rw_semaphore *sem)
  fs/cifs/smbdirect.h:    spinlock_t lock_new_credits_offered;
  fs/cifs/smbdirect.h:    spinlock_t mr_list_lock;
  fs/cifs/smbdirect.h:    spinlock_t receive_queue_lock;
  fs/cifs/smbdirect.h:    spinlock_t empty_packet_queue_lock;
  fs/cifs/smbdirect.h:    spinlock_t reassembly_queue_lock;

Cheers,
-- 
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)


      reply	other threads:[~2021-04-12 16:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 19:51 [PATCH] cifs: correct comments explaining internal semaphore usage in the module Steve French
2021-04-12 16:16 ` Aurélien Aptel [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=87h7kb32cy.fsf@suse.com \
    --to=aaptel@suse.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=smfrench@gmail.com \
    /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).