IO错误在CIFS OSX的无匹配glob – > debian jessie mount

在Debain Jessie 8.2中,当samaba cifs mount没有匹配时,在bash使用通配符/ glob(至less是*? )会导致input/output error 。 在其他文件系统上,预期No such file错误。

在archlinux盒子上的同样的samaba安装点并且没有io错误。 Archlinux机器的mount.cifs理解mapposix 。 我怀疑jessie上的mount.cifs不允许/理解mapposix与此有关。

是否有绕过io错误的*


  ## works as expected on cifs mount from centos server ls /data/Luna1/*adfadf* # ls: cannot access /data/Luna1/*adfadf*: No such file or director ### unexpected io failure on osx mounted on debian mkdir /Volumes/Phillips/testdir ## no files match in empty directory: io error ls /Volumes/Phillips/testdir/* # ls: reading directory /Volumes/Phillips/testdir/*: Input/output error ## glob matches, ls results touch /Volumes/Phillips/testdir/file ls /Volumes/Phillips/testdir/* # /Volumes/Phillips/testdir/file ## glob matches, ls results ls /Volumes/Phillips/testdir/*il* # /Volumes/Phillips/testdir/file ## no files match: io error ls /Volumes/Phillips/testdir/*foobar* # ls: reading directory /Volumes/Phillips/testdir/*foobar*: Input/output error # fails as expected ls /*filedoesnotexist* # ls: cannot access /*filedoesnotexist*: No such file or directory ## zsh handles this correctly zsh -c "ls /Volumes/Phillips/*dne*" # zsh:1: no matches found: /Volumes/Phillips/*dne* 

系统信息:

 cat /etc/debian_version 8.2 dpkg -l cifs-utils ii cifs-utils 2:6.4-1 amd64 Common Internet File mount |grep cifs //gromit/Luna1/ on /data/Luna1 type cifs (rw,relatime,vers=1.0,cache=strict,username=foranw,domain=GROMIT,uid=1000,forceuid,gid=1000,forcegid,addr=10.145.64.52,unix,posixpaths,serverino,nobrl,acl,rsize=61440,wsize=65536,actimeo=1) //skynet/Phillips/ on /Volumes/Phillips type cifs (rw,nosuid,nodev,noexec,relatime,vers=1.0,cache=strict,username=lncd,domain=SKYNET,uid=1000,forceuid,gid=1000,forcegid,addr=10.145.64.109,file_mode=0755,dir_mode=0755,nounix,nobrl,rsize=61440,wsize=65536,actimeo=1) 

我目前的解决方法是触摸一个匹配glob的文件,以避免错误

这对于FSL的bet特别有效,其中rm被称为具有无匹配的glob。 有趣的是,它会抛出“目录存在”(当它不),而不是IO错误。

 bet 002_mprage_hpf 002_mprage_hpf_brain -m -f 0.1 # /bin/rm: cannot remove '002_mprage_hpf_brain_tmp*': Is a directory. [ $? -ne 0 ] && echo failed # failed 

VS

 touch 002_mprage_hpf_brain_tmp_hackyhackhack bet 002_mprage_hpf 002_mprage_hpf_brain -m -f 0.1 [ $? -ne 0 ] && echo failed # $? == 0