Re: [PATCH 2/3] CIFS: New read cache mechanism

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

 



2010/9/28 Jeff Layton <jlayton@xxxxxxxxx>:
> Ok, so suppose you make this change and don't change
> cifs_file_aio_write at all, and at some point in the future, we make
> cifs do async writes...
>
> I go and do a buffered write to a file, cifs_file_aio_write then calls
> filemap_fdatawrite to flush out the data, but doesn't necessarily wait
> for it to complete before returning.
>
> Now, I do I read from that file descriptor, which ends up being
> satisfied before the write I just did got flushed out. I see old
> data in the read.
>
> According to the write(2) manpage:
>
> POSIX Ârequires Âthat Âa Âread(2) Âwhich can be proved to occur after a
> write() has returned returns the new data. ÂNote that not all file sysâ
> tems are POSIX conforming.
>
> It's arguable that CIFS isn't POSIX conforming, but we do our best with
> it. I think we ought to conform to POSIX in this regard. If you want
> to do this, you probably also need to ensure that the dirty data gets
> flushed to the server prior to returning from a write call.

It's only read part and I am going to post write part as well. Of
course, it will wait for complete. So, let's look at this only from
the read side - at least, it doesn't break write related things in
comparison with existing code.

-- 
Best regards,
Pavel Shilovsky.
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux