Commit 9fb0db4
cifs: fix potential deadlock in cache_refresh_path()
Avoid getting DFS referral from an exclusive lock in
cache_refresh_path() because the tcon IPC used for getting the
referral could be disconnected and thus causing a deadlock as shown
below:
task A task B
====== ======
cifs_demultiplex_thread() dfs_cache_find()
cifs_handle_standard() cache_refresh_path()
reconnect_dfs_server() down_write()
dfs_cache_noreq_find() get_dfs_referral()
down_read() <- deadlock smb2_get_dfs_refer()
SMB2_ioctl()
cifs_send_recv()
compound_send_recv()
wait_for_response()
where task A cannot wake up task B because it is blocked on
down_read() due to the exclusive lock held in cache_refresh_path() and
therefore not being able to make progress.
Fixes: c9f7110 ("cifs: keep referral server sessions alive")
Reviewed-by: Aurélien Aptel <[email protected]>
Signed-off-by: Paulo Alcantara (SUSE) <[email protected]>
Signed-off-by: Steve French <[email protected]>1 parent 5dc4c99 commit 9fb0db4
1 file changed
+23
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
770 | 770 | | |
771 | 771 | | |
772 | 772 | | |
773 | | - | |
774 | | - | |
775 | 773 | | |
| 774 | + | |
776 | 775 | | |
777 | | - | |
| 776 | + | |
778 | 777 | | |
779 | 778 | | |
780 | 779 | | |
781 | | - | |
| 780 | + | |
782 | 781 | | |
783 | 782 | | |
784 | | - | |
785 | | - | |
786 | | - | |
787 | | - | |
788 | | - | |
789 | | - | |
790 | | - | |
791 | | - | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
792 | 786 | | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
793 | 794 | | |
794 | 795 | | |
795 | 796 | | |
796 | 797 | | |
797 | 798 | | |
798 | 799 | | |
799 | 800 | | |
800 | | - | |
| 801 | + | |
801 | 802 | | |
802 | 803 | | |
803 | 804 | | |
804 | | - | |
805 | | - | |
806 | | - | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
807 | 813 | | |
808 | 814 | | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | 815 | | |
| 816 | + | |
813 | 817 | | |
814 | 818 | | |
815 | 819 | | |
| |||
0 commit comments