Mike Nunn <
bonn...@gmail.com> writes:
> I get the following stack trace when doing a bup save with the bup repo on
> a cifs/samba mountpoint:
>
> Indexing: 2, done (3195 paths/s).
> Reading index: 1, done.
> Saving: 100.00% (0/0k, 1/1 files), done.
> Traceback (most recent call last):
> File "/usr/local/lib/bup/cmd/bup-save", line 460, in <module>
> w.close() # must close before we can update the ref
> File "/usr/local/lib/bup/bup/git.py", line 790, in close
> return self._end(run_midx=run_midx)
> File "/usr/local/lib/bup/bup/git.py", line 776, in _end
> os.fsync(self.parentfd)
> OSError: [Errno 22] Invalid argument
Hmm, perhaps cifs is cranky about attempts to fsync directories. I suppose
one option might be to ignore (or simply report) EINVAL when bup is
acting on a directory, i.e.
try:
os.fsync(self.parentfd)
except OSError as ex:
if ex.errno != errno.EINVAL:
raise
log(...)
...
We'd need to think about that though, i.e. are there cases where that
would be inappropriate.
You could probably test the error directly via:
python -c "import os; os.fsync(os.open('.', os.O_RDONLY))"
If the guess above is correct, that should work when the current
directory is say ext4, but not when it's cifs.
Thanks
--
Rob Browning
rlb @
defaultvalue.org and @
debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4