Whamcloud - gitweb
LU-17000 utils: Remove check for errno != 0 42/53742/2
authorArshad Hussain <arshad.hussain@aeoncomputing.com>
Fri, 19 Jan 2024 07:44:21 +0000 (13:14 +0530)
committerOleg Drokin <green@whamcloud.com>
Sun, 4 Feb 2024 08:32:48 +0000 (08:32 +0000)
commit04d95ff28d1ddca79c204ceff7cd5d6ddfe83c34
treef8ec854c7ae49a324720c7d0897484e119246e97
parentbac650ff56f95cc81d1ce6571ef78cbb065b6f2e
LU-17000 utils: Remove check for errno != 0

In lustre_rename_fsname() after calls to system calls
like open/read/write/lseek there is a check if global
errno is not equal to zero. This is noop and not
required, as these system calls do reset errno to 0
on success.

The side effect of this check was that it appeared
that the errno could be 0 which would leave 'ret' as
negative. This would never happen, but was causing
Coverity to complain.

This patch fixes this coverity issue by removing
the comparison of errno != 0 which is not required.

Test-Parameters: trivial testlist=conf-sanity,sanityn
Fixes: d0c6e97fa53 ("LU-8900 snapshot: rename filesysetem fsname")
CoverityID: 397153 ("Argument cannot be negative")
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I7257434e6546f56f30841f49a3bde35e80360bb8
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53742
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/utils/mount_utils.c