Re: [RFC PATCH] smb: client: force dentry revalidation if nohandlecache is set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/30, Enzo Matsumiya wrote:
Some operations return -EEXIST for a non-existing dir/file because of
cached attributes.

Fix this by forcing dentry revalidation when nohandlecache is set.

...

---
fs/smb/client/inode.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c
index dd0afa23734c..5f9c5525385f 100644
--- a/fs/smb/client/inode.c
+++ b/fs/smb/client/inode.c
@@ -2427,6 +2427,9 @@ cifs_dentry_needs_reval(struct dentry *dentry)
	if (!lookupCacheEnabled)
		return true;

+	if (tcon->nohandlecache)
+		return true;
+
	if (!open_cached_dir_by_dentry(tcon, dentry->d_parent, &cfid)) {
		spin_lock(&cfid->fid_lock);
		if (cfid->time && cifs_i->time > cfid->time) {

Simplest fix for a bug we hit while debugging something else.

Sending as RFC because I wasn't sure if/why attributes caching
shouldn't be in sync with handles caching.

Appreciate any thoughts, corrections, explanations.


Cheers,

Enzo




[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux