[linux-cifs-client] Polished patch to avoid data-loss

Steven French sfrench at us.ibm.com
Thu Jan 12 22:33:19 GMT 2006





I don't believe it is a good idea to mix the "forcedirectio" concept (no
data caching) with the concept of
/proc/fs/cifs/LookupCacheEnable (no metadata/timestamp caching) - so would
like to keep
those distinct - even though file size updates can be 1 second late by
default it can be configured
via /proc to disable that size caching.


Steve French
Senior Software Engineer
Linux Technology Center - IBM Austin
phone: 512-838-2294
email: sfrench at-sign us dot ibm dot com

Maximiliano Curia <maxy at rivero.com.ar> wrote on 01/05/2006 01:17:29 PM:

> 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,
>  /\/\ /\ >< `/
> [attachment "cifs-direct-2.patch" deleted by Steven
> French/Austin/IBM] 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
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the linux-cifs-client mailing list