search for: fs_devices

Displaying 20 results from an estimated 58 matches for "fs_devices".

2011 Apr 20
4
[PATCH 1/5] Btrfs: fix bh leak on __btrfs_open_devices path
...n.fujitsu.com> --- fs/btrfs/volumes.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 8b9fb8c..69fc902 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -631,6 +631,7 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices, list_add(&device->dev_alloc_list, &fs_devices->alloc_list); } + brelse(bh); continue; error_brelse: -- 1.7.4.4
2013 Jun 25
3
[PATCH] btrfs-progs: avoid memory leak in btrfs_close_devices
Three kind of structures need to be freed on close: * All struct btrfs_device managed by fs_devices * The name field for each struct btrfs_device * The above items for seed_devices Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com> --- volumes.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/volumes.c b/volumes.c index d6f81f8..257b740...
2010 Jan 19
1
static analysis tool cppcheck meets the btrfs code - four issues
...oc(sizeof(*cluster), GFP_NOFS);         if (!cluster)                 return -ENOMEM;         path = btrfs_alloc_path();         if (!path)         {                 kfree( cluster);                 return -ENOMEM;         } 4. [./btrfs/volumes.c:1257]: (error) Possible null pointer dereference: fs_devices The source code is                 while (fs_devices) {                         if (fs_devices->seed == device->fs_devices)                                 break;                         fs_devices = fs_devices->seed;                 }                 fs_devices->seed = device->fs_...
2013 Oct 25
8
[PATCH] btrfs: add framework to read fs info from btrfs-control
...+ kfree(fslist_arg); + return ret; +} + /* * used by btrfsctl to scan devices when no FS is mounted */ static long btrfs_control_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { - struct btrfs_ioctl_vol_args *vol; + struct btrfs_ioctl_vol_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...
2011 Sep 13
5
[PATCH] btrfs: trivial fix, a potential memory leak in btrfs_parse_early_options()
...ged, 8 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 15634d4..16f31e1 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -406,7 +406,7 @@ static int btrfs_parse_early_options(const char *options, fmode_t flags, u64 *subvol_rootid, struct btrfs_fs_devices **fs_devices) { substring_t args[MAX_OPT_ARGS]; - char *opts, *orig, *p; + char *device_name, *opts, *orig, *p; int error = 0; int intarg; @@ -457,8 +457,14 @@ static int btrfs_parse_early_options(const char *options, fmode_t flags, } break;...
2011 May 02
5
[PATCH v3 0/3] btrfs: quasi-round-robin for chunk allocation
In a multi device setup, the chunk allocator currently always allocates chunks on the devices in the same order. This leads to a very uneven distribution, especially with RAID1 or RAID10 and an uneven number of devices. This patch always sorts the devices before allocating, and allocates the stripes on the devices with the most available space, as long as there is enough space available. In a low
2011 Nov 09
6
[PATCH 0/5] Btrfs: mount error handling fixes
A bunch of fixes (memory leaks, NULL pointer dereferences and devices hanging in busy state) to sanitize error handling during mount sequence. This is on top of for-linus + slyfox''s double-free fix. Thanks, Ilya Ilya Dryomov (5): Btrfs: fix memory leak in btrfs_parse_early_options() Btrfs: fix subvol_name leak on error in btrfs_mount() Btrfs: avoid null dereference and leaks
2009 Nov 14
2
[PATCH] btrfs-progs: Check mount status of multidevice filesystems
...char *path, u64 sb_bytenr, - int writes) + int writes, int check_mount) { u32 sectorsize; u32 nodesize; @@ -657,9 +657,9 @@ struct btrfs_root *open_ctree_fd(int fp, const char *path, u64 sb_bytenr, fs_info, BTRFS_ROOT_TREE_OBJECTID); if (writes) - ret = btrfs_open_devices(fs_devices, O_RDWR); + ret = btrfs_open_devices(fs_devices, O_RDWR, check_mount); else - ret = btrfs_open_devices(fs_devices, O_RDONLY); + ret = btrfs_open_devices(fs_devices, O_RDONLY, check_mount); BUG_ON(ret); fs_info->super_bytenr = sb_bytenr; @@ -725,7 +725,7 @@ struct btrfs_root *open_ctre...
2011 Apr 12
3
[PATCH v2 0/3] btrfs: quasi-round-robin for chunk allocation
In a multi device setup, the chunk allocator currently always allocates chunks on the devices in the same order. This leads to a very uneven distribution, especially with RAID1 or RAID10 and an uneven number of devices. This patch always sorts the devices before allocating, and allocates the stripes on the devices with the most available space, as long as there is enough space available. In a low
2011 Apr 06
3
[PATCH V2] Btrfs: fix subvolume mount by name problem when default mount subvolume is set
...Opt_subvolid: + case Opt_subvolrootid: case Opt_device: /* * These are parsed by btrfs_parse_early_options @@ -385,7 +387,7 @@ out: */ static int btrfs_parse_early_options(const char *options, fmode_t flags, void *holder, char **subvol_name, u64 *subvol_objectid, - struct btrfs_fs_devices **fs_devices) + u64 *subvol_rootid, struct btrfs_fs_devices **fs_devices) { substring_t args[MAX_OPT_ARGS]; char *opts, *orig, *p; @@ -426,6 +428,18 @@ static int btrfs_parse_early_options(const char *options, fmode_t flags, *subvol_objectid = intarg; } break; + case Opt_subvol...
2013 Sep 01
0
[PATCH] btrfs: use list_for_each_entry_safe() when delete items
...1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 78b8717..1d1b595 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -616,13 +616,13 @@ static void free_device(struct rcu_head *head) static int __btrfs_close_devices(struct btrfs_fs_devices *fs_devices) { - struct btrfs_device *device; + struct btrfs_device *device, *next; if (--fs_devices->opened > 0) return 0; mutex_lock(&fs_devices->device_list_mutex); - list_for_each_entry(device, &fs_devices->devices, dev_list) { + list_for_each_entry_safe(device,...
2009 Jan 16
4
[PATCH] Btrfs: simplify iteration codes
...t); + list_for_each_entry(dev, head, dev_list) { if (dev->devid == devid && (!uuid || !memcmp(dev->uuid, uuid, BTRFS_UUID_SIZE))) { return dev; @@ -118,11 +116,9 @@ static noinline struct btrfs_device *__find_device(struct list_head *head, static noinline struct btrfs_fs_devices *find_fsid(u8 *fsid) { - struct list_head *cur; struct btrfs_fs_devices *fs_devices; - list_for_each(cur, &fs_uuids) { - fs_devices = list_entry(cur, struct btrfs_fs_devices, list); + list_for_each_entry(fs_devices, &fs_uuids, list) { if (memcmp(fsid, fs_devices->fsid, BTRFS_FSI...
2008 Jun 10
1
[PATCH, RFC] btrfs: allow scanning multiple devices during mount
...much later in the mount process and * only when we need to allocate a new super block. */ -static int btrfs_parse_early_options(const char *options, - char **subvol_name) +static int btrfs_parse_early_options(const char *options, int flags, + void *holder, char **subvol_name, + struct btrfs_fs_devices **fs_devices) { substring_t args[MAX_OPT_ARGS]; char *opts, *p; @@ -240,11 +243,18 @@ static int btrfs_parse_early_options(con case Opt_subvol: *subvol_name = match_strdup(&args[0]); break; + case Opt_device: + error = btrfs_scan_one_device(match_strdup(&args[0]), + f...
2013 Mar 09
4
[PATCH] use rcu_barrier() to wait for bdev puts at unmount
...utting it into close_ctree(); I don''t know if there'' anything else to wait for. Thoughts? diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 5cbb7f4..258316a 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -680,6 +680,7 @@ int btrfs_close_devices(struct btrfs_fs_devices *fs_devices) __btrfs_close_devices(fs_devices); free_fs_devices(fs_devices); } + rcu_barrier(); return ret; } -- 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.k...
2011 Dec 09
10
[PATCH 0/3] Btrfs: add IO error device stats
The goal is to detect when drives start to get an increased error rate, when drives should be replaced soon. Therefore statistic counters are added that count IO errors (read, write and flush). Additionally, the software detected errors like checksum errors and corrupted blocks are counted. An ioctl interface is added to get the device statistic counters. A second ioctl is added to atomically get
2009 Aug 05
3
RAID[56] with arbitrary numbers of "parity" stripes.
...+ } } static void set_block_group_readonly(struct btrfs_block_group_cache *cache) @@ -2643,27 +2653,27 @@ static void set_block_group_readonly(struct btrfs_block_group_cache *cache) u64 btrfs_reduce_alloc_profile(struct btrfs_root *root, u64 flags) { u64 num_devices = root->fs_info->fs_devices->rw_devices; + u64 num_spares = flags >> 56; u64 tmp; /* First, mask out the RAID levels which aren''t possible */ if (num_devices == 1) flags &= ~(BTRFS_BLOCK_GROUP_RAID1 | BTRFS_BLOCK_GROUP_RAID0 | - BTRFS_BLOCK_GROUP_RAID5); - if (num_devices < 3) - flags...
2011 Oct 28
0
[PATCH] Btrfs: don't try to touch sb->s_bdev
...insertions(+), 2 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index f2a4cc7..afd6a1e 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -1376,8 +1376,6 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path) next_device = list_entry(root->fs_info->fs_devices->devices.next, struct btrfs_device, dev_list); - if (device->bdev == root->fs_info->sb->s_bdev) - root->fs_info->sb->s_bdev = next_device->bdev; if (device->bdev == root->fs_info->fs_devices->latest_bdev) root->fs_info->fs_devices->latest_...
2012 May 25
6
[PATCH v5 0/3] Btrfs: add IO error device stats
Changes v1-v2: - Remove restriction that BTRFS_IOC_GET_DEVICE_STATS is a privileged operation - Cast u64 to unsigned long long for printf() Changes v2-v3: - Rebased on Chris'' current master Changes v3-v4: - Add padding at end of ioctl structure Changes v4-v5: - The statistic members in the ioctl are now organized as an array of 64 bit values. Symbolic names for the array indexes
2012 Sep 25
3
[PATCH] Btrfs: limit thread pool size when remounting
...et_max_workers(&fs_info->submit_workers, new_pool_size); - btrfs_set_max_workers(&fs_info->caching_workers, new_pool_size); - btrfs_set_max_workers(&fs_info->fixup_workers, new_pool_size); + btrfs_set_max_workers(&fs_info->submit_workers, + min_t(u64, fs_info->fs_devices->num_devices, + new_pool_size)); + btrfs_set_max_workers(&fs_info->caching_workers, min(2, new_pool_size)); + btrfs_set_max_workers(&fs_info->fixup_workers, min(1, new_pool_size)); btrfs_set_max_workers(&fs_info->endio_workers, new_pool_size); btrfs_set_max_worke...
2011 Mar 14
1
cppcheck and btrfs
...(error) Data is allocated but not initialized: extent_op [fs/btrfs/extent-tree.c:5768]: (error) Data is allocated but not initialized: extent_op [fs/btrfs/transaction.c:1161]: (error) Data is allocated but not initialized: ac [fs/btrfs/volumes.c:1387]: (error) Possible null pointer dereference: fs_devices [fs/btrfs/volumes.c:3636]: (error) Memory leak: device Now I''m not really a programmer (much less a kernel one) but I do see people using it discover issues in kernel code. Are these issues real or bugs in cppcheck ? cheers! Chris -- Chris Samuel : http://www.csamuel.org/ : Melbou...