From 70760a0d34fe8e380970ee5a91ca6b5238e6ef16 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 13 Aug 2010 16:09:53 +1000 Subject: [PATCH] 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 --- super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.39.5