Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure in VSS pre and post restore is ignored #310

Open
kanak-clumio opened this issue Aug 20, 2023 · 1 comment
Open

Failure in VSS pre and post restore is ignored #310

kanak-clumio opened this issue Aug 20, 2023 · 1 comment

Comments

@kanak-clumio
Copy link

kanak-clumio commented Aug 20, 2023

In the source code, after pre and post restore, CheckSelectedWriterStatus() is called to check status of writers. I've copied snippet of code here for prerestore -

            // Issue a PreRestore event to the writers
            m_vssClient.PreRestore();

            // Execute the optional custom command between PreRestore and PostRestore
            try
            {
                // Check selected writer status
                m_vssClient.CheckSelectedWriterStatus();

As per the microsoft documentation, after pre-restore, we need to verify writer status - https://learn.microsoft.com/en-us/windows/win32/vss/overview-of-preparing-for-restore

Here is code of CheckSelectedWriterStatus -

// Check the status for all selected writers
void VssClient::CheckSelectedWriterStatus()
{
    FunctionTracer ft(DBG_INFO);

    if ((m_dwContext & VSS_VOLSNAP_ATTR_NO_WRITERS) != 0)
        return;

Here, the if condition is true in case of restore and hence checking writer status is actually skipped.
If I comment out this if condition and try to perform restore which is supposed to fail in prerestore, it actually fails.

@kanak-clumio
Copy link
Author

@oldnewthing can you help me with the above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant