Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104272
b: refs/heads/master
c: 80fab1d
h: refs/heads/master
v: v3
  • Loading branch information
Andre Noll authored and Neil Brown committed Jul 11, 2008
1 parent 6612efb commit 966b202
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 33 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: ebc243372842a81dddbe00bd047a25b8ee7d8b87
refs/heads/master: 80fab1d77b2852711917baa437e4fdab31c21fef
49 changes: 17 additions & 32 deletions trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -3766,40 +3766,25 @@ static int do_md_run(mddev_t * mddev)
static int restart_array(mddev_t *mddev)
{
struct gendisk *disk = mddev->gendisk;
int err;

/*
* Complain if it has no devices
*/
err = -ENXIO;
/* Complain if it has no devices */
if (list_empty(&mddev->disks))
goto out;

if (mddev->pers) {
err = -EBUSY;
if (!mddev->ro)
goto out;

mddev->safemode = 0;
mddev->ro = 0;
set_disk_ro(disk, 0);

printk(KERN_INFO "md: %s switched to read-write mode.\n",
mdname(mddev));
/*
* Kick recovery or resync if necessary
*/
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
md_wakeup_thread(mddev->thread);
md_wakeup_thread(mddev->sync_thread);
err = 0;
sysfs_notify(&mddev->kobj, NULL, "array_state");

} else
err = -EINVAL;

out:
return err;
return -ENXIO;
if (!mddev->pers)
return -EINVAL;
if (!mddev->ro)
return -EBUSY;
mddev->safemode = 0;
mddev->ro = 0;
set_disk_ro(disk, 0);
printk(KERN_INFO "md: %s switched to read-write mode.\n",
mdname(mddev));
/* Kick recovery or resync if necessary */
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
md_wakeup_thread(mddev->thread);
md_wakeup_thread(mddev->sync_thread);
sysfs_notify(&mddev->kobj, NULL, "array_state");
return 0;
}

/* similar to deny_write_access, but accounts for our holding a reference
Expand Down

0 comments on commit 966b202

Please sign in to comment.