Skip to content

Commit 8a5ebd2

Browse files
sprasad-microsoftSteve French
authored andcommitted
cifs: update the lock ordering comments with new mutex
The lock ordering rules listed as comments in cifsglob.h were missing some lock details and also the fid_lock. Updated those notes in this commit. Signed-off-by: Shyam Prasad N <sprasad@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent b4f60a0 commit 8a5ebd2

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

fs/smb/client/cifsglob.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,8 +1991,7 @@ require use of the stronger protocol */
19911991
* TCP_Server_Info-> TCP_Server_Info cifs_get_tcp_session
19921992
* reconnect_mutex
19931993
* TCP_Server_Info->srv_mutex TCP_Server_Info cifs_get_tcp_session
1994-
* cifs_ses->session_mutex cifs_ses sesInfoAlloc
1995-
* cifs_tcon
1994+
* cifs_ses->session_mutex cifs_ses sesInfoAlloc
19961995
* cifs_tcon->open_file_lock cifs_tcon->openFileList tconInfoAlloc
19971996
* cifs_tcon->pending_opens
19981997
* cifs_tcon->stat_lock cifs_tcon->bytes_read tconInfoAlloc
@@ -2011,21 +2010,25 @@ require use of the stronger protocol */
20112010
* ->oplock_credits
20122011
* ->reconnect_instance
20132012
* cifs_ses->ses_lock (anything that is not protected by another lock and can change)
2013+
* sesInfoAlloc
20142014
* cifs_ses->iface_lock cifs_ses->iface_list sesInfoAlloc
20152015
* ->iface_count
20162016
* ->iface_last_update
2017-
* cifs_ses->chan_lock cifs_ses->chans
2017+
* cifs_ses->chan_lock cifs_ses->chans sesInfoAlloc
20182018
* ->chans_need_reconnect
20192019
* ->chans_in_reconnect
20202020
* cifs_tcon->tc_lock (anything that is not protected by another lock and can change)
2021+
* tcon_info_alloc
20212022
* inode->i_rwsem, taken by fs/netfs/locking.c e.g. should be taken before cifsInodeInfo locks
20222023
* cifsInodeInfo->open_file_lock cifsInodeInfo->openFileList cifs_alloc_inode
20232024
* cifsInodeInfo->writers_lock cifsInodeInfo->writers cifsInodeInfo_alloc
20242025
* cifsInodeInfo->lock_sem cifsInodeInfo->llist cifs_init_once
20252026
* ->can_cache_brlcks
20262027
* cifsInodeInfo->deferred_lock cifsInodeInfo->deferred_closes cifsInodeInfo_alloc
2027-
* cached_fids->cfid_list_lock cifs_tcon->cfids->entries init_cached_dirs
2028-
* cifsFileInfo->fh_mutex cifsFileInfo cifs_new_fileinfo
2028+
* cached_fids->cfid_list_lock cifs_tcon->cfids->entries init_cached_dirs
2029+
* cached_fid->fid_lock (anything that is not protected by another lock and can change)
2030+
* init_cached_dir
2031+
* cifsFileInfo->fh_mutex cifsFileInfo cifs_new_fileinfo
20292032
* cifsFileInfo->file_info_lock cifsFileInfo->count cifs_new_fileinfo
20302033
* ->invalidHandle initiate_cifs_search
20312034
* ->oplock_break_cancelled

0 commit comments

Comments
 (0)