From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 880C1385C6DD; Fri, 8 Mar 2024 10:37:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 880C1385C6DD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1709894237; bh=EJap4yRtI0jDl4Vl0bpe24A9FdLhOlU9iAJJQ6PrhvE=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=i2vOw18cuqBdBptPjBj7YGz6fj/uOtuQLt+6X4Hhj/XnBu/annDn/eD1C+/zsFLc4 AaeTFRuVUJpK2L55xznGdgYtHhtNapB1i+hCC4ryH2lPoysESqTd57UjZryjPz7OlU veZbGQGk2KBNZSScL7X45ZNkH1R2bOIChQ5FgNjA= Received: by calimero.vinschen.de (Postfix, from userid 500) id 5541FA807AA; Fri, 8 Mar 2024 11:37:15 +0100 (CET) Date: Fri, 8 Mar 2024 11:37:15 +0100 From: Corinna Vinschen To: Jeffrey Altman Cc: cygwin@cygwin.com Subject: Re: ls/stat on OneDrive causes download of files Message-ID: Reply-To: cygwin@cygwin.com Mail-Followup-To: Jeffrey Altman , cygwin@cygwin.com References: <208962d1-78cd-4e2d-9e4a-a1edcbf5e809@SystematicSW.ab.ca> <7d9fe460-5704-424b-a89b-e34ef2176d38@secure-endpoints.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <7d9fe460-5704-424b-a89b-e34ef2176d38@secure-endpoints.com> List-Id: Hi Jeffrey, On Mar 6 13:55, Jeffrey Altman via Cygwin wrote: > On 3/6/2024 12:19 PM, Corinna Vinschen via Cygwin wrote: > > We can add an explicit call to > > > > RtlSetProcessPlaceholderCompatibilityMode (PHCM_EXPOSE_PLACEHOLDERS); > > [...] > Files and directories that are placeholders should have either the > FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS or FILE_ATTRIBUTE_RECALL_ON_OPEN file > attributes set. When these attributes are set, applications and mini filters > are advised not to "read" or "open" the files or directories unless they > absolutely need to because doing so will cause the placeholder to be > replaced by an object containing the actual data which might take a long > time to fetch, Yesterday I stumbled over a certain NtCreateFile flag: FILE_OPEN_NO_RECALL (0x00400000) Instructs any filters that perform offline storage or virtualization to not recall the contents of the file as a result of this open. MS-CIFS described it like this: FILE_OPEN_NO_RECALL 0x00400000 In a hierarchical storage management environment, this option requests that the file SHOULD NOT be recalled from tertiary storage such as tape. A file recall can take up to several minutes in a hierarchical storage management environment. The clients can specify this option to avoid such delays. This sounds like we could simply add this flag to all NtOpenFile used for path conversion or stat-like calls, without having to care for any file attributes specificially. Does that make sense? Thanks, Corinna