All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged] minix-fix-bug-when-opening-a-file-with-o_direct.patch removed from -mm tree
@ 2022-03-25  1:34 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2022-03-25  1:34 UTC (permalink / raw)
  To: mm-commits, jack, colin.king, christian.brauner, qhjin.dev, akpm


The patch titled
     Subject: minix: fix bug when opening a file with O_DIRECT
has been removed from the -mm tree.  Its filename was
     minix-fix-bug-when-opening-a-file-with-o_direct.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Qinghua Jin <qhjin.dev@gmail.com>
Subject: minix: fix bug when opening a file with O_DIRECT

Testcase:
1. create a minix file system and mount it
2. open a file on the file system with O_RDWR|O_CREAT|O_TRUNC|O_DIRECT
3. open fails with -EINVAL but leaves an empty file behind. All other
open() failures don't leave the failed open files behind.

It is hard to check the direct_IO op before creating the inode.  Just as
ext4 and btrfs do, this patch will resolve the issue by allowing to create
the file with O_DIRECT but returning error when writing the file.

Link: https://lkml.kernel.org/r/20220107133626.413379-1-qhjin.dev@gmail.com
Signed-off-by: Qinghua Jin <qhjin.dev@gmail.com>
Reported-by: Colin Ian King <colin.king@intel.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/minix/inode.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/fs/minix/inode.c~minix-fix-bug-when-opening-a-file-with-o_direct
+++ a/fs/minix/inode.c
@@ -447,7 +447,8 @@ static const struct address_space_operat
 	.writepage = minix_writepage,
 	.write_begin = minix_write_begin,
 	.write_end = generic_write_end,
-	.bmap = minix_bmap
+	.bmap = minix_bmap,
+	.direct_IO = noop_direct_IO
 };
 
 static const struct inode_operations minix_symlink_inode_operations = {
_

Patches currently in -mm which might be from qhjin.dev@gmail.com are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-25  1:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-25  1:34 [merged] minix-fix-bug-when-opening-a-file-with-o_direct.patch removed from -mm tree Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.