Re: [PATCH 2/3] Btrfs: add ioctl to get and reset the device stats

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
Key fingerprint = 4769 7E51 5293 D36C 814E  C054 BF04 F161 3DC5 0512
--
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


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux