On 12/11/2011 11:24 AM, Goffredo Baroncelli wrote:
> 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.
I fully agree to your comment and will change it in a v2. Thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html