Skip to contentSkip to conversation

return EINVAL when thawing unfrozen filesystems

PATCH In review Eric Sandeen 2 participants 2 messages Jul 28, 2010 – Jul 29, 2010 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 return EINVAL when thawing unfrozen filesystems

The iterate_supers() loop in do_thaw_all() assumes that we can call thaw_bdev() until we hit an error; when I wrote this, we got -EINVAL when requesting a thaw of an unfrozen bdev. (it called until error because we may have nested freezes).

However, commit 4504230a (freeze_bdev: grab active reference to frozen superblocks) changed this so that we get a return of 0 in this case, and do_thaw_all() spins forever when an emergency system-wide thaw is requested.

It looks to me like the change was inadvertent, so this patch changes it back.

---

fs/block_dev.c +1 -1
index 99d6af8..51500f6 100644
@@ -291,7 +291,7 @@ int thaw_bdev(struct block_device *bdev, struct super_block *sb)
 	}
 out:
 	mutex_unlock(&bdev->bd_fsfreeze_mutex);
-	return 0;
+	return error;
 }
 EXPORT_SYMBOL(thaw_bdev);
 
Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · Eric Sandeen

The iterate_supers() loop in do_thaw_all() assumes that we can call thaw_bdev() until we hit an error; when I wrote this, we got -EINVAL when requesting a thaw of an unfrozen bdev. (it called until error because we may have nested freezes).

However, commit 4504230a (freeze_bdev: grab active reference to frozen superblocks) changed this so that we get a return of 0 in this case, and do_thaw_all() spins forever when an emergency system-wide thaw is requested.

Quoted 4 lines

It looks to me like the change was inadvertent, so this patch changes it back.

Looks good,