Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231766
b: refs/heads/master
c: 6f88a44
h: refs/heads/master
v: v3
  • Loading branch information
Ben Hutchings authored and Chris Mason committed Jan 16, 2011
1 parent da0707f commit 235395a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f690efb1aa2a961dd6655529c1797fcac60ad6d9
refs/heads/master: 6f88a4403def422bd8e276ddf6863d6ac71435d2
4 changes: 4 additions & 0 deletions trunk/fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/blkdev.h>
#include <linux/random.h>
#include <linux/iocontext.h>
#include <linux/capability.h>
#include <asm/div64.h>
#include "compat.h"
#include "ctree.h"
Expand Down Expand Up @@ -2024,6 +2025,9 @@ int btrfs_balance(struct btrfs_root *dev_root)
if (dev_root->fs_info->sb->s_flags & MS_RDONLY)
return -EROFS;

if (!capable(CAP_SYS_ADMIN))
return -EPERM;

mutex_lock(&dev_root->fs_info->volume_mutex);
dev_root = dev_root->fs_info->dev_root;

Expand Down

0 comments on commit 235395a

Please sign in to comment.