Home Home > GIT Browse > SLE15
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-09-13 09:19:13 +0200
committerTakashi Iwai <tiwai@suse.de>2017-09-13 09:19:13 +0200
commitd129157c357275fe91d45a81a0caf062006ac2a2 (patch)
treebb7e0a85cdc06d03165cadf082ecfa4d4e9d9ec5
parentfbb6de6812c6168d8adb8e51cf9365ffea1c93dc (diff)
parentc4a4b4d13227c4d29cf4f5420862ff1b0a2b787d (diff)
Merge branch 'SLE12-SP3' into openSUSE-42.3rpm-4.4.87-25
-rw-r--r--drivers/md/raid5.c10
-rw-r--r--fs/nfs/file.c11
2 files changed, 15 insertions, 6 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index c7246a72bd27..df06f1d2ecf1 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -804,6 +804,14 @@ static void stripe_add_to_batch_list(struct r5conf *conf, struct stripe_head *sh
spin_unlock(&head->batch_head->batch_lock);
goto unlock_out;
}
+ /*
+ * We must assign batch_head of this stripe within the
+ * batch_lock, otherwise clear_batch_ready of batch head
+ * stripe could clear BATCH_READY bit of this stripe and
+ * this stripe->batch_head doesn't get assigned, which
+ * could confuse clear_batch_ready for this stripe
+ */
+ sh->batch_head = head->batch_head;
/*
* at this point, head's BATCH_READY could be cleared, but we
@@ -811,8 +819,6 @@ static void stripe_add_to_batch_list(struct r5conf *conf, struct stripe_head *sh
*/
list_add(&sh->batch_list, &head->batch_list);
spin_unlock(&head->batch_head->batch_lock);
-
- sh->batch_head = head->batch_head;
} else {
head->batch_head = head;
sh->batch_head = head->batch_head;
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index b63bb210f457..bcfa0d054e05 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -811,15 +811,18 @@ do_setlk(struct file *filp, int cmd, struct file_lock *fl, int is_local)
goto out;
/*
- * Revalidate the cache if the server has time stamps granular
- * enough to detect subsecond changes. Otherwise, clear the
- * cache to prevent missing any changes.
+ * Invalidate cache to prevent missing any changes. If
+ * the file is mapped, clear the page cache as well so
+ * those mappings will be loaded.
*
* This makes locking act as a cache coherency point.
*/
nfs_sync_mapping(filp->f_mapping);
- if (!NFS_PROTO(inode)->have_delegation(inode, FMODE_READ))
+ if (!NFS_PROTO(inode)->have_delegation(inode, FMODE_READ)) {
nfs_zap_caches(inode);
+ if (mapping_mapped(filp->f_mapping))
+ nfs_revalidate_mapping(inode, filp->f_mapping);
+ }
out:
return status;
}