[linux-cifs-client] Polished patch to avoid data-loss
Maximiliano Curia
maxy at rivero.com.ar
Thu Jan 5 15:17:29 GMT 2006
On Wednesday 04 January 2006 17:00, you wrote:
> Your patch picked up the other places llseek needs to be exported from (I
> had added those in my testing) - the is size safe to change needs to be
> modified in two ways
I've been polishing the previous patch, and I'm about to put it in production
for my clients, I would like to hear comments before doing so.
The changes are simple, one to avoid having to set LookCacheEnable to 0, the
other makes is_size_safe_to_change return 1 when the resource was mounted
with directio.
It would be nice to have a "right way" to use mmap over directio, but as I
only need it to exec elf files, any generic mmap would do what I need. It
might be a good idea to use a readonly mmap.
> 1) always allow files open forcedirectio to update file size (no page cache
> issues so should be safe)
> 2) for the default case (local caching, ie using page cache) if file is not
> dirty update the file size if file is dirty write the file data out and
> then update the file size - hard part is we have to check the locking
> around this operation and make sure we match all other locations that could
> be updating the filesize and we may have to lock all potentially affected
> pages (especially the final page in the file if it is a partial page) so we
> don't continue to reuse them.
Well, I didn't mention it before, but, I've also been toying with
commit_write, avoiding the call to setpagedirty (by calling cifs_write),
so I don't have a pending write behind. And I could not "fix" the data-loss.
But I agree with the proposed changes, anyway.
--
Saludos,
/\/\ /\ >< `/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cifs-direct-2.patch
Type: text/x-diff
Size: 2953 bytes
Desc: not available
Url : http://lists.samba.org/archive/linux-cifs-client/attachments/20060105/a39553b4/cifs-direct-2.bin
-------------- next part --------------
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.12/220 - Release Date: 03/01/06
More information about the linux-cifs-client
mailing list