From: Goffredo Baroncelli <kreijack@inwind.it>
To: Stefan Behrens <sbehrens@giantdisaster.de>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/3] Btrfs: add ioctl to get and reset the device stats
Date: Sun, 11 Dec 2011 11:24:16 +0100 [thread overview]
Message-ID: <1328320.x7SNYXeJA2@venice> (raw)
In-Reply-To: <f2f1de6869aab38ff48d60235081257ce2c03bf4.1323448299.git.sbehrens@giantdisaster.de>
On Friday, 09 December, 2011 17:40:27 Stefan Behrens wrote:
> An ioctl interface is added to get the device statistic counters.
> A second ioctl is added to atomically get and reset these counters.
[...]
>
> +static long btrfs_ioctl_get_device_stats(struct btrfs_root *root,
> + void __user *arg, int reset_after_read)
> +{
> + struct btrfs_ioctl_get_device_stats *sa;
> + int ret;
> +
> + if (!capable(CAP_SYS_ADMIN))
> + return -EPERM;
> +
I agree that the BTRFS_IOC_GET_AND_RESET_DEVICE_STATS should be a privileged
operation. But I think that the BTRFS_IOC_GET_DEVICE_STATS should be allowed
to everyone. Think about a daemon which look at the error, and then send an
email to warn about possible defect. Allowing BTRFS_IOC_GET_DEVICE_STATS to
everyone, prevent to run the deamon with root privileges.
BR
G.Baroncelli
[...]
--
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijack@inwind.it>
Key fingerprint = 4769 7E51 5293 D36C 814E C054 BF04 F161 3DC5 0512
next prev parent reply other threads:[~2011-12-11 10:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-09 16:40 [PATCH 0/3] Btrfs: add IO error device stats Stefan Behrens
2011-12-09 16:40 ` [PATCH 1/3] Btrfs: add device counters for detected IO and checksum errors Stefan Behrens
2011-12-09 16:40 ` [PATCH 2/3] Btrfs: add ioctl to get and reset the device stats Stefan Behrens
2011-12-11 10:24 ` Goffredo Baroncelli [this message]
2011-12-12 13:34 ` Stefan Behrens
2011-12-21 16:05 ` [PATCH v2 0/3] Btrfs: add IO error " Stefan Behrens
2011-12-21 16:05 ` [PATCH v2 1/3] Btrfs: add device counters for detected IO and checksum errors Stefan Behrens
2011-12-21 16:05 ` [PATCH v2 2/3] Btrfs: add ioctl to get and reset the device stats Stefan Behrens
2011-12-21 16:05 ` [PATCH v2 3/3] Btrfs: read device stats on mount, write modified ones during commit Stefan Behrens
2011-12-09 16:40 ` [PATCH " Stefan Behrens
2011-12-11 10:18 ` [PATCH 0/3] Btrfs: add IO error device stats Goffredo Baroncelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1328320.x7SNYXeJA2@venice \
--to=kreijack@inwind.it \
--cc=linux-btrfs@vger.kernel.org \
--cc=sbehrens@giantdisaster.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.