Btrfs-progs: scrub: don't call unlock if pthread_mutex_lock fails
authorRakesh Pandit <rakesh@tuxera.com>
Fri, 14 Mar 2014 23:49:45 +0000 (01:49 +0200)
committerChris Mason <clm@fb.com>
Fri, 21 Mar 2014 16:51:31 +0000 (09:51 -0700)
commit5d483022363254229afff73f79ecd6dd19910dab
treebd9af3e531f886134e24ac0b95965db9dc54c9ba
parent87d1676b22e6b1f166e4f4fcdec7a2af968e59dc
Btrfs-progs: scrub: don't call unlock if pthread_mutex_lock fails

If pthread_mutex_lock fails (rare but fix it anyway), don't call
pthread_mutex_unlock on mutex.

Rationale being that if pthread_mutex_lock fails pthread_mutex_unlock
will always fail and overwrite actual error value in err.

Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
cmds-scrub.c