public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* BUG? a possible race due to the absence of memory barrier
@ 2009-11-11 15:07 홍신 shin hong
  2009-11-11 16:06 ` Chris Mason
  0 siblings, 1 reply; 3+ messages in thread
From: 홍신 shin hong @ 2009-11-11 15:07 UTC (permalink / raw)
  To: linux-btrfs

Hello. I am reporting possible data race
due to the the absence of memory barriers.

I reported a similar issue. Although the previous one turns out to be safe,
please examine this issue and let me know your opinion.

In btrfs_init_new_device(), a btrfs_device object is allocated and initialized
and then links to &root->fs_info->fs_devcies->alloc_list.

It seems that a memory barrier is necessary
between the initialization and the linking to the list.

If these two operations are re-ordered so that executed opposite orders,
it may result data race where uninitialized values are read by other threads.

For btrfs_init_new_device(), i think __btfs_alloc_chunk() is a suspected
to be possible to contribute data race by concurrent execution.

Thank you

Sincerely
Shin Hong

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

end of thread, other threads:[~2009-11-12  1:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-11 15:07 BUG? a possible race due to the absence of memory barrier 홍신 shin hong
2009-11-11 16:06 ` Chris Mason
2009-11-12  1:14   ` 홍신 shin hong

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