Displaying 6 results from an estimated 6 matches for "btrfs_ioc_scan_dev".
2013 Mar 21
4
[PATCH] btrfs-progs: make btrfs dev scan multi path aware
We should avoid using non multi-path (mp) path for mp disks
As of now there is no good way (like api) to check that.
A workaround way is to check if the O_EXCL open is unsuccessful.
This is safe since otherwise the BTRFS_IOC_SCAN_DEV ioctl would
fail if the disk-path can not be opened with the flag O_EXCL set.
This patch also includes some (error) print format changes related
to the btrfs dev scan..
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
cmds-device.c | 53 +++++++++++++++++++++++++++++++++++++++------...
2009 Aug 26
0
btrfsctl -a doesn't find my btrfs
..._devices,
&num_devices,
BTRFS_SUPER_INFO_OFFSET);
Whereas "-A" does a:
fd = open("/dev/btrfs-control", O_RDWR);
if (fd < 0) {
perror("failed to open /dev/btrfs-control");
exit(1);
}
Followed by a:
ret = ioctl(fd, BTRFS_IOC_SCAN_DEV, &args);
Should "-a" be taught to follow "-A"? I could make a patch if so...
jr
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordom...
2009 Dec 21
0
[PATCH] btrfsctl: scan device and exit without using ioctl
...p;dev_count,
+ BTRFS_SUPER_INFO_OFFSET);
+
+ close (fd);
+ }
+
+ return ret;
+}
+
int main(int ac, char **av)
{
char *fname = NULL;
@@ -201,12 +227,16 @@ int main(int ac, char **av)
fname = av[ac - 1];
if (command == BTRFS_IOC_SCAN_DEV) {
- fd = open("/dev/btrfs-control", O_RDWR);
- if (fd < 0) {
- perror("failed to open /dev/btrfs-control");
- exit(1);
- }
- name = fname;
+ ret = btrfs_scan_file (fname);
+ if (ret < 0) {
+ fprintf (stdout, &qu...
2013 Oct 25
8
[PATCH] btrfs: add framework to read fs info from btrfs-control
...ol_args *vol = NULL;
struct btrfs_fs_devices *fs_devices;
int ret = -ENOTTY;
+ void __user *argp = (void __user *)arg;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- vol = memdup_user((void __user *)arg, sizeof(*vol));
- if (IS_ERR(vol))
- return PTR_ERR(vol);
-
switch (cmd) {
case BTRFS_IOC_SCAN_DEV:
+ vol = memdup_user((void __user *)arg, sizeof(*vol));
+ if (IS_ERR(vol))
+ return PTR_ERR(vol);
ret = btrfs_scan_one_device(vol->name, FMODE_READ,
&btrfs_fs_type, &fs_devices);
+ kfree(vol);
break;
case BTRFS_IOC_DEVICES_READY:
+ vol = memdup_user((void __user *...
2009 Jan 19
4
[Patch] Btrfs: use BTRFS_VOL_NAME_MAX for struct btrfs_ioctl_vol_args
...--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -593,7 +593,7 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,
ret = -EFAULT;
goto out;
}
- len = strnlen(vol->name, BTRFS_PATH_NAME_MAX);
+ len = strnlen(vol->name, BTRFS_VOL_NAME_MAX);
switch (cmd) {
case BTRFS_IOC_SCAN_DEV:
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
2012 Sep 05
3
BTRFS thinks device is busy [kernel 3.5.3]
Hi,
I''m running OpenSuse 12.2 with kernel 3.5.3
HBA= LSI 1068e using the MPTSAS driver (patched)
(https://patchwork.kernel.org/patch/1379181/)
SANOS1:/media # uname -a
Linux SANOS1 3.5.3 #3 SMP Sun Sep 2 18:44:37 CEST 2012 x86_64 x86_64
x86_64 GNU/Linux
I''ve tried to simulate a disk replacement but it seems that now
/dev/sdg is stuck in the btrfs pool (RAID10)
SANOS1:/media #