Re: [fuse-devel] Reading from fuse pipe fails with EBADFD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Dec 26 2018, Nikolaus Rath <Nikolaus@xxxxxxxx> wrote:
>>> >> > When testing FUSE under heavy load, I am occasionally getting EBADFD
>>> >> > errors when reading from the fuse pipe.
>>> >
>>> > EBADFD or EBADF?
>>>
>>> EBADF ("Bad file descriptor"), sorry.
>>
>> Can you run the thing with "strace -f  ..."?
>
> Apologies for the delayed response. I have been trying to reproduce this
> but have instead run into another problem: the *client* getting spurious
> EBADF warnings. I am not sure if this is related or unrelated, and it
> has been hard to debug because it does not happen under strace:
[..]

I believe I have figured it out. I was mistakenly assuming that the bad
file descriptor was the fuse pipe - but it was actually the target file
descriptor (I managed to completely forget that splice works on two file
descriptors).

The root cause was mistakenly closing a file descriptor twice and not
checking the return value. Because of the missing return value check,
the error went unnoticed almost all the time - except when a different
thread managed to re-use the fd for different purposes between the first
and second close.

Apologies for taking everyone's time for what was actually a filesystem
bug.


Best,
-Nikolaus

-- 
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux