无法使用 CIFS 共享

无法使用 CIFS 共享

从 Ubuntu 18.04 LTS 升级到 20.04 LTS 后,我无法再使用 SMB 共享。我尝试从头开始重新安装操作系统,但结果是一样的。

  • fstab这是文件的内容
//<REMOTE_IP>/satdata                 /home/store             cifs    credentials=/etc/password/******.txt,uid=d*****e,gid=f****g,nodfs,noserverino,vers=2.1           0       0
  • 命令的输出mount -a
Aug  9 10:36:25 server-name kernel: [  491.645084] FS-Cache: Netfs 'cifs' registered for caching
Aug  9 10:36:25 server-name kernel: [  491.656554] Key type cifs.spnego registered
Aug  9 10:36:25 server-name kernel: [  491.656561] Key type cifs.idmap registered
Aug  9 10:36:25 server-name kernel: [  491.657220] CIFS: Attempting to mount //<REMOTE_IP>/satdata
Aug  9 10:36:25 server-name kernel: [  491.725987] CIFS VFS: \\<REMOTE_IP>\IPC$ DFS capability contradicts DFS flag
Aug  9 10:36:25 server-name kernel: [  491.727233] CIFS VFS: \\<REMOTE_IP>\satdata DFS capability contradicts DFS flag
  • 我能够看到正确连接的共享和共享中的文件:
~# df -h
Filesystem                Size  Used Avail Use% Mounted on
udev                      481G     0  481G   0% /dev
tmpfs                      97G  5.9M   97G   1% /run
[..cut output..]
//<REMOTE_IP>/satdata   8.5T  8.4T  168G  99% /home/store

~# ls -lha /home/store/
total 223M
drwxr-xr-x  2 ***** *****    0 Aug  2 11:46  .
drwxr-xr-x 20 ***** *****    4.0K Jun 24 09:57  ..
-rwxr-xr-x  1 ***** ***** 147M Jan 28  2021  Anim_BLUE_SHARK_125-180cm_F_2003-2018_North_Pacific_and_Atlantic__Feeding_100ms.gif
drwxr-xr-x  2 ***** *****    0 Sep  1  2010  BATHYMETRY
  • 我可以在共享上正常工作,但在随机时间(1 分钟、1 小时等)之后,此消息就会出现在syslog
Aug  9 11:41:00 server-name kernel: [ 4366.982643] INFO: task cifsd:4480 blocked for more than 120 seconds.
Aug  9 11:41:00 server-name kernel: [ 4366.982726]       Not tainted 5.4.0-80-generic #90-Ubuntu
Aug  9 11:41:00 server-name kernel: [ 4366.982763] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Aug  9 11:41:00 server-name kernel: [ 4366.982812] cifsd           D    0  4480      2 0x80004000
Aug  9 11:41:00 server-name kernel: [ 4366.982818] Call Trace:
Aug  9 11:41:00 server-name kernel: [ 4366.982843]  __schedule+0x2e3/0x740
Aug  9 11:41:00 server-name kernel: [ 4366.982852]  schedule+0x42/0xb0
Aug  9 11:41:00 server-name kernel: [ 4366.982856]  schedule_preempt_disabled+0xe/0x10
Aug  9 11:41:00 server-name kernel: [ 4366.982861]  __mutex_lock.isra.0+0x178/0x4d0
Aug  9 11:41:00 server-name kernel: [ 4366.982876]  ? release_sock+0x8f/0xa0
Aug  9 11:41:00 server-name kernel: [ 4366.982879]  __mutex_lock_slowpath+0x13/0x20
Aug  9 11:41:00 server-name kernel: [ 4366.982882]  mutex_lock+0x2e/0x40
Aug  9 11:41:00 server-name kernel: [ 4366.983193]  dfs_cache_update_vol+0x41/0x2b0 [cifs]
Aug  9 11:41:00 server-name kernel: [ 4366.983271]  cifs_reconnect+0x623/0xdb0 [cifs]
Aug  9 11:41:00 server-name kernel: [ 4366.983314]  cifs_handle_standard+0x18e/0x1b0 [cifs]
Aug  9 11:41:00 server-name kernel: [ 4366.983357]  cifs_demultiplex_thread+0xb05/0xcd0 [cifs]
Aug  9 11:41:00 server-name kernel: [ 4366.983363]  ? __schedule+0x2eb/0x740
Aug  9 11:41:00 server-name kernel: [ 4366.983379]  kthread+0x104/0x140
Aug  9 11:41:00 server-name kernel: [ 4366.983429]  ? cifs_handle_standard+0x1b0/0x1b0 [cifs]
Aug  9 11:41:00 server-name kernel: [ 4366.983432]  ? kthread_park+0x90/0x90
Aug  9 11:41:00 server-name kernel: [ 4366.983436]  ret_from_fork+0x35/0x40
Aug  9 11:43:01 server-name kernel: [ 4487.811684] INFO: task kworker/137:2:1924 blocked for more than 120 seconds.
Aug  9 11:43:01 server-name kernel: [ 4487.811764]       Not tainted 5.4.0-80-generic #90-Ubuntu
Aug  9 11:43:01 server-name kernel: [ 4487.811807] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Aug  9 11:43:01 server-name kernel: [ 4487.811859] kworker/137:2   D    0  1924      2 0x80004000
Aug  9 11:43:01 server-name kernel: [ 4487.812373] Workqueue: cifsiod smb2_reconnect_server [cifs]
Aug  9 11:43:01 server-name kernel: [ 4487.812377] Call Trace:
Aug  9 11:43:01 server-name kernel: [ 4487.812409]  __schedule+0x2e3/0x740
Aug  9 11:43:01 server-name kernel: [ 4487.812436]  ? mempool_alloc_slab+0x17/0x20
Aug  9 11:43:01 server-name kernel: [ 4487.812440]  schedule+0x42/0xb0
Aug  9 11:43:01 server-name kernel: [ 4487.812445]  schedule_preempt_disabled+0xe/0x10
Aug  9 11:43:01 server-name kernel: [ 4487.812454]  __mutex_lock.isra.0+0x178/0x4d0
Aug  9 11:43:01 server-name kernel: [ 4487.812460]  __mutex_lock_slowpath+0x13/0x20
Aug  9 11:43:01 server-name kernel: [ 4487.812463]  mutex_lock+0x2e/0x40
Aug  9 11:43:01 server-name kernel: [ 4487.812655]  smb2_reconnect.part.0+0xdf/0x4f0 [cifs]
Aug  9 11:43:01 server-name kernel: [ 4487.812672]  ? __internal_add_timer+0x2d/0x40
Aug  9 11:43:01 server-name kernel: [ 4487.812725]  smb2_reconnect_server+0x16e/0x2c0 [cifs]
Aug  9 11:43:01 server-name kernel: [ 4487.812751]  process_one_work+0x1eb/0x3b0
Aug  9 11:43:01 server-name kernel: [ 4487.812755]  worker_thread+0x4d/0x400
Aug  9 11:43:01 server-name kernel: [ 4487.812769]  kthread+0x104/0x140
Aug  9 11:43:01 server-name kernel: [ 4487.812773]  ? process_one_work+0x3b0/0x3b0
Aug  9 11:43:01 server-name kernel: [ 4487.812775]  ? kthread_park+0x90/0x90
Aug  9 11:43:01 server-name kernel: [ 4487.812779]  ret_from_fork+0x35/0x40
Aug  9 11:43:01 server-name kernel: [ 4487.812981] INFO: task cifsd:4480 blocked for more than 241 seconds.
Aug  9 11:43:01 server-name kernel: [ 4487.813038]       Not tainted 5.4.0-80-generic #90-Ubuntu
Aug  9 11:43:01 server-name kernel: [ 4487.813076] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Aug  9 11:43:01 server-name kernel: [ 4487.813130] cifsd           D    0  4480      2 0x80004000
Aug  9 11:43:01 server-name kernel: [ 4487.813134] Call Trace:
Aug  9 11:43:01 server-name kernel: [ 4487.813143]  __schedule+0x2e3/0x740
Aug  9 11:43:01 server-name kernel: [ 4487.813149]  schedule+0x42/0xb0
Aug  9 11:43:01 server-name kernel: [ 4487.813153]  schedule_preempt_disabled+0xe/0x10
Aug  9 11:43:01 server-name kernel: [ 4487.813157]  __mutex_lock.isra.0+0x178/0x4d0
Aug  9 11:43:01 server-name kernel: [ 4487.813176]  ? release_sock+0x8f/0xa0
Aug  9 11:43:01 server-name kernel: [ 4487.813181]  __mutex_lock_slowpath+0x13/0x20
Aug  9 11:43:01 server-name kernel: [ 4487.813185]  mutex_lock+0x2e/0x40
Aug  9 11:43:01 server-name kernel: [ 4487.813278]  dfs_cache_update_vol+0x41/0x2b0 [cifs]
Aug  9 11:43:01 server-name kernel: [ 4487.813362]  cifs_reconnect+0x623/0xdb0 [cifs]
Aug  9 11:43:01 server-name kernel: [ 4487.813448]  cifs_handle_standard+0x18e/0x1b0 [cifs]
Aug  9 11:43:01 server-name kernel: [ 4487.813535]  cifs_demultiplex_thread+0xb05/0xcd0 [cifs]
Aug  9 11:43:01 server-name kernel: [ 4487.813541]  ? __schedule+0x2eb/0x740
Aug  9 11:43:01 server-name kernel: [ 4487.813548]  kthread+0x104/0x140
Aug  9 11:43:01 server-name kernel: [ 4487.813595]  ? cifs_handle_standard+0x1b0/0x1b0 [cifs]
Aug  9 11:43:01 server-name kernel: [ 4487.813598]  ? kthread_park+0x90/0x90
Aug  9 11:43:01 server-name kernel: [ 4487.813602]  ret_from_fork+0x35/0x40

收到该消息后,我无法查看共享内容或运行简单df -h命令。重新访问共享的唯一方法是重新启动服务器。

  • 附加信息:
Linux server-name 5.4.0-80-generic #90-Ubuntu SMP Fri Jul 9 22:49:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
# dpkg -l | grep cifs
ii  cifs-utils                           2:6.9-1ubuntu0.1                      amd64        

Common Internet File System utilities

您能帮助我了解如何修复该错误吗?

非常感谢

答案1

我有三台服务器受到同一问题的困扰(Ubuntu 20.04,内核 5.4.0-xx)。因为这个问题不会发生在 Ubuntu 18.04(内核 4.15.0-xxx)或 Ubuntu 21.04(内核 5.11.0-xx)上。我决定将我的 Ubuntu 20.04 服务器切换到内核 5.11.0-xx,这解决了我的服务器的问题。

相关内容