[PATCH] btrfs: send: fix spelling mistake: "send_in_progres" -> "send_in_progress"

2018-05-04 Thread Colin King
From: Colin Ian King Trivial fix to spelling mistake of function name in btrfs_err message Signed-off-by: Colin Ian King --- fs/btrfs/send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/send.c

[PATCH][btrfs-next] Btrfs: extent map selftest: fix non-ANSI btrfs_test_extent_map declaration

2018-02-08 Thread Colin King
From: Colin Ian King The function btrfs_test_extent_map requires a void argument to be ANSI C compliant and so it matches the prototype in fs/btrfs/tests/btrfs-tests.h Cleans up sparse warning: fs/btrfs/tests/extent-map-tests.c:346:27: warning: non-ANSI function

[PATCH][btrfs-next] btrfs: remove redundant check on ret and goto

2018-01-12 Thread Colin King
From: Colin Ian King The check for a non-zero ret is redundant as the goto will jump to the very next statement anyway. Remove this extraneous code. Detected by CoverityScan, CID#1463784 ("Identical code for different branches") Signed-off-by: Colin Ian King

[PATCH][btrfs-next] Btrfs: extent map selftest: add missing void parameter to btrfs_test_extent_map

2018-01-08 Thread Colin King
From: Colin Ian King Add a missing void parameter to function btrfs_test_extent_map, fixes sparse warning: warning: non-ANSI function declaration of function 'btrfs_test_extent_map' Signed-off-by: Colin Ian King ---

[PATCH] btrfs: qgroup: remove unused label 'retry'

2017-12-21 Thread Colin King
From: Colin Ian King Label 'retry' is not used, remove it. Cleans up a clang build warning: warning: label ‘retry’ defined but not used [-Wunused-label] Fixes: b283738ab0ad ("Revert "btrfs: qgroups: Retry after commit on getting EDQUOT"") Signed-off-by: Colin Ian

[PATCH] btrfs: make function update_share_count static

2017-11-30 Thread Colin King
From: Colin Ian King The function update_share_count is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: fs/btrfs/backref.c:219:6: warning: symbol 'update_share_count' was not declared. Should it be static?

[PATCH] btrfs: make array types static const, reduces object code size

2017-09-19 Thread Colin King
From: Colin Ian King Don't populate the read-only array types on the stack, instead make it static const. Makes the object code smaller by nearly 60 bytes: Before: textdata bss dec hex filename 905366552 64 97152 17b80

[PATCH] btrfs: avoid null pointer dereference on fs_info when calling btrfs_crit

2017-09-11 Thread Colin King
From: Colin Ian King There are checks on fs_info in __btrfs_panic to avoid dereferencing a null fs_info, however, there is a call to btrfs_crit that may also dereference a null fs_info. Fix this by adding a check to see if fs_info is null and only print the s_id if

[PATCH] btrfs: remove redundant check on ret being non-zero

2017-08-15 Thread Colin King
From: Colin Ian King The error return variable ret is initialized to zero and then is checked to see if it is non-zero in the if-block that follows it. It is therefore impossible for ret to be non-zero after the if-block hence the check is redundant and can be removed.

[PATCH] btrfs: fix incorrect error return ret being passed to mapping_set_error

2017-05-09 Thread Colin King
From: Colin Ian King The setting of return code ret should be based on the error code passed into function end_extent_writepage and not on ret. Thanks to Liu Bo for spotting this mistake in the original fix I submitted. Detected by CoverityScan, CID#1414312 ("Logically

[PATCH] btrfs: remove redundant assignment and check on variable ret

2017-05-06 Thread Colin King
From: Colin Ian King Variable ret is assigned to zero and is always zero throughout the function. Thus the check for ret being less than zero is always false and so mapping_set_error always has an -EIO error passed to it. Hence we can remove the redundant assignment

[PATCH][V2] btrfs: remove redundant inode null check

2016-12-20 Thread Colin King
From: Colin Ian King The check for a null inode is redundant since the function is a callback for exportfs, which will itself crash if dentry->d_inode or parent->d_inode is NULL. Removing the null check makes this consistent with other file systems. Also remove the

[PATCH] btrfs: remove redundant inode null check

2016-12-16 Thread Colin King
From: Colin Ian King The check for a null inode is redundant since the function is a callback for exportfs, which will itself crash if dentry->d_inode or parent->d_inode is NULL. Removing the null check makes this consistent with other file systems. Found with static

[PATCH] btrfs: fix dereference on inode->i_sb before inode null check

2016-12-16 Thread Colin King
From: Colin Ian King inode is being deferenced and then inode is checked to see if it is null, implying we potentially could have a null pointer deference on inode. Found with static analysis by CoverityScan, CID 1389472 Fix this by dereferencing inode only after the