This is a note to let you know that I've just added the patch titled
btrfs: Require CAP_SYS_ADMIN for filesystem rebalance
to the 2.6.32-longterm tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/longterm/longterm-queue-2.6.32.git;a=summary
The filename of the patch is:
btrfs-require-cap_sys_admin-for-filesystem-rebalance.patch
and it can be found in the queue-2.6.32 subdirectory.
If you, or anyone else, feels it should not be added to the 2.6.32 longterm
tree,
please let <[email protected]> know about it.
>From b63875a97a89e4a5a7a000ce65eecb5fd57ffed0 Mon Sep 17 00:00:00 2001
From: Ben Hutchings <[email protected]>
Date: Wed, 29 Dec 2010 14:55:03 +0000
Subject: btrfs: Require CAP_SYS_ADMIN for filesystem rebalance
From: Ben Hutchings <[email protected]>
commit 6f88a4403def422bd8e276ddf6863d6ac71435d2 upstream.
Filesystem rebalancing (BTRFS_IOC_BALANCE) affects the entire
filesystem and may run uninterruptibly for a long time. This does not
seem to be something that an unprivileged user should be able to do.
Reported-by: Aron Xu <[email protected]>
Signed-off-by: Ben Hutchings <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
fs/btrfs/volumes.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -21,6 +21,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"
@@ -1900,6 +1901,9 @@ int btrfs_balance(struct btrfs_root *dev
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;
Patches currently in longterm-queue-2.6.32 which might be from
[email protected] are
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/powerpc-boot-dts-install-dts-from-the-right-director.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/cxgb3-declare-module_firmware.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/bnx2x-declare-module_firmware.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/alsa-emux-add-trivial-compat-ioctl-handler.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/myri10ge-declare-module_firmware.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/kconfig-avoid-buffer-underrun-in-choice-input.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/staging-rtl8192su-fix-procfs-code-for-interfaces-not.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/netx-declare-module_firmware.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/staging-rtl8192su-clean-up-in-case-of-an-error-in-mo.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/pcnet-cs-declare-module_firmware.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/tehuti-firmware-filename-is-tehuti-bdx.bin.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/spider-net-declare-module_firmware.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/btrfs-require-cap_sys_admin-for-filesystem-rebalance.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/tms380tr-declare-module_firmware.patch
_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable