On Thu, Jan 31, 2013 at 02:23:19AM -0700, Miao Xie wrote:
> Currently, we can do unlocked dio reads, but the following race
> is possible:
> 
> dio_read_task                 truncate_task
>                               ->btrfs_setattr()
> ->btrfs_direct_IO
>     ->__blockdev_direct_IO
>       ->btrfs_get_block
>                                 ->btrfs_truncate()
>                                #alloc truncated blocks
>                                #to other inode
>       ->submit_io()
>      #INFORMATION LEAK
> 
> In order to avoid this problem, we must serialize unlocked dio reads with
> truncate by inode_dio_wait().
> 

So I had thinking about this, are we sure we don't want to just lock the extent
range when we truncate?  I'm good with this, but it seems like we might as well
and be consistent and use the extent locks.  What do you think?  Thanks,

Josef
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to