linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* i_mutex locking in generic_file_splice_write()
@ 2006-10-12 19:01 Mark Fasheh
  2006-10-12 19:54 ` Andrew Morton
  0 siblings, 1 reply; 13+ messages in thread
From: Mark Fasheh @ 2006-10-12 19:01 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Andrew Morton, Jens Axboe

Hi,
	generic_file_splice_write() will call into a file systems
->prepare_write() and ->commit_write() via the the pipe_to_file() actor.
pipe_to_file() is careful to take the pipe inode i_mutex, but nowhere in the
call path do I see i_mutex on the inode being written to taken.

Shouldn't we be taking this before calling into ->prepare_write() and
->commit_write(). What's preventing generic_file_splice_write() from racing
a truncate? Or maybe even another write?

A quick look through other callers reveals that generic_file_aio_write() and
do_lo_send_aops() both are careful to take i_mutex.

Thanks,
	--Mark

--
Mark Fasheh
Senior Software Developer, Oracle
mark.fasheh@oracle.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2006-10-16 22:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-12 19:01 i_mutex locking in generic_file_splice_write() Mark Fasheh
2006-10-12 19:54 ` Andrew Morton
2006-10-13  0:17   ` Mark Fasheh
2006-10-13  7:45     ` Jens Axboe
2006-10-13  8:11       ` Andrew Morton
2006-10-13  8:18         ` Jens Axboe
2006-10-13 19:44           ` Mark Fasheh
2006-10-15 18:05             ` Jens Axboe
2006-10-15 19:56               ` Mark Fasheh
2006-10-15 20:08                 ` Jens Axboe
2006-10-15 20:14                   ` Mark Fasheh
2006-10-16 17:58                     ` Andreas Dilger
2006-10-16 22:24                       ` Mark Fasheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).