[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fuse-devel
Subject:    Re: [fuse-devel] reading special files bug ? (/proc/version ...)
From:       Nicolas Collignon <tsointsoin () gmail ! com>
Date:       2009-08-20 11:34:27
Message-ID: aaf57110908200434w29d8f9ebvb8a3487024251d78 () mail ! gmail ! com
[Download RAW message or body]

perfect ! :)

Forcing direct I/O on files stored in /proc works.

Thanks

On Wed, Aug 19, 2009 at 8:44 PM, Nikolaus Rath<Nikolaus@rath.org> wrote:
> Nicolas Collignon <tsointsoin@gmail.com> writes:
>> Hi,
>>
>> I wrote a filesystem (based on Python bindings) that mirror a remote filesystem.
>> I noticed most files in /proc cannot be read using my filesystem.
>>
>> As you already know, files in /proc have a size of 0 byte (content is
>> created at runtime).
>> As an example, trying to read /proc/version through the FUSE
>> filesystem returns 0 byte.
>>
>> strace of "cat /proc/version" :
>>
>> open("version", O_RDONLY|O_LARGEFILE)   = 3
>> fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
>> read(3, "", 32768)                      = 0
>>
>> fstat correctly returns st_size=0. As you can see, "cat" doesn't care
>> about the null size and correctly try to read the file. FUSE kernel
>> module forward the read request. My filesystem correctly returns the
>> file's content but the data seems to get lost somewhere.
>
> My guess is that it will work once you turn of the kernel cache and
> activate direct_io.
>
> With the kernel cache activated, FUSE must use the size returned by
> getattr to not read beyond EOF. Obviously this fails if this size is
> wrong.
>
>
> Best,
>
>   -Nikolaus
>
> --
>  »Time flies like an arrow, fruit flies like a Banana.«
>
>  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> fuse-devel mailing list
> fuse-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fuse-devel
>



-- 
Person who say it cannot be done should not interrupt person doing it.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
fuse-devel mailing list
fuse-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fuse-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic