You are not logged in.

#1 2012-02-14 04:36:30

peoro
Member
Registered: 2007-06-10
Posts: 63

CIFS: Client problems when samba server fails

Hello,

I've got a samba server on a debian testing, and am mounting one of its share via fstab on a few other machines running arch:

//ricreativo/Condivisa        /media/ricreativo cifs  user=cdc,pass=********* 0 0

When the server goes down, anything on the clients that tries to access /media/ricreativo hangs (this also includes umount, shutdown processes and pacman while "checking for file conflicts").

Kernel even prints something in dmesg about this problem:

[117360.364080] INFO: task ls:5959 blocked for more than 120 seconds.
[117360.364087] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[117360.364093] ls              D f4aadc70     0  5959   5843 0x00000004
[117360.364106]  f4aadcd4 00000086 8e407f7e f4aadc70 c102bb44 fffff000 f54a8000 c186dec0
[117360.364116]  c186dec0 58771e52 00006a90 f5905ec0 f54c3300 f54a8000 00000000 f655f740
[117360.364126]  00000001 00000001 f59069e4 f655f740 f59069f4 f4aadd00 c10e63ed 00000002
[117360.364137] Call Trace:
[117360.364150]  [<c102bb44>] ? kmap_atomic_prot+0xe4/0x100
[117360.364157]  [<c10e63ed>] ? get_page_from_freelist+0x13d/0x2a0
[117360.364164]  [<c152cc75>] schedule+0x35/0x50
[117360.364169]  [<c152d816>] __mutex_lock_slowpath+0xc6/0x120
[117360.364174]  [<c152d4c4>] mutex_lock+0x24/0x40
[117360.364188]  [<f858087c>] cifs_reconnect_tcon+0x13c/0x2a0 [cifs]
[117360.364197]  [<c128318d>] ? radix_tree_lookup_slot+0xd/0x10
[117360.364207]  [<f8580e3c>] smb_init+0x2c/0x90 [cifs]
[117360.364216]  [<f8585d91>] CIFSSMBUnixQPathInfo+0x61/0x2a0 [cifs]
[117360.364230]  [<f8598be5>] cifs_get_inode_info_unix+0x75/0x190 [cifs]
[117360.364237]  [<c113364e>] ? __follow_mount_rcu.isra.11+0x2e/0xb0
[117360.364243]  [<c11348ff>] ? do_lookup+0x8f/0x270
[117360.364248]  [<c1142a89>] ? vfsmount_lock_local_unlock+0x19/0x20
[117360.364255]  [<c1133d05>] ? complete_walk+0x85/0x100
[117360.364263]  [<c11196a5>] ? __kmalloc+0x195/0x1e0
[117360.364269]  [<c1135e93>] ? path_lookupat+0x63/0x650
[117360.364281]  [<f859036d>] ? build_path_from_dentry+0xcd/0x250 [cifs]
[117360.364290]  [<f859036d>] ? build_path_from_dentry+0xcd/0x250 [cifs]
[117360.364298]  [<c1289958>] ? strncpy_from_user+0x38/0x70
[117360.364305]  [<c152e68d>] ? _raw_spin_lock+0xd/0x10
[117360.364318]  [<f859b398>] ? _GetXid+0x58/0x80 [cifs]
[117360.364329]  [<f8599f36>] cifs_revalidate_dentry_attr+0xa6/0x1a0 [cifs]
[117360.364340]  [<f859a102>] cifs_getattr+0x52/0x120 [cifs]
[117360.364345]  [<c112d592>] vfs_getattr+0x42/0x70
[117360.364357]  [<f859a0b0>] ? cifs_revalidate_dentry+0x40/0x40 [cifs]
[117360.364362]  [<c112d627>] vfs_fstatat+0x67/0x80
[117360.364369]  [<c112d690>] vfs_stat+0x20/0x30
[117360.364375]  [<c112d906>] sys_stat64+0x16/0x30
[117360.364381]  [<c1289c12>] ? _copy_from_user+0x42/0x60
[117360.364388]  [<c105bc02>] ? sys_rt_sigaction+0x72/0xa0
[117360.364395]  [<c1531bc0>] ? vmalloc_fault+0xee/0xee
[117360.364399]  [<c152eaa4>] syscall_call+0x7/0xb

What am I supposed to do in order to avoid these client issues when Samba server fails?

Offline

#2 2012-02-14 05:36:39

cybertorture
Member
Registered: 2010-05-05
Posts: 338

Re: CIFS: Client problems when samba server fails

mount cifs with "_netdev" option and put "rc.d stop netfs" in /etc/rc.local.shutdown


O' rly ? Ya rly Oo

Offline

#3 2012-02-14 06:45:09

peoro
Member
Registered: 2007-06-10
Posts: 63

Re: CIFS: Client problems when samba server fails

I don't think that's needed: when the Samba server works correctly, clients shutdown without any issue.

Moreover netfs is already in DAEMONS array and the "_netdev" mount option isn't necessary anymore, I think.

I believe that the shutdown process tries to invoke umount at the right time, but umount simply hangs as it does if I invoke it in a shell.

Offline

#4 2012-02-15 03:37:43

bog
Member
Registered: 2010-12-02
Posts: 11

Re: CIFS: Client problems when samba server fails

Try to lazy umount the filesystem when the server goes down with "umount -l /media/ricreativo". When it comes up mount it normally with "mount /media/ricreativo". The lazy umount should take no time.

Offline

Board footer

Powered by FluxBB