Dmitry Katsubo
2017-Dec-26 23:12 UTC
[Samba] Samba does not report I/O error to the client
Dear Samba community, I am facing the following problem. I have the following share in my /etc/samba/smb.conf: [external] comment = "External Hard Drive" path = /mnt/external read only = no Sometimes it happens that external hard drive fails. Kernel issues USB reset and the device /dev/sde1 in example below becomes invalid/inaccessible: Dec 26 21:41:03.523585 kernel: usb 5-2: reset high-speed USB device number 3 using ehci-pci Dec 26 21:41:03.979588 kernel: usb 5-2.1: new high-speed USB device number 100 using ehci-pci Dec 26 21:41:04.167542 kernel: usb 5-2.1: New USB device found, idVendor=1058, idProduct=1104 Dec 26 21:41:04.168074 kernel: usb 5-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 Dec 26 21:41:04.168379 kernel: usb 5-2.1: Product: My Book Dec 26 21:41:04.168687 kernel: usb 5-2.1: Manufacturer: Western Digital Dec 26 21:41:04.168995 kernel: usb 5-2.1: SerialNumber: 575532553130303530353538 Dec 26 21:41:04.191879 kernel: usb-storage 5-2.1:1.0: USB Mass Storage device detected Dec 26 21:41:13.365071 kernel: blk_partition_remap: fail for partition 1 Dec 26 21:41:13.365382 kernel: EXT4-fs warning (device sde1): dx_probe:744: inode #35151873: lblock 0: comm smbd: error -5 reading directory block Dec 26 21:41:13.365522 kernel: blk_partition_remap: fail for partition 1 Dec 26 21:41:13.365658 kernel: EXT4-fs warning (device sde1): dx_probe:744: inode #35151873: lblock 0: comm smbd: error -5 reading directory block Filesystem correctly reports this situation: $ ll /mnt/external ls: reading directory '/mnt/external': Input/output error total 0 However when I browse this share via Samba client, it reports that the directory is simply empty: $ smbclient //server/external -U dmitry%password -c ls Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.5.12-Debian] . D 0 Mon Dec 25 22:39:29 2017 .. D 0 Sun Apr 24 19:50:32 2016 1922727728 blocks of size 1024. 45707296 blocks available How can I change the behaviour so that I/O error is appropriately reported, e.g. the client gets "Error reading directory"? Many thanks. -- With best regards, Dmitry
Jeremy Allison
2018-Jan-02 18:46 UTC
[Samba] Samba does not report I/O error to the client
On Wed, Dec 27, 2017 at 12:12:33AM +0100, Dmitry Katsubo via samba wrote:> Dear Samba community, > > I am facing the following problem. I have the following share in my > /etc/samba/smb.conf: > > [external] > comment = "External Hard Drive" > path = /mnt/external > read only = no > > Sometimes it happens that external hard drive fails. Kernel issues USB reset and > the device /dev/sde1 in example below becomes invalid/inaccessible: > > Dec 26 21:41:03.523585 kernel: usb 5-2: reset high-speed USB device number 3 using ehci-pci > Dec 26 21:41:03.979588 kernel: usb 5-2.1: new high-speed USB device number 100 using ehci-pci > Dec 26 21:41:04.167542 kernel: usb 5-2.1: New USB device found, idVendor=1058, idProduct=1104 > Dec 26 21:41:04.168074 kernel: usb 5-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 > Dec 26 21:41:04.168379 kernel: usb 5-2.1: Product: My Book > Dec 26 21:41:04.168687 kernel: usb 5-2.1: Manufacturer: Western Digital > Dec 26 21:41:04.168995 kernel: usb 5-2.1: SerialNumber: 575532553130303530353538 > Dec 26 21:41:04.191879 kernel: usb-storage 5-2.1:1.0: USB Mass Storage device detected > Dec 26 21:41:13.365071 kernel: blk_partition_remap: fail for partition 1 > Dec 26 21:41:13.365382 kernel: EXT4-fs warning (device sde1): dx_probe:744: inode #35151873: lblock 0: comm smbd: error -5 reading directory block > Dec 26 21:41:13.365522 kernel: blk_partition_remap: fail for partition 1 > Dec 26 21:41:13.365658 kernel: EXT4-fs warning (device sde1): dx_probe:744: inode #35151873: lblock 0: comm smbd: error -5 reading directory block > > Filesystem correctly reports this situation: > > $ ll /mnt/external > ls: reading directory '/mnt/external': Input/output error > total 0 > > However when I browse this share via Samba client, it reports that the directory > is simply empty: > > $ smbclient //server/external -U dmitry%password -c ls > Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.5.12-Debian] > . D 0 Mon Dec 25 22:39:29 2017 > .. D 0 Sun Apr 24 19:50:32 2016 > 1922727728 blocks of size 1024. 45707296 blocks available > > How can I change the behaviour so that I/O error is appropriately reported, e.g. > the client gets "Error reading directory"? > > Many thanks.We'll need to see the log from smbd to see where the IO error is getting dropped.
Dmitry Katsubo
2018-Jan-02 19:14 UTC
[Samba] Samba does not report I/O error to the client
On 2018-01-02 19:46, Jeremy Allison wrote:> We'll need to see the log from smbd to see where the IO error is > getting dropped.Thanks for reply. Which log level should be sufficient? My current setting is log level = 2 and I don't see any error(s) in /var/log/samba/log.smbd -- With best regards, Dmitry