nixpkgs-suyu/pkgs/servers/openafs-client/I5558c64760e4cad2bd3dc648067d81020afc69b6.patch
2014-10-09 13:12:52 +02:00

48 lines
1.7 KiB
Diff

From: Marc Dionne <marc.dionne@your-file-system.com>
Date: Thu, 25 Sep 2014 10:52:12 +0000 (-0300)
Subject: Linux 3.17: Deal with d_splice_alias errors
X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=af7f1d59135526ea584a4403b6400106dc92a992;hp=880401913d6190054bb0511093606a206b16326c
Linux 3.17: Deal with d_splice_alias errors
In 3.17 the logic in d_splice_alias has changed. Of interest to
us is the fact that it will now return an EIO error if it finds
an existing connected directory for the dentry, where it would
previously have added a new alias for it. As a result the end
user can get EIO errors when accessing any file in a volume
if the volume was first accessed through a different path (ex:
RO path vs RW path).
This commit just restores the old behaviour, adding the directory
alias manually in the error case, which is what older versions
of d_splice_alias used to do.
Change-Id: I5558c64760e4cad2bd3dc648067d81020afc69b6
---
diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
index e03187f..0cdd9e0 100644
--- a/src/afs/LINUX/osi_vnodeops.c
+++ b/src/afs/LINUX/osi_vnodeops.c
@@ -1593,9 +1593,18 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp)
/* It's ok for the file to not be found. That's noted by the caller by
* seeing that the dp->d_inode field is NULL.
*/
- if (!code || code == ENOENT)
- return newdp;
- else
+ if (!code || code == ENOENT) {
+ /*
+ * d_splice_alias can return an error (EIO) if there is an existing
+ * connected directory alias for this dentry.
+ */
+ if (!IS_ERR(newdp))
+ return newdp;
+ else {
+ d_add(dp, ip);
+ return NULL;
+ }
+ } else
return ERR_PTR(afs_convert_code(code));
}