Whamcloud - gitweb
LU-4922 cfs_str2mask: Handle passing in a blank string better 19/56619/3
authorRonnie Sahlberg <rsahlberg@whamcloud.com>
Thu, 3 Oct 2024 03:31:45 +0000 (23:31 -0400)
committerOleg Drokin <green@whamcloud.com>
Mon, 9 Dec 2024 06:12:20 +0000 (06:12 +0000)
commit93ba9bfa262bfcbfb500e9e54ef9b59e8f1e9cba
tree2e3f5814edc1447b7580a8346bf4b04fc73a9f6b
parent0020b949db1da2e9396857f4339977e1430a152c
LU-4922 cfs_str2mask: Handle passing in a blank string better

Do not revert the flags to min_mask if passed an empty string
to the function.
Remove exclusion of the changelog_mask parameter from test_133g
as it no longer needs to be skipped.

The change initializes the new mask to the existing mask and only
re-sets it to use min_mask iff the first token in the string is a
'-' or '+'. This fixes a bug where if you were to pass an empty
string to this function it would reset the flags to min_mask.
With this change the flags will be left unchanged.

The only way curently for a user to invoke this function is via
the set_param param command.
That command does check for and will abort if the user tries to
specify "" before calling into cfs_str2mask() thus preventing the
issue in LU-4922 from triggering.

Signed-off-by: Ronnie Sahlberg <rsahlberg@whamcloud.com>
Change-Id: Ibe43509cbdec250e395e35648d399167026a1a14
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56619
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
libcfs/libcfs/libcfs_string.c
lustre/tests/sanity.sh