Corinna Vinschen
6ed4753e77
rename: Refactor "new file already exists and rename fails" case
...
If newfile already exists and is in use, trying to overwrite it with
NtSetInformationFile(FileRenameInformation) fails exactly as if we
don't have the permissions to delete it. Unfortunately the return code
is the same STATUS_ACCESS_DENIED, so we have no way to distinguish
these cases. What we do here so far is to start a transaction to delete
newfile. If this open fails with a transactional error we stop the
transaction and retry opening the file without transaction.
But, here's the problem: If newfile is in use, NtOpenFile(oldfile)
naturally does NOT fail with a transactional error. Rather, the
subsequent call to unlink_nt(newfile) does, because there's another
handle open to newfile outside a transaction. However, the code does
not check if unlink_nt fails with a transactional error and so fails
to retry without transaction.
This patch recifies the problem and checks unlink_nt's status as well.
Refactor code to get rid of goto into another code block.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-01-12 22:42:11 +01:00
..
2016-12-16 23:10:19 +01:00
2016-06-23 10:09:17 +02:00
2016-11-24 12:06:29 +01:00
2016-08-22 14:18:39 +02:00
2016-11-24 16:09:31 +01:00
2017-01-10 16:33:21 +01:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-24 21:07:39 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-25 10:21:45 +02:00
2016-06-23 10:09:17 +02:00
2016-12-16 23:10:19 +01:00
2016-04-01 13:53:25 +02:00
2016-04-04 16:39:41 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-08-25 14:18:31 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-08-15 10:56:57 +02:00
2016-08-15 10:56:57 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-08-20 17:14:55 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-08-23 15:07:42 +01:00
2016-06-25 13:36:52 +02:00
2016-06-23 10:09:17 +02:00
2016-06-25 00:43:01 +02:00
2016-07-27 14:00:30 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-08-23 15:07:42 +01:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 16:56:41 +02:00
2016-06-25 13:36:52 +02:00
2016-06-23 16:56:41 +02:00
2016-06-23 10:09:17 +02:00
2016-09-08 13:36:32 +02:00
2016-06-24 23:32:39 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-24 23:32:39 +02:00
2016-06-23 10:09:17 +02:00
2017-01-10 16:24:50 +01:00
2017-01-10 16:24:50 +01:00
2016-08-23 17:51:14 +02:00
2016-06-23 10:09:17 +02:00
2016-11-24 14:46:57 +01:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-11-24 14:43:52 +01:00
2016-06-23 16:56:41 +02:00
2016-06-24 23:32:39 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-24 21:56:34 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 16:56:41 +02:00
2017-01-10 16:24:50 +01:00
2016-06-23 22:18:42 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-12-14 14:14:28 +01:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-12-14 14:14:28 +01:00
2016-06-23 10:09:17 +02:00
2016-07-27 17:02:08 +01:00
2016-11-24 10:51:32 +01:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-10-21 13:39:02 +02:00
2016-08-15 10:56:57 +02:00
2016-06-24 21:07:39 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 16:56:41 +02:00
2016-06-23 10:09:17 +02:00
2015-03-03 12:58:34 +00:00
2016-06-25 00:43:01 +02:00
2016-03-24 16:39:15 +01:00
2016-03-24 16:39:15 +01:00
2016-06-23 10:09:17 +02:00
2016-06-24 23:32:39 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-03-29 14:43:55 +02:00
2016-08-15 10:56:58 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2015-11-18 19:09:47 +01:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-05-25 12:13:03 +02:00
2016-06-25 17:08:18 +01:00
2016-06-23 10:09:17 +02:00
2016-08-20 17:14:55 +02:00
2016-03-29 14:43:55 +02:00
2016-03-24 16:39:15 +01:00
2016-12-16 23:10:19 +01:00
2016-08-23 15:07:42 +01:00
2015-08-17 11:05:43 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 16:56:41 +02:00
2016-06-24 23:32:39 +02:00
2016-06-23 21:30:15 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2017-01-09 17:50:39 +01:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-08-23 12:38:28 +02:00
2016-12-14 14:14:28 +01:00
2016-06-23 10:09:17 +02:00
2016-12-14 14:14:28 +01:00
2016-06-23 10:09:17 +02:00
2017-01-12 09:10:30 +01:00
2016-11-24 15:06:05 +01:00
2016-09-08 13:36:31 +02:00
2016-06-23 10:09:17 +02:00
2017-01-10 16:38:01 +01:00
2017-01-10 16:24:50 +01:00
2016-06-25 13:36:52 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-02-17 10:55:28 +01:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 16:56:41 +02:00
2016-08-20 17:14:55 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-27 17:56:16 +02:00
2016-08-19 16:50:15 +02:00
2017-01-09 14:02:19 +01:00
2016-06-24 23:32:39 +02:00
2016-03-10 10:36:00 +01:00
2016-03-08 13:56:40 +01:00
2016-08-19 16:50:15 +02:00
2016-08-19 16:27:07 +02:00
2016-07-27 17:02:08 +01:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-11-24 14:24:07 +01:00
2016-11-24 10:51:32 +01:00
2016-06-23 10:09:17 +02:00
2016-11-24 10:51:32 +01:00
2016-06-25 00:42:36 +02:00
2016-06-23 10:09:17 +02:00
2016-07-06 19:12:59 +02:00
2016-08-15 10:56:57 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2017-01-12 22:42:11 +01:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-08-23 15:07:42 +01:00
2016-08-23 15:07:42 +01:00
2016-06-23 10:09:17 +02:00
2016-06-27 17:56:16 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2015-07-04 22:49:30 +02:00
2015-07-04 22:49:30 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 16:56:41 +02:00
2016-06-23 10:09:17 +02:00
2016-08-18 10:27:28 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-09-08 13:36:29 +02:00
2016-06-23 10:09:17 +02:00
2016-08-15 10:56:57 +02:00
2016-06-24 21:00:04 +02:00
2016-06-24 21:00:04 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-23 10:09:17 +02:00
2016-06-24 23:33:01 +02:00
2016-06-23 10:09:17 +02:00
2016-03-29 14:43:55 +02:00