[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f2b55d220703071812l52ef7241h9f2729a9b48ab60d@mail.gmail.com>
Date: Wed, 7 Mar 2007 18:12:40 -0800
From: "Michael K. Edwards" <medwards.linux@...il.com>
To: "Alan Cox" <alan@...rguk.ukuu.org.uk>
Cc: "Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>
Subject: Re: 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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists