From: Steve French Subject: readahead not being thrown away by invalidate_inode_pages in 2.4 Date: 04 Feb 2004 20:38:31 -0600 Sender: linux-cifs-client-bounces+glfc-linux-cifs-client=gmane.org@lists.samba.org Message-ID: <1075948711.1255.11.camel@stevef95.austin.ibm.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: linux-cifs-client@lists.samba.org Return-path: To: linux-fsdevel@vger.kernel.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-cifs-client-bounces+glfc-linux-cifs-client=gmane.org@lists.samba.org List-Id: linux-fsdevel.vger.kernel.org In the following snippet of the cifs vfs close file handle code (.release vfs operation), I see the code below being executed but I don't see it actually invalidating what I expect on 2.4 (in particular 2.4.24). The equivalent approach works on 2.6. The intent was that when the last instance of a file was closed on this client for the readahead data to be discarded by the call to invalidate_inode_pages (in 2.6 this is invalidate_remote_inode) so we will be forced to go to the server (ie invoke when the file is reopened for current copies of the data (cifs distributed caching token management works best when the file is open, and would be hard to monitor properly while the server file has no open instances on the client). Is there a different call in 2.4 that can be used to discard the readahead pages in the page cache for this inode, invalidate_inode_pages does not seem to work as expected? if(list_empty(&(CIFS_I(inode)->openFileList))) { cFYI(1,("closing last open instance for inode %p",inode)); /* if the file is not open we do not know if we can cache info on this inode, much less write behind and read ahead */ CIFS_I(inode)->clientCanCacheRead = FALSE; CIFS_I(inode)->clientCanCacheAll = FALSE; invalidate_inode_pages(inode); } The result of this code not working is that on 2.4 stale file data can continue to be given back to the application on the client, even long after the file has been opened and closed by the client and opened, updated, closed by multiple other clients or directly on the server itself.