[Samba] Samba does not report I/O error to the client

Dmitry Katsubo dma_k at mail.ru
Tue Dec 26 23:12:33 UTC 2017


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



More information about the samba mailing list