search for: loop_get_status

Displaying 11 results from an estimated 11 matches for "loop_get_status".

2011 Jan 22
32
Bug in mkfs.btrfs?!
Hi, I wanted to create a new btrfs fs for my backups. When trying to mkfs.btrfs for that device, I''m getting "error checking /dev/loop2 mount status" With strace I see where the problem is: lstat("/dev/disk/by-id/ata-INTEL_SSDSA2M160G2GC_CVPO939201JX160AGN-par", 0x7fffa30b3cf0) = -1 ENOENT (No such file or directory) The problem is there is something missing
2010 Mar 14
0
[patches] klibc review unsorted patch queue
...file mode 100644 index 0000000..9839f57 --- /dev/null +++ b/usr/utils/loop.h @@ -0,0 +1,49 @@ +#define LO_CRYPT_NONE 0 +#define LO_CRYPT_XOR 1 +#define LO_CRYPT_DES 2 +#define LO_CRYPT_CRYPTOAPI 18 + +#define LOOP_SET_FD 0x4C00 +#define LOOP_CLR_FD 0x4C01 +#define LOOP_SET_STATUS 0x4C02 +#define LOOP_GET_STATUS 0x4C03 +#define LOOP_SET_STATUS64 0x4C04 +#define LOOP_GET_STATUS64 0x4C05 + +#define LO_NAME_SIZE 64 +#define LO_KEY_SIZE 32 + +struct loop_info { + int lo_number; + dev_t lo_device; + unsigned long lo_inode; + dev_t lo_rdevice; + int lo_offset; + int lo_encrypt_type; + int lo_encrypt_key_s...
2019 Oct 31
0
[PATCH 2/2] loop: switch to linux/loop.h
...le mode 100644 index 667f7dc0..00000000 --- a/usr/utils/loop.h +++ /dev/null @@ -1,49 +0,0 @@ -#define LO_CRYPT_NONE 0 -#define LO_CRYPT_XOR 1 -#define LO_CRYPT_DES 2 -#define LO_CRYPT_CRYPTOAPI 18 - -#define LOOP_SET_FD 0x4C00 -#define LOOP_CLR_FD 0x4C01 -#define LOOP_SET_STATUS 0x4C02 -#define LOOP_GET_STATUS 0x4C03 -#define LOOP_SET_STATUS64 0x4C04 -#define LOOP_GET_STATUS64 0x4C05 - -#define LO_NAME_SIZE 64 -#define LO_KEY_SIZE 32 - -struct loop_info { - int lo_number; - __kernel_old_dev_t lo_device; - unsigned long lo_inode; - __kernel_old_dev_t lo_rdevice; - int lo_offset; - int lo_encrypt_typ...
2019 Nov 05
0
[klibc:master] loop: switch to linux/loop.h
...le mode 100644 index 9abc2874..00000000 --- a/usr/utils/loop.h +++ /dev/null @@ -1,49 +0,0 @@ -#define LO_CRYPT_NONE 0 -#define LO_CRYPT_XOR 1 -#define LO_CRYPT_DES 2 -#define LO_CRYPT_CRYPTOAPI 18 - -#define LOOP_SET_FD 0x4C00 -#define LOOP_CLR_FD 0x4C01 -#define LOOP_SET_STATUS 0x4C02 -#define LOOP_GET_STATUS 0x4C03 -#define LOOP_SET_STATUS64 0x4C04 -#define LOOP_GET_STATUS64 0x4C05 - -#define LO_NAME_SIZE 64 -#define LO_KEY_SIZE 32 - -struct loop_info { - int lo_number; - dev_t lo_device; - unsigned long lo_inode; - dev_t lo_rdevice; - int lo_offset; - int lo_encrypt_type; - int lo_encrypt_key_s...
2019 Nov 05
0
[klibc:master] losetup: Delete fallbacks to LOOP_{GET, SET}_STATUS
...info->lo_offset != info64->lo_offset) - return -EOVERFLOW; - - return 0; -} - - static int show_loop(char *device) { - struct loop_info loopinfo; struct loop_info64 loopinfo64; int fd, errsv; @@ -106,23 +75,6 @@ static int show_loop(char *device) return 0; } - if (ioctl(fd, LOOP_GET_STATUS, &loopinfo) == 0) { - printf ("%s: [%04x]:%ld (%s)", - device, loopinfo.lo_device, loopinfo.lo_inode, - loopinfo.lo_name); - - if (loopinfo.lo_offset) - printf(", offset %d", loopinfo.lo_offset); - - if (loopinfo.lo_encrypt_type) - printf(", encryption type %...
2019 Nov 05
0
[klibc:master] losetup: Use LOOP_CTL_GET_FREE to find free device
...loopinfo; - - for (j = 0; j < SIZE(loop_formats); j++) { - for(i = 0; i < 256; i++) { - sprintf(dev, loop_formats[j], i); - if (stat (dev, &statbuf) == 0 && S_ISBLK(statbuf.st_mode)) { - somedev++; - fd = open (dev, O_RDONLY); - if (fd >= 0) { - if(ioctl (fd, LOOP_GET_STATUS, &loopinfo) == 0) - someloop++; /* in use */ - else if (errno == ENXIO) { - close (fd); - return xstrdup(dev);/* probably free */ - } - close (fd); - } else if (errno == EACCES) - permission++; - - continue;/* continue trying as long as devices exist */ -...
2019 Oct 31
3
[PATCH 1/2] loop: fix loop_info struct
Otherwise, stack can be corrupted resulting in incorrect runtime behaviour. For example, overriding argc from main(). References: https://bugs.launchpad.net/ubuntu/+source/klibc/+bug/1850184 Signed-off-by: Michael Hudson-Doyle <michael.hudson at ubuntu.com> Signed-off-by: Adam Conrad <adconrad at ubuntu.com> Signed-off-by: Dimitri John Ledkov <xnox at ubuntu.com> ---
2009 Nov 14
2
[PATCH] btrfs-progs: Check mount status of multidevice filesystems
...op_device(mnt->mnt_fsname); + + if(ret < 0) + goto out_err; + + if(ret) { + /* Current entry is a loop device */ + if ((loop_fd = open(mnt->mnt_fsname, O_RDONLY)) < 0) { + ret = -errno; + goto out_err; + } + + /* Get loop device info and check */ + if (ioctl(loop_fd, LOOP_GET_STATUS, &loopinfo) == 0) { + ret = is_same_blk_file(file, loopinfo.lo_name); + + if(ret < 0) + goto out_err; + else if(ret) break; + } else { + ret = -errno; + goto out_err; } + } else { + /* normal block device */ + if(is_same_blk_file(file, mnt->mnt_fsname)...
2012 Aug 02
0
[PATCH 1/3] ALPHA: make sector size dynamic in extlinux
...;heads * geo->sectors * sector_size); geo->start = 0; if (!opt.sectors && !opt.heads) { @@ -193,11 +205,11 @@ int get_geometry(int devfd, uint64_t totalbytes, struct hd_geometry *geo) ok: /* If this is a loopback device, try to set the start */ if (!ioctl(devfd, LOOP_GET_STATUS64, &li64)) - geo->start = li64.lo_offset >> SECTOR_SHIFT; + geo->start = li64.lo_offset / sector_size; else if (!ioctl(devfd, LOOP_GET_STATUS, &li)) - geo->start = (unsigned int)li.lo_offset >> SECTOR_SHIFT; + geo->start = (unsigned int)li.lo_offset / sector_siz...
2015 Jan 02
13
[PATCH 0/9] linux/syslinux: support ext2/3/4 device
Hello, Happy New Year! These patches make syslinux/linux support ext2/3/4, and it doesn't require the root privilege, I'd like to add a separate e2fs/syslinux, if that is more appropriate, it should be easy to do that. I put these patches on github so that you can easily get them in case you'd like to test them. (The repo's name is sys_tmp, which avoids confusing others, I will
2012 Sep 10
19
Initial support for sector size >512
This set of patches add some support for sector size >512. Currently it fixes extlinux, MBR for GPT and ext partitions. Other code is unaffected. This set of patches has been tested on a read Dell machine running a beta firmware.