Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83598
b: refs/heads/master
c: ca38805
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Feb 6, 2008
1 parent 63988e4 commit 4daa30c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 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: c5d79adba7ced41d7ac097c2ab74759d10522dd5
refs/heads/master: ca38805945edf5d1f5444b283eed95bb954772e8
8 changes: 7 additions & 1 deletion trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -2075,12 +2075,18 @@ rdev_attr_store(struct kobject *kobj, struct attribute *attr,
{
struct rdev_sysfs_entry *entry = container_of(attr, struct rdev_sysfs_entry, attr);
mdk_rdev_t *rdev = container_of(kobj, mdk_rdev_t, kobj);
int rv;

if (!entry->store)
return -EIO;
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
return entry->store(rdev, page, length);
rv = mddev_lock(rdev->mddev);
if (!rv) {
rv = entry->store(rdev, page, length);
mddev_unlock(rdev->mddev);
}
return rv;
}

static void rdev_free(struct kobject *ko)
Expand Down

0 comments on commit 4daa30c

Please sign in to comment.