From: NeilBrown Date: Fri, 13 Aug 2010 06:09:53 +0000 (+1000) Subject: lafs_get_subset: balance locks properly X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=70760a0d34fe8e380970ee5a91ca6b5238e6ef16;p=LaFS.git lafs_get_subset: balance locks properly We drop the mutex outside the 'if' so we must take it outside the 'if' too - which is safer as well. Signed-off-by: NeilBrown --- diff --git a/super.c b/super.c index 5df896f..7dabfd6 100644 --- a/super.c +++ b/super.c @@ -968,12 +968,12 @@ lafs_get_subset(struct file_system_type *fs_type, LAFSI(ino)->type != TypeDir) goto out; fs = fs_from_sb(sb); + mutex_lock(&ino->i_mutex); if (LAFSI(ino)->type == TypeDir) { struct datablock *inodb; /* maybe convert this to TypeInodeFile */ if (sb->s_type != &lafs_fs_type) - goto out; - mutex_lock(&ino->i_mutex); + goto out_unlock; if (ino->i_size) /* FIXME maybe I should run orphans */ goto out_unlock;