Whamcloud - gitweb
LU-16268 mdd: set effective changelog mask correctly 61/48961/3
authorMikhail Pershin <mpershin@whamcloud.com>
Tue, 25 Oct 2022 15:34:45 +0000 (18:34 +0300)
committerOleg Drokin <green@whamcloud.com>
Sat, 7 Jan 2023 07:54:57 +0000 (07:54 +0000)
When changelog mask is changed from MINMASK to a particular
value then recalculation is missed, so effective mask could
stay unchanged against expectations.

Patch adds additional check that old mask is MINMASK or not
to decide if mask recalculation is needed.

Test 160o is extended for that issue.

Fixes: ffe259f81cda ("LU-13055 changelog: use default mask if server has no mask")
Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Change-Id: Ia3c93e19daeb71ff1042ebdb555e918faf89f844
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48961
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/mdd/mdd_lproc.c
lustre/tests/sanity.sh

index 49216ec..703c72c 100644 (file)
@@ -155,11 +155,11 @@ mdd_changelog_mask_seq_write(struct file *file, const char __user *buffer,
 
        mdd->mdd_cl.mc_proc_mask = newmask;
 
-       /* if mask keeps all bits from oldmask then just extend the current
-        * mask, otherwise the current mask should be recalculated through
-        * all user masks.
+       /* if oldmask is not MINMASK and newmask keeps all bits from oldmask
+        * then just extend the current mask, otherwise the current mask
+        * should be recalculated through all user masks.
         */
-       if ((newmask & oldmask) == oldmask) {
+       if (oldmask != CHANGELOG_MINMASK && (newmask & oldmask) == oldmask) {
                spin_lock(&mdd->mdd_cl.mc_user_lock);
                mdd->mdd_cl.mc_current_mask |= newmask;
                spin_unlock(&mdd->mdd_cl.mc_user_lock);
index bb7a89a..0f41d98 100755 (executable)
@@ -17160,6 +17160,15 @@ test_160o() {
                                mdd.$mdt.changelog_current_mask -n)
        [[ $mask == *"HLINK"* ]] || error "mask is not DEFMASK as expected"
 
+       if (( $MDS1_VERSION >= $(version_code 2.15.52) )) ; then
+               # set server mask back to some value
+               changelog_chmask "CLOSE,UNLNK"
+               # check effective mask again, should not remain as DEFMASK
+               mask=$(do_facet $SINGLEMDS $LCTL get_param \
+                               mdd.$mdt.changelog_current_mask -n)
+               [[ $mask != *"HLINK"* ]] || error "mask is still DEFMASK"
+       fi
+
        do_facet $SINGLEMDS $LCTL --device $mdt \
                                changelog_deregister -u test_160o ||
                error "cannot deregister by name"