ext4: do not enable dioread_nolock by default

This commit fixes commit f5e77654 (Revert "ext4: make dioread_nolock the default")
that reversed intended logic of the merged commit 759c7a4e which was to
disabled dioread_nolock as the default.

This commit disables dioread_nolock flag by default and synchronizes the
rest of dioread_nolock logic with the upstream:
  - Re-introduces nodioread_nolock option
  - Disables dioread_nolock for data=journal case

BUG=b/204708739
TEST=presubmit
RELEASE_NOTE=None

cos-patch: bug
Change-Id: I1f14ca27346301bbf50e9671b21f71b23f0d94af
Signed-off-by: Oleksandr Tymoshenko <ovt@google.com>
Reviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/24720
Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
Reviewed-by: Leah Rumancik <lrumancik@google.com>
Reviewed-by: Meena Shanmugam <meenashanmugam@google.com>
(cherry picked from commit e7eac3619127c4600d6a9011a11a40ce0c8b0c28)
Reviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/24860
Main-Branch-Verified: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index ce14df9..67aa040 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1787,6 +1787,7 @@
 	{Opt_auto_da_alloc, "auto_da_alloc"},
 	{Opt_noauto_da_alloc, "noauto_da_alloc"},
 	{Opt_dioread_nolock, "dioread_nolock"},
+	{Opt_dioread_lock, "nodioread_nolock"},
 	{Opt_dioread_lock, "dioread_lock"},
 	{Opt_discard, "discard"},
 	{Opt_nodiscard, "nodiscard"},
@@ -4228,9 +4229,6 @@
 
 	blocksize = EXT4_MIN_BLOCK_SIZE << le32_to_cpu(es->s_log_block_size);
 
-	if (blocksize == PAGE_SIZE)
-		set_opt(sb, DIOREAD_NOLOCK);
-
 	if (le32_to_cpu(es->s_rev_level) == EXT4_GOOD_OLD_REV) {
 		sbi->s_inode_size = EXT4_GOOD_OLD_INODE_SIZE;
 		sbi->s_first_ino = EXT4_GOOD_OLD_FIRST_INO;
@@ -4349,9 +4347,9 @@
 #endif
 
 	if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) {
-		printk_once(KERN_WARNING "EXT4-fs: Warning: mounting "
-			    "with data=journal disables delayed "
-			    "allocation, O_DIRECT and fast_commit support!\n");
+		printk_once(KERN_WARNING "EXT4-fs: Warning: mounting with data=journal disables delayed allocation, dioread_nolock, O_DIRECT and fast_commit support!\n");
+		/* can't mount with both data=journal and dioread_nolock. */
+		clear_opt(sb, DIOREAD_NOLOCK);
 		clear_opt2(sb, JOURNAL_FAST_COMMIT);
 		if (test_opt2(sb, EXPLICIT_DELALLOC)) {
 			ext4_msg(sb, KERN_ERR, "can't mount with "