提交 a5454f95 编写于 作者: T Thomas Weißschuh 提交者: Andrew Morton

tmpfs: ensure O_LARGEFILE with generic_file_open()

Without this check open() will open large files on tmpfs although
O_LARGEFILE was not specified.  This is inconsistent with other
filesystems.  Also it will later result in EOVERFLOW on stat() or EFBIG on
write().

Link: https://lore.kernel.org/lkml/76bedae6-22ea-4abc-8c06-b424ceb39217@t-8ch.de/
Link: https://lkml.kernel.org/r/20220928104535.61186-1-linux@weissschuh.netSigned-off-by: NThomas Weißschuh <thomas.weissschuh@amadeus.com>
Acked-by: NHugh Dickins <hughd@google.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
上级 7848ed62
...@@ -3902,6 +3902,7 @@ EXPORT_SYMBOL(shmem_aops); ...@@ -3902,6 +3902,7 @@ EXPORT_SYMBOL(shmem_aops);
static const struct file_operations shmem_file_operations = { static const struct file_operations shmem_file_operations = {
.mmap = shmem_mmap, .mmap = shmem_mmap,
.open = generic_file_open,
.get_unmapped_area = shmem_get_unmapped_area, .get_unmapped_area = shmem_get_unmapped_area,
#ifdef CONFIG_TMPFS #ifdef CONFIG_TMPFS
.llseek = shmem_file_llseek, .llseek = shmem_file_llseek,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册