Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165873
b: refs/heads/master
c: 4fadd7b
h: refs/heads/master
i:
  165871: df1b0ca
v: v3
  • Loading branch information
Christoph Hellwig authored and Al Viro committed Sep 24, 2009
1 parent dc47ddf commit 815a5e7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1ba50bbe93ebb98e83b174a85eff76af430c4e5b
refs/heads/master: 4fadd7bb20a1e7c774ed88dc703d8fbcd00ff917
8 changes: 1 addition & 7 deletions trunk/fs/block_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,6 @@ EXPORT_SYMBOL(fsync_bdev);
* freeze_bdev -- lock a filesystem and force it into a consistent state
* @bdev: blockdevice to lock
*
* This takes the block device bd_mount_sem to make sure no new mounts
* happen on bdev until thaw_bdev() is called.
* If a superblock is found on this device, we take the s_umount semaphore
* on it to make sure nobody unmounts until the snapshot creation is done.
* The reference counter (bd_fsfreeze_count) guarantees that only the last
Expand All @@ -240,7 +238,6 @@ struct super_block *freeze_bdev(struct block_device *bdev)
}
bdev->bd_fsfreeze_count++;

down(&bdev->bd_mount_sem);
sb = get_super(bdev);
if (sb && !(sb->s_flags & MS_RDONLY)) {
sb->s_frozen = SB_FREEZE_WRITE;
Expand All @@ -260,7 +257,6 @@ struct super_block *freeze_bdev(struct block_device *bdev)
"VFS:Filesystem freeze failed\n");
sb->s_frozen = SB_UNFROZEN;
drop_super(sb);
up(&bdev->bd_mount_sem);
bdev->bd_fsfreeze_count--;
mutex_unlock(&bdev->bd_fsfreeze_mutex);
return ERR_PTR(error);
Expand All @@ -271,7 +267,7 @@ struct super_block *freeze_bdev(struct block_device *bdev)
sync_blockdev(bdev);
mutex_unlock(&bdev->bd_fsfreeze_mutex);

return sb; /* thaw_bdev releases s->s_umount and bd_mount_sem */
return sb; /* thaw_bdev releases s->s_umount */
}
EXPORT_SYMBOL(freeze_bdev);

Expand Down Expand Up @@ -321,7 +317,6 @@ int thaw_bdev(struct block_device *bdev, struct super_block *sb)
drop_super(sb);
}

up(&bdev->bd_mount_sem);
mutex_unlock(&bdev->bd_fsfreeze_mutex);
return 0;
}
Expand Down Expand Up @@ -430,7 +425,6 @@ static void init_once(void *foo)

memset(bdev, 0, sizeof(*bdev));
mutex_init(&bdev->bd_mutex);
sema_init(&bdev->bd_mount_sem, 1);
INIT_LIST_HEAD(&bdev->bd_inodes);
INIT_LIST_HEAD(&bdev->bd_list);
#ifdef CONFIG_SYSFS
Expand Down
9 changes: 7 additions & 2 deletions trunk/fs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,9 +743,14 @@ int get_sb_bdev(struct file_system_type *fs_type,
* will protect the lockfs code from trying to start a snapshot
* while we are mounting
*/
down(&bdev->bd_mount_sem);
mutex_lock(&bdev->bd_fsfreeze_mutex);
if (bdev->bd_fsfreeze_count > 0) {
mutex_unlock(&bdev->bd_fsfreeze_mutex);
error = -EBUSY;
goto error_bdev;
}
s = sget(fs_type, test_bdev_super, set_bdev_super, bdev);
up(&bdev->bd_mount_sem);
mutex_unlock(&bdev->bd_fsfreeze_mutex);
if (IS_ERR(s))
goto error_s;

Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,6 @@ struct block_device {
struct super_block * bd_super;
int bd_openers;
struct mutex bd_mutex; /* open/close mutex */
struct semaphore bd_mount_sem;
struct list_head bd_inodes;
void * bd_holder;
int bd_holders;
Expand Down

0 comments on commit 815a5e7

Please sign in to comment.