* [PATCH 0/5] Btrfs progs, coverity fixes for 3.18-rc3
@ 2014-12-30 14:57 David Sterba
2014-12-30 14:57 ` [PATCH 1/5] btrfs-progs: check, fix path leak in error branch David Sterba
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: David Sterba @ 2014-12-30 14:57 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba
Several issues reported by coverity, minor resource leaks and two bugfixes.
David Sterba (5):
btrfs-progs: check, fix path leak in error branch
btrfs-progs: fi show, don't leak canonical path
btrfs-progs: check, missing parens around compound block in
find_normal_file_extent
btrfs-progs: fix overflow check in btrfs_insert_inode_ref
btrfs-progs: fix minor leak of dev_info in btrfs_scan_kernel
cmds-check.c | 8 +++++---
cmds-filesystem.c | 6 ++++--
inode-item.c | 2 +-
3 files changed, 10 insertions(+), 6 deletions(-)
--
2.1.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/5] btrfs-progs: check, fix path leak in error branch
2014-12-30 14:57 [PATCH 0/5] Btrfs progs, coverity fixes for 3.18-rc3 David Sterba
@ 2014-12-30 14:57 ` David Sterba
2014-12-30 14:57 ` [PATCH 2/5] btrfs-progs: fi show, don't leak canonical path David Sterba
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: David Sterba @ 2014-12-30 14:57 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba
Resolves-coverity-id: 1260250
Signed-off-by: David Sterba <dsterba@suse.cz>
---
cmds-check.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/cmds-check.c b/cmds-check.c
index e74b116c0c43..71e4f4f3a13b 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -2839,7 +2839,7 @@ static int repair_btree(struct btrfs_root *root,
ret = PTR_ERR(trans);
fprintf(stderr, "Error starting transaction: %s\n",
strerror(-ret));
- return ret;
+ goto out_free_path;
}
cache = first_cache_extent(corrupt_blocks);
while (cache) {
@@ -2894,8 +2894,9 @@ static int repair_btree(struct btrfs_root *root,
cache = next_cache_extent(cache);
}
out:
- btrfs_free_path(path);
btrfs_commit_transaction(trans, root);
+out_free_path:
+ btrfs_free_path(path);
return ret;
}
--
2.1.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/5] btrfs-progs: fi show, don't leak canonical path
2014-12-30 14:57 [PATCH 0/5] Btrfs progs, coverity fixes for 3.18-rc3 David Sterba
2014-12-30 14:57 ` [PATCH 1/5] btrfs-progs: check, fix path leak in error branch David Sterba
@ 2014-12-30 14:57 ` David Sterba
2014-12-30 14:57 ` [PATCH 3/5] btrfs-progs: check, missing parens around compound block in find_normal_file_extent David Sterba
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: David Sterba @ 2014-12-30 14:57 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba
Resolves-coverity-id: 1260252
Signed-off-by: David Sterba <dsterba@suse.cz>
---
cmds-filesystem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index 80875fffddfe..1c1d34ae8ca2 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -471,7 +471,6 @@ static int print_one_fs(struct btrfs_ioctl_fs_info_args *fs_info,
char *canonical_path;
tmp_dev_info = (struct btrfs_ioctl_dev_info_args *)&dev_info[i];
- canonical_path = canonicalize_path((char *)tmp_dev_info->path);
/* Add check for missing devices even mounted */
fd = open((char *)tmp_dev_info->path, O_RDONLY);
@@ -480,6 +479,7 @@ static int print_one_fs(struct btrfs_ioctl_fs_info_args *fs_info,
continue;
}
close(fd);
+ canonical_path = canonicalize_path((char *)tmp_dev_info->path);
printf("\tdevid %4llu size %s used %s path %s\n",
tmp_dev_info->devid,
pretty_size(tmp_dev_info->total_bytes),
--
2.1.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/5] btrfs-progs: check, missing parens around compound block in find_normal_file_extent
2014-12-30 14:57 [PATCH 0/5] Btrfs progs, coverity fixes for 3.18-rc3 David Sterba
2014-12-30 14:57 ` [PATCH 1/5] btrfs-progs: check, fix path leak in error branch David Sterba
2014-12-30 14:57 ` [PATCH 2/5] btrfs-progs: fi show, don't leak canonical path David Sterba
@ 2014-12-30 14:57 ` David Sterba
2014-12-30 14:57 ` [PATCH 4/5] btrfs-progs: fix overflow check in btrfs_insert_inode_ref David Sterba
2014-12-30 14:57 ` [PATCH 5/5] btrfs-progs: fix minor leak of dev_info in btrfs_scan_kernel David Sterba
4 siblings, 0 replies; 6+ messages in thread
From: David Sterba @ 2014-12-30 14:57 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba
Resolves-coverity-id: 1260248
Signed-off-by: David Sterba <dsterba@suse.cz>
---
cmds-check.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/cmds-check.c b/cmds-check.c
index 71e4f4f3a13b..d2d218a88589 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -2160,9 +2160,10 @@ static int find_normal_file_extent(struct btrfs_root *root, u64 ino)
fi = btrfs_item_ptr(path->nodes[0], path->slots[0],
struct btrfs_file_extent_item);
type = btrfs_file_extent_type(path->nodes[0], fi);
- if (type != BTRFS_FILE_EXTENT_INLINE)
+ if (type != BTRFS_FILE_EXTENT_INLINE) {
ret = 1;
goto out;
+ }
}
out:
btrfs_free_path(path);
--
2.1.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/5] btrfs-progs: fix overflow check in btrfs_insert_inode_ref
2014-12-30 14:57 [PATCH 0/5] Btrfs progs, coverity fixes for 3.18-rc3 David Sterba
` (2 preceding siblings ...)
2014-12-30 14:57 ` [PATCH 3/5] btrfs-progs: check, missing parens around compound block in find_normal_file_extent David Sterba
@ 2014-12-30 14:57 ` David Sterba
2014-12-30 14:57 ` [PATCH 5/5] btrfs-progs: fix minor leak of dev_info in btrfs_scan_kernel David Sterba
4 siblings, 0 replies; 6+ messages in thread
From: David Sterba @ 2014-12-30 14:57 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba
Resolves-coverity-id: 1260247
Signed-off-by: David Sterba <dsterba@suse.cz>
---
inode-item.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/inode-item.c b/inode-item.c
index 993f3091e335..522d25a433ac 100644
--- a/inode-item.c
+++ b/inode-item.c
@@ -89,7 +89,7 @@ int btrfs_insert_inode_ref(struct btrfs_trans_handle *trans,
ptr = (unsigned long)(ref + 1);
ret = 0;
} else if (ret < 0) {
- if (ret == EOVERFLOW)
+ if (ret == -EOVERFLOW)
ret = -EMLINK;
goto out;
} else {
--
2.1.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 5/5] btrfs-progs: fix minor leak of dev_info in btrfs_scan_kernel
2014-12-30 14:57 [PATCH 0/5] Btrfs progs, coverity fixes for 3.18-rc3 David Sterba
` (3 preceding siblings ...)
2014-12-30 14:57 ` [PATCH 4/5] btrfs-progs: fix overflow check in btrfs_insert_inode_ref David Sterba
@ 2014-12-30 14:57 ` David Sterba
4 siblings, 0 replies; 6+ messages in thread
From: David Sterba @ 2014-12-30 14:57 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba
Resolves-coverity-id: 1127098
Signed-off-by: David Sterba <dsterba@suse.cz>
---
cmds-filesystem.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index 1c1d34ae8ca2..a3cf114fb6ac 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -516,8 +516,10 @@ static int btrfs_scan_kernel(void *search)
continue;
ret = get_fs_info(mnt->mnt_dir, &fs_info_arg,
&dev_info_arg);
- if (ret)
+ if (ret) {
+ kfree(dev_info_arg);
goto out;
+ }
if (get_label_mounted(mnt->mnt_dir, label)) {
kfree(dev_info_arg);
--
2.1.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-12-30 14:57 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-30 14:57 [PATCH 0/5] Btrfs progs, coverity fixes for 3.18-rc3 David Sterba
2014-12-30 14:57 ` [PATCH 1/5] btrfs-progs: check, fix path leak in error branch David Sterba
2014-12-30 14:57 ` [PATCH 2/5] btrfs-progs: fi show, don't leak canonical path David Sterba
2014-12-30 14:57 ` [PATCH 3/5] btrfs-progs: check, missing parens around compound block in find_normal_file_extent David Sterba
2014-12-30 14:57 ` [PATCH 4/5] btrfs-progs: fix overflow check in btrfs_insert_inode_ref David Sterba
2014-12-30 14:57 ` [PATCH 5/5] btrfs-progs: fix minor leak of dev_info in btrfs_scan_kernel David Sterba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).