Re: [PATCH] btrfs: use appropriate replacements for __sb_{start,end}_write calls

2017-10-10 Thread Rakesh Pandit
On Tue, Oct 10, 2017 at 02:08:11PM +0300, Nikolay Borisov wrote: > > > On 10.10.2017 13:48, Rakesh Pandit wrote: > > Commit a53f4f8e9c8eb ("btrfs: Don't call btrfs_start_transaction() on > > frozen fs to avoid deadlock.") started using internal calls and we

Re: [PATCH] btrfs: use appropriate replacements for __sb_{start,end}_write calls

2017-10-10 Thread Rakesh Pandit
On Tue, Oct 10, 2017 at 02:00:20PM +0300, Nikolay Borisov wrote: > > > On 10.10.2017 13:48, Rakesh Pandit wrote: > > Commit a53f4f8e9c8eb ("btrfs: Don't call btrfs_start_transaction() on > > frozen fs to avoid deadlock.") started using internal calls and we

[PATCH] btrfs: use appropriate replacements for __sb_{start,end}_write calls

2017-10-10 Thread Rakesh Pandit
Commit a53f4f8e9c8eb ("btrfs: Don't call btrfs_start_transaction() on frozen fs to avoid deadlock.") started using internal calls and we replace them with more suitable ones. Signed-off-by: Rakesh Pandit --- fs/btrfs/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH] Btrfs-progs: mkfs: remove ununsed parameters

2014-04-25 Thread Rakesh Pandit
Remove ununsed parameters since 71d6bd3c in create_raid_groups. Signed-off-by: Rakesh Pandit --- mkfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkfs.c b/mkfs.c index dbd83f5..35917f1 100644 --- a/mkfs.c +++ b/mkfs.c @@ -210,7 +210,7 @@ static int

[PATCH] Btrfs-progs: fix check to test trim support

2014-04-22 Thread Rakesh Pandit
It was added in 25d82d22 but broke recently in 4724d7b0 while making discard interruptible. Signed-off-by: Rakesh Pandit --- utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.c b/utils.c index 0bfb9d9..068b4f3 100644 --- a/utils.c +++ b/utils.c @@ -629,7 +629,7

[PATCH] Btrfs-progs: fsck: fix double free memory crash

2014-04-20 Thread Rakesh Pandit
call btrfs_close_again it again. Signed-off-by: Rakesh Pandit --- disk-io.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/disk-io.c b/disk-io.c index 19b95a7..8db0335 100644 --- a/disk-io.c +++ b/disk-io.c @@ -1091,8 +1091,7 @@ static struct btrfs_fs_info *__open_ctree_fd(i

[PATCH] Btrfs-progs: make smatch checker happy (trivial fixes)

2014-04-19 Thread Rakesh Pandit
It complains errno never gets assigned to zero in find-root and since errno anyway is zero at program started up, lets remove it. Check "copy is less then zero" isn't possible because strtoull used by arg_strtou64 wouldn't return -ve number. Trivial space fixes. Signed-o

[PATCH] Btrfs-progs: fi-disk_usage: free memory if realloc fails

2014-04-19 Thread Rakesh Pandit
Lets not assign *info_ptr to 0 before calling free on it and lose track of already allocated memory if realloc fails in add_info_to_list. Lets call free first. Signed-off-by: Rakesh Pandit --- cmds-fi-disk_usage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-fi

[PATCH] Btrfs-progs: cmds-subvolume: use parameter str instead of optarg

2014-04-18 Thread Rakesh Pandit
Fix unused parameter str (commit e8cfa3c8): get_subvolid was called with optarg passed as str, but get_subvolid kept using optarg. Signed-off-by: Rakesh Pandit --- cmds-subvolume.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmds-subvolume.c b/cmds-subvolume.c index

[PATCH 2/2] Btrfs-progs: receive: remove return type of close_inode_for_write

2014-04-18 Thread Rakesh Pandit
"close_inode_for_write" always returns 0, so just remove its return value and remove dead checking in caller. Signed-off-by: Rakesh Pandit --- cmds-receive.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/cmds-receive.c b/cmds-receive.c index 7a2382

[PATCH 1/2] Btrfs-progs: fsck: while checking root refs print readable errors

2014-04-18 Thread Rakesh Pandit
Lets use "errors" instead of "error" because more then one ref errors are possible. Also print error messages for unresolved refs in check_root_refs. Signed-off-by: Rakesh Pandit --- cmds-check.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a

[PATCH] Btrfs-progs: chunk_recovery: fix mem leak and pthread_cancel call

2014-03-26 Thread Rakesh Pandit
-NULL second argument to pthread_setcanceltype. Signed-off-by: Rakesh Pandit --- chunk-recover.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/chunk-recover.c b/chunk-recover.c index a05e644..613d715 100644 --- a/chunk-recover.c +++ b/chunk-recover.c

[PATCH] Btrfs-progs: scrub: disable thread cancelability during mutex locks

2014-03-25 Thread Rakesh Pandit
asynchronous thread but cancelability is disabled after mutex is locked. This patch moves the call to set cancelability type before mutex lock and makes corresponding changes to labels for error handling. Signed-off-by: Rakesh Pandit --- cmds-scrub.c | 31 ++- 1 file

[PATCH] Btrfs-progs: remove unsed pthread attribute objects

2014-03-24 Thread Rakesh Pandit
Threads always use default attributes in all tools, so pthread attribute objects and their initializations are of no use. Just pass NULL as attr attribute to pthread_create for default attributes. Signed-off-by: Rakesh Pandit --- cmds-scrub.c | 13 ++--- cmds-send.c | 7 +-- send

[PATCH v2] Btrfs-progs: btrfs-image: don't call pthread_join on IDs not present

2014-03-20 Thread Rakesh Pandit
assed to *_destroy from *_init Signed-off-by: Rakesh Pandit --- btrfs-image.c | 84 +-- 1 file changed, 36 insertions(+), 48 deletions(-) diff --git a/btrfs-image.c b/btrfs-image.c index 7bcfc06..c0195f1 100644 --- a/btrfs-image.c +++ b/btrfs

[PATCH] Btrfs-progs: btrfs-image: don't call pthread_join on IDs not present

2014-03-20 Thread Rakesh Pandit
y had this fixed, but repeats code from metadump_destroy. Reuse metadump_destroy by passing number of threads created (successful pthread_create calls) and save repeated cleaup code. Had to move metadump_destroy before metadump_init for obvious reasons. Signed-off-by: Rakesh Pandit --- btrfs-im

[PATCH] Btrfs-progs: btrfs: remove dead code in handle_options

2014-03-20 Thread Rakesh Pandit
Just cleanup: remove useless return type, while loop and dead code. Signed-off-by: Rakesh Pandit --- btrfs.c | 33 +++-- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/btrfs.c b/btrfs.c index 16458ef..25257b6 100644 --- a/btrfs.c +++ b/btrfs.c

[PATCH] Btrfs-progs: fsck: fix memory leak and unnecessary call to free

2014-03-15 Thread Rakesh Pandit
Free already allocated memory to item1_data if malloc fails for item2_data in swap_values. Seems to be a typo from commit 70749a77. Signed-off-by: Rakesh Pandit --- cmds-check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-check.c b/cmds-check.c index d1cafe1

[PATCH] Btrfs-progs: return with -ENOMEM if malloc fails

2014-03-15 Thread Rakesh Pandit
Prevent segfault if memory allocation fails for sargs in get_df (cmds-filesystem.c). Signed-off-by: Rakesh Pandit --- cmds-filesystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index c9e27fc..7eb6e9d 100644 --- a/cmds-filesystem.c

Re: [PATCH] Btrfs-progs: scrub: don't call unlock if pthread_mutex_lock fails

2014-03-14 Thread Rakesh Pandit
Hi, Forgot to mention the reason for change. If accepted this can be included in commit message: On Sat, Mar 15, 2014 at 01:49:45AM +0200, Rakesh Pandit wrote: > If pthread_mutex_lock fails (rare but fix it anyway), don't call > pthread_mutex_unlock on mutex. > Rationale

[PATCH] Btrfs-progs: scrub: don't call unlock if pthread_mutex_lock fails

2014-03-14 Thread Rakesh Pandit
If pthread_mutex_lock fails (rare but fix it anyway), don't call pthread_mutex_unlock on mutex. Signed-off-by: Rakesh Pandit --- cmds-scrub.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmds-scrub.c b/cmds-scrub.c index 128537b..ca11fb5 100644 --- a/cmds-scrub.c

Re: [PATCH] Btrfs-progs: mkfs: let user known when forcing mixed metadata/data groups

2014-03-12 Thread Rakesh Pandit
On Wed, Mar 12, 2014 at 05:36:14PM +0100, David Sterba wrote: > On Wed, Mar 12, 2014 at 03:43:24PM +0200, Rakesh Pandit wrote: > > While formatting multiple devics (and user doesn't specify -M) if one > > of them has block count or size less then 1 GiB, mkfs doesn't te

[PATCH] Btrfs-progs: mkfs: let user known when forcing mixed metadata/data groups

2014-03-12 Thread Rakesh Pandit
While formatting multiple devics (and user doesn't specify -M) if one of them has block count or size less then 1 GiB, mkfs doesn't tell user, on which one mixed metadata/data was forced. This patch updates message to print device name. Signed-off-by: Rakesh Pandit --- mkfs.c | 3 ++

[PATCH] Btrfs-progs: remove unused variable and update btrfs-image man page

2014-03-04 Thread Rakesh Pandit
41824] didn't find the relative chunk. Ideally btfsck should be updated to reflect this default behavior and not through these messages, but it isn't harmful and can be done later. Signed-off-by: Rakesh Pandit --- btrfs-image.c| 3 --- man/btrfs-image.8.in | 5 - 2 f

[PATCH] Btrfs-progs: free path if we don't find root item

2014-02-28 Thread Rakesh Pandit
In btrfs_find_last_root before returning with -ENOENT (if root item is not found) free path and also remove btrfs_release_path before btrfs_free_path because btrfs_free_path anyway calls it. Signed-off-by: Rakesh Pandit --- root-tree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions

[PATCH] btrfs-progs: mkfs.btrfs man page: update default metadata blocksize

2014-02-24 Thread Rakesh Pandit
Since commit c652e4ef changes default metadata blocksize, update corresponding options in man page. Signed-off-by: Rakesh Pandit --- man/mkfs.btrfs.8.in | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/man/mkfs.btrfs.8.in b/man/mkfs.btrfs.8.in index b54e935..dabeb62

[PATCH] btrfs-progs: don't remove BTRFS_BLOCK_GROUP_DUP in chunk type

2014-02-20 Thread Rakesh Pandit
60128, 1073741824] (flags = 36) didn't find the relative chunk. Even though ./btrfsck on /dev/sdb2 seemed fine. This is due to type mismatch above and type mismatch occured because we zero'ed out BTRFS_BLOCK_GROUP_DUP while handling chunk trees. Signed-off-by: Rakesh Pandit --- btrfs-ima