diff --git a/debian/changelog b/debian/changelog index 5569a626..97682f88 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,6 @@ wine-staging (1.7.54) UNRELEASED; urgency=low + * Updated server-FileEndOfFileInformation patchset, growing a memory mapped + file should still work. * Added patch to use wrapper function for consolidation callback during unwinding. * Added patch to implement stub for ProcessQuotaLimits info class. diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 7160c869..116c4b6e 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -4809,8 +4809,10 @@ fi # | if test "$enable_server_FileEndOfFileInformation" -eq 1; then patch_apply server-FileEndOfFileInformation/0001-ntdll-Set-EOF-on-file-which-has-a-memory-mapping-sho.patch + patch_apply server-FileEndOfFileInformation/0002-server-Growing-files-which-are-mapped-to-memory-shou.patch ( echo '+ { "Qian Hong", "ntdll: Set EOF on file which has a memory mapping should fail.", 1 },'; + echo '+ { "Sebastian Lackner", "server: Growing files which are mapped to memory should still work.", 1 },'; ) >> "$patchlist" fi diff --git a/patches/server-FileEndOfFileInformation/0002-server-Growing-files-which-are-mapped-to-memory-shou.patch b/patches/server-FileEndOfFileInformation/0002-server-Growing-files-which-are-mapped-to-memory-shou.patch new file mode 100644 index 00000000..0cf0986c --- /dev/null +++ b/patches/server-FileEndOfFileInformation/0002-server-Growing-files-which-are-mapped-to-memory-shou.patch @@ -0,0 +1,55 @@ +From 70e97a724ec17b2e78333eb79d25a443defca13c Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sat, 31 Oct 2015 21:11:23 +0100 +Subject: server: Growing files which are mapped to memory should still work. + +--- + server/fd.c | 23 ++++++++++++++++------- + 1 file changed, 16 insertions(+), 7 deletions(-) + +diff --git a/server/fd.c b/server/fd.c +index f91659d..144f04a 100644 +--- a/server/fd.c ++++ b/server/fd.c +@@ -2366,14 +2366,23 @@ static void set_fd_eof( struct fd *fd, file_pos_t eof ) + return; + } + +- /* can't set eof of files which are mapped to memory */ +- LIST_FOR_EACH( ptr, &fd->inode->open ) ++ if (fstat( fd->unix_fd, &st ) == -1) + { +- struct fd *fd_ptr = LIST_ENTRY( ptr, struct fd, inode_entry ); +- if (fd_ptr != fd && (fd_ptr->access & FILE_MAPPING_ACCESS)) ++ file_set_error(); ++ return; ++ } ++ ++ /* can't truncate files which are mapped to memory */ ++ if (eof < st.st_size) ++ { ++ LIST_FOR_EACH( ptr, &fd->inode->open ) + { +- set_error( STATUS_USER_MAPPED_FILE ); +- return; ++ struct fd *fd_ptr = LIST_ENTRY( ptr, struct fd, inode_entry ); ++ if (fd_ptr != fd && (fd_ptr->access & FILE_MAPPING_ACCESS)) ++ { ++ set_error( STATUS_USER_MAPPED_FILE ); ++ return; ++ } + } + } + +@@ -2381,7 +2390,7 @@ static void set_fd_eof( struct fd *fd, file_pos_t eof ) + if (ftruncate( fd->unix_fd, eof ) != -1) return; + + /* now check for the need to extend the file */ +- if (fstat( fd->unix_fd, &st ) != -1 && eof > st.st_size) ++ if (eof > st.st_size) + { + /* extend the file one byte beyond the requested size and then truncate it */ + /* this should work around ftruncate implementations that can't extend files */ +-- +2.6.1 +