From: Miao Xie Date: Thu, 11 Apr 2013 10:30:16 +0000 (+0000) Subject: Btrfs: use a lock to protect incompat/compat flag of the super block X-Git-Tag: v3.10-rc1~31^2~57 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ceda08642459e31673d24d7968d864390d2ce5fa;p=pandora-kernel.git Btrfs: use a lock to protect incompat/compat flag of the super block The following case will make the incompat/compat flag of the super block be recovered. Task1 |Task2 flags = btrfs_super_incompat_flags(); | |flags = btrfs_super_incompat_flags(); flags |= new_flag1; | |flags |= new_flag2; btrfs_set_super_incompat_flags(flags); | |btrfs_set_super_incompat_flags(flags); the new_flag1 is recovered. In order to avoid this problem, we introduce a lock named super_lock into the btrfs_fs_info structure. If we want to update incompat/compat flags of the super block, we must hold it. Signed-off-by: Miao Xie Signed-off-by: Josef Bacik --- Reading git-diff-tree failed