public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 000 of 2] Fix some bugs with 'read' racing with 'truncate'
@ 2007-06-07  1:46 NeilBrown
  2007-06-07  1:46 ` [PATCH 001 of 2] Fix read/truncate race NeilBrown
  2007-06-07  1:47 ` [PATCH 002 of 2] Make sure readv stops reading when it hits end-of-file NeilBrown
  0 siblings, 2 replies; 9+ messages in thread
From: NeilBrown @ 2007-06-07  1:46 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Jens Axboe, Neil Brown, Nick Piggin

The following two patches fix a couple of bugs which trigger when read
races with truncate.

As there is no locking between read and truncate, we need to be
careful about sequencing.   In some cases were aren't careful enough.

The first patch ensures that we check i_size *after* gaining a
reference to an uptodate page, thus ensuring that we don't unknowingly
returns NUL characters that are beyond the end of the file.

The second ensures that we don't deliver partial reads to more than
one sub-buffer in a readv call.

These bugs have been around for a while and are quite subtle, so I
don't think there is any rush for them to go into 2.6.22.  Rather they
should sit in -mm at least until .23 opens up.

Thanks,
NeilBrown



 [PATCH 001 of 2] Fix read/truncate race.
 [PATCH 002 of 2] Make sure readv stops reading when it hits end-of-file.

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

end of thread, other threads:[~2007-06-12  0:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-07  1:46 [PATCH 000 of 2] Fix some bugs with 'read' racing with 'truncate' NeilBrown
2007-06-07  1:46 ` [PATCH 001 of 2] Fix read/truncate race NeilBrown
2007-06-07  7:19   ` Jens Axboe
2007-06-08  1:18   ` Andrew Morton
2007-06-08  2:48     ` Neil Brown
2007-06-08  6:10       ` Andrew Morton
2007-06-12  0:16         ` Neil Brown
2007-06-12  0:35           ` Andrew Morton
2007-06-07  1:47 ` [PATCH 002 of 2] Make sure readv stops reading when it hits end-of-file NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox