search for: get_default_subvol

Displaying 14 results from an estimated 14 matches for "get_default_subvol".

2015 Sep 09
1
[PATCH v1 1/1] extlinux: fix file descriptors leak
...n.c index 09740bd..55a1495 100644 --- a/extlinux/main.c +++ b/extlinux/main.c @@ -580,6 +580,7 @@ int ext2_fat_install_file(const char *path, int devfd, struct stat *rst) goto bail; } + close(fd); free(file); free(oldfile); free(c32file); @@ -778,7 +779,7 @@ static char * get_default_subvol(char * rootdir, char * subvol) struct btrfs_ioctl_search_key *sk = &args.key; struct btrfs_ioctl_search_header *sh; int ret, i; - int fd; + int fd = -1; struct btrfs_root_ref *ref; struct btrfs_dir_item *dir_item; unsigned long off = 0; @@ -797,6 +798,8 @@ st...
2015 Sep 09
0
[PATCH v1 1/1] extlinux: fix file descriptors leak
...n.c index 09740bd..bc7ded3 100644 --- a/extlinux/main.c +++ b/extlinux/main.c @@ -580,6 +580,7 @@ int ext2_fat_install_file(const char *path, int devfd, struct stat *rst) goto bail; } + close(fd); free(file); free(oldfile); free(c32file); @@ -797,6 +798,8 @@ static char * get_default_subvol(char * rootdir, char * subvol) } if (ret <= 0) { subvol[0] = '\0'; + if (fd >= 0) + close(fd); return NULL; } @@ -831,6 +834,8 @@ static char * get_default_subvol(char * rootdir, char * subvol) if (ret < 0) {...
2014 Dec 09
2
[PATCH] check for default subvolid and act accordingly on install
...0bd..c3d9612 100644 --- a/extlinux/main.c +++ b/extlinux/main.c @@ -1261,6 +1261,9 @@ static const char *find_device_btrfs(const char *path) if (!validate_device_btrfs(pfd, dfd)) rv = (const char *)devinfo.path; /* It's good! */ + /* check for default subvolume and act accordingly */ + get_default_subvol("/", subvol); + err: if (pfd >= 0) close(pfd); -- 2.1.3 -Beaver
2011 Jul 12
0
[PATCH]: Use a general way to get the default subvolume for btrfs
...open(fname, O_RDWR); + } + if (fd < 0) { + return -3; + } + return fd; +} + +/* + * Get the default subvolume of a btrfs filesystem + * rootdir: btrfs root dir + * subvol: this function will save the default subvolume name here + */ +static char * get_default_subvol(char * rootdir, char * subvol) +{ + struct btrfs_ioctl_search_args args; + struct btrfs_ioctl_search_key *sk = &args.key; + struct btrfs_ioctl_search_header *sh; + int ret, i; + int fd; + struct btrfs_root_ref *ref; + struct btrfs_dir_item *dir_item; + unsigned long off...
2015 Apr 04
0
[PATCH] check for default subvolid and act accordingly on install
...b/extlinux/main.c > @@ -1261,6 +1261,9 @@ static const char *find_device_btrfs(const char *path) > if (!validate_device_btrfs(pfd, dfd)) > rv = (const char *)devinfo.path; /* It's good! */ > > + /* check for default subvolume and act accordingly */ > + get_default_subvol("/", subvol); > + > err: > if (pfd >= 0) > close(pfd); > -- Jordan, the indentation on this is incorrect. Did you intend to have it inside the conditional "if (!validate_device_btrfs(pfd, dfd))" or executed afterwards? Also reference http://bug...
2013 Jul 19
0
[PATCH 001/001] Add UFS1/2 support to Extlinux installer.
...s will move the ldlinux.sys every where */ > int btrfs_install_file(const char *path, int devfd, struct stat *rst) The ufs2 portion of this could do with more explanation, since the btrfs reasons don't apply to ufs2, right (ufs2 has no cow feature)? > @@ -955,9 +974,10 @@ static char * get_default_subvol(char * rootdir, char * subvol) > > static int install_file(const char *path, int devfd, struct stat *rst) > { > - if (fs_type == EXT2 || fs_type == VFAT || fs_type == NTFS) > + if (fs_type == EXT2 || fs_type == VFAT || fs_type == NTFS > + || fs_type == UFS1) > retur...
2014 Dec 08
0
BTRFS default subvolume identification and use
...ue via `btrfs subvolume set-default <id> <path>`. In extlinux/main.c there appears to be two different unique attempts to grab information relating to default subvolume. If the first one succeeds, `find_device_btrfs(path)`, the second is not ran, `find_device`, which in turn would call `get_default_subvol`. I found by commenting out line 1293 of extlinux/main.c that since it skips `find_device_btrfs(path)` the subvolume is set properly and I can continue to boot from subvolume and rely on set-default to work as expected when changing subvolumes. -Beaver
2013 Jul 12
2
[PATCH 001/001] Add UFS1/2 support to Extlinux installer.
...ys in the first 64K blank area, which is not managered by btrfs tree, so actually this is not installed as files. since the cow feature of btrfs will move the ldlinux.sys every where */ int btrfs_install_file(const char *path, int devfd, struct stat *rst) @@ -955,9 +974,10 @@ static char * get_default_subvol(char * rootdir, char * subvol) static int install_file(const char *path, int devfd, struct stat *rst) { - if (fs_type == EXT2 || fs_type == VFAT || fs_type == NTFS) + if (fs_type == EXT2 || fs_type == VFAT || fs_type == NTFS + || fs_type == UFS1) return ext2_fat_install_file(path, devfd...
2015 Sep 09
0
[PATCH v1 1/1] extlinux: fix memory leak
...t intel.com> --- extlinux/main.c | 50 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/extlinux/main.c b/extlinux/main.c index bc7ded3..74f8d1f 100644 --- a/extlinux/main.c +++ b/extlinux/main.c @@ -779,7 +779,7 @@ static char * get_default_subvol(char * rootdir, char * subvol) struct btrfs_ioctl_search_key *sk = &args.key; struct btrfs_ioctl_search_header *sh; int ret, i; - int fd; + int fd = -1; struct btrfs_root_ref *ref; struct btrfs_dir_item *dir_item; unsigned long off = 0; @@ -1044,12 +1044,12 @...
2013 Jul 22
1
[PATCH 1/1 v2] Add UFS1/2 support to Extlinux installer.
...naged by UFS group descriptor (ufs2 has no cow feature). + * btrfs: not managed by btrfs tree; since the cow feature of btrfs will + * move the ldlinux.sys every where. + */ int btrfs_install_file(const char *path, int devfd, struct stat *rst) { char *file; @@ -955,9 +979,10 @@ static char * get_default_subvol(char * rootdir, char * subvol) static int install_file(const char *path, int devfd, struct stat *rst) { - if (fs_type == EXT2 || fs_type == VFAT || fs_type == NTFS) + if (fs_type == EXT2 || fs_type == VFAT || fs_type == NTFS + || fs_type == UFS1) return ext2_fat_install_file(path, devfd...
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.
2014 May 29
3
[PATCH 0/2] UFS1/2 support series
From: Raphael S. Carvalho <raphael.scarv at gmail.com> Wrote the documentation below. I think it would be good to push the doc to the wiki as soon as the UFS support gets merged. Unix Fast File System (UFS/FFS) 1/2 on Syslinux - (usage/install) ----- There is a confusion about the name of this file system, then I decided to contact the author who replied: "The name has always been
2014 May 29
3
[PATCH v2 0/2] UFS1/2 support series
From: Raphael S. Carvalho <raphael.scarv at gmail.com> Change since v1: * Fix bug on dentry structure (thank you specification; btw, sarcasm), and consequently a bug on ufs_readdir. * Add readlink support (applied tests for symlinks whose destionation path were stored in blk pointers and the file itself). * Several improvements. Wrote the documentation below. I think it would be good to
2012 Sep 03
1
[GIT-PULL] XFS filesystem driver
...+ close(fd); + + return 0; + +bail: + if (dirfd >= 0) + close(dirfd); + + if (fd >= 0) + close(fd); + + return 1; +} + +/* * * test if path is a subvolume: * * this function return * * 0-> path exists but it is not a subvolume @@ -748,11 +885,14 @@ static char * get_default_subvol(char * rootdir, char * subvol) int install_file(const char *path, int devfd, struct stat *rst) { - if (fs_type == EXT2 || fs_type == VFAT || fs_type == NTFS) - return ext2_fat_install_file(path, devfd, rst); - else if (fs_type == BTRFS) - return btrfs_install_file(path, devfd, rst); - return...