[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <mj+md-20080410.140857.3331.nikam@ucw.cz>
Date: Thu, 10 Apr 2008 16:11:24 +0200
From: Martin Mares <mj@....cz>
To: Michal Hocko <mhocko@...e.cz>
Cc: Meelis Roos <mroos@...ux.ee>,
Linux Kernel list <linux-kernel@...r.kernel.org>,
linux-fsdevel@...r.kernel.org
Subject: Re: file offset corruption on 32-bit machines?
Hello!
> [*] file_pos_{read,write} (fs/read_write.c) are not called under lock (in
> sys_read, sys_write, ...), so even if f_pos is written atomically, you will
> be able to get races when accessing shared descriptor from different threads.
There are however cases when such behavior is perfectly valid: For example
you can have a file of records of a fixed size, whose order does not matter.
Then multiple processes can produce the records in parallel, sharing
a single fd.
> I think that POSIX states, that behavior is undefined under these conditions.
Do you have a pointer to that?
Have a nice fortnight
--
Martin `MJ' Mares <mj@....cz> http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
Mr. Worf, scan that ship." "Aye, Captain... 600 DPI?
--
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