cifs: Fix soft lockup during fsstress
authorRohith Surabattula <rohiths@microsoft.com>
Fri, 17 Sep 2021 17:29:42 +0000 (17:29 +0000)
committerSteve French <stfrench@microsoft.com>
Fri, 17 Sep 2021 21:54:25 +0000 (16:54 -0500)
Below traces are observed during fsstress and system got hung.
[  130.698396] watchdog: BUG: soft lockup - CPU#6 stuck for 26s!

Cc: stable@vger.kernel.org # 5.13+
Signed-off-by: Rohith Surabattula <rohiths@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/misc.c

index 05138f9..03da00e 100644 (file)
@@ -735,7 +735,7 @@ cifs_close_deferred_file(struct cifsInodeInfo *cifs_inode)
                        if (cancel_delayed_work(&cfile->deferred)) {
                                tmp_list = kmalloc(sizeof(struct file_list), GFP_ATOMIC);
                                if (tmp_list == NULL)
-                                       continue;
+                                       break;
                                tmp_list->cfile = cfile;
                                list_add_tail(&tmp_list->list, &file_head);
                        }
@@ -766,7 +766,7 @@ cifs_close_all_deferred_files(struct cifs_tcon *tcon)
                        if (cancel_delayed_work(&cfile->deferred)) {
                                tmp_list = kmalloc(sizeof(struct file_list), GFP_ATOMIC);
                                if (tmp_list == NULL)
-                                       continue;
+                                       break;
                                tmp_list->cfile = cfile;
                                list_add_tail(&tmp_list->list, &file_head);
                        }