From: Josef Bacik Date: Mon, 4 Jun 2012 18:03:51 +0000 (-0400) Subject: Btrfs: use rcu to protect device->name X-Git-Tag: v3.5-rc3~18^2~12 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=606686eeac4550d2212bf3d621a810407ef5e9bf;p=pandora-kernel.git Btrfs: use rcu to protect device->name Al pointed out that we can just toss out the old name on a device and add a new one arbitrarily, so anybody who uses device->name in printk could possibly use free'd memory. Instead of adding locking around all of this he suggested doing it with RCU, so I've introduced a struct rcu_string that does just that and have gone through and protected all accesses to device->name that aren't under the uuid_mutex with rcu_read_lock(). This protects us and I will use it for dealing with removing the device that we used to mount the file system in a later patch. Thanks, Reviewed-by: David Sterba Signed-off-by: Josef Bacik --- Reading git-diff-tree failed