lkml.org 
[lkml]   [2007]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: f_owner.lock and file->pos updates
I wrote:
> I didn't see any clean way to intersperse overwrites and appends to a
> record-structured file without using vfs_llseek, which steps on f_pos.

The context, of course, is an attempt to fix -ENOPATCH with regard to
the netlink-based AIO submission scheme I outlined a couple of days
ago. :-)

Maybe f_pos should be advanced atomically by the number of bytes
expected to be read/written, before entering the vfs_(read|write)(|v)
call? And then if the read/write doesn't complete normally, f_pos
should be decremented by the number of bytes we failed to read/write?
Or do we have to make absolutely, positively sure that sampling f_pos
from another thread never returns any value outside (before)..(before
+ bytes read/written)? If so, the only way to cure the worst symptom
of the append race appears to be to hold a per-fd lock for the
duration of the sys_(read|write).

Cheers,
- Michael
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-03-08 03:15    [W:0.133 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site