This avoids the server piling up closed_fd objects when several delete are called on the same path.
Signed-off-by: Eric Pouech epouech@codeweavers.com
From: Eric Pouech epouech@codeweavers.com
This avoids the server piling up closed_fd objects when several delete are called on the same path.
Signed-off-by: Eric Pouech epouech@codeweavers.com --- server/fd.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/server/fd.c b/server/fd.c index f28937466fc..b5f5cd24574 100644 --- a/server/fd.c +++ b/server/fd.c @@ -1171,6 +1171,18 @@ static struct inode *get_inode( dev_t dev, ino_t ino, int unix_fd ) return inode; }
+static int inode_has_pending_close( struct inode *inode, const char *path ) +{ + struct fd *fd; + + LIST_FOR_EACH_ENTRY( fd, &inode->closed, struct fd, inode_entry ) + { + if (fd->closed && !strcmp( fd->closed->unix_name, path )) + return 1; + } + return 0; +} + /* add fd to the inode list of file descriptors to close */ static void inode_add_closed_fd( struct inode *inode, struct closed_fd *fd ) { @@ -1187,7 +1199,7 @@ static void inode_add_closed_fd( struct inode *inode, struct closed_fd *fd ) free( fd->unix_name ); free( fd ); } - else if (fd->disp_flags & FILE_DISPOSITION_DELETE) + else if ((fd->disp_flags & FILE_DISPOSITION_DELETE) && !inode_has_pending_close( inode, fd->unix_name )) { /* close the fd but keep the structure around for unlink */ if (fd->unix_fd != -1) close( fd->unix_fd );
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=147232
Your paranoid android.
=== debian11b (64 bit WoW report) ===
Report validation errors: dxgi:dxgi has unaccounted for todo messages dxgi:dxgi has unaccounted for skip messages The report seems to have been truncated
This is linked to https://bugs.winehq.org/show_bug.cgi?id=55151 cmd engine rewrite part XXII took care of fixing cmd.exe so that the batch demo so longer loops endlessly however, memory impact on wineserver of every growing the pending close list should be addressed