/usr/src/kernel-patches/lustre/patches/vfs_races-2.6.12.patch is in linux-patch-lustre 1.8.5+dfsg-3ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | Index: linux-2.6.7-vanilla/fs/dcache.c
===================================================================
--- linux-2.6.7-vanilla.orig/fs/dcache.c 2004-07-01 12:09:19.000000000 +0300
+++ linux-2.6.7-vanilla/fs/dcache.c 2004-07-01 12:29:12.510193264 +0300
@@ -219,6 +219,13 @@
spin_unlock(&dcache_lock);
return 0;
}
+
+ /* network invalidation by Lustre */
+ if (dentry->d_flags & DCACHE_LUSTRE_INVALID) {
+ spin_unlock(&dcache_lock);
+ return 0;
+ }
+
/*
* Check whether to do a partial shrink_dcache
* to get rid of unused child entries.
@@ -1199,16 +1199,25 @@
* Adds a dentry to the hash according to its name.
*/
-void d_rehash(struct dentry * entry)
+void d_rehash_cond(struct dentry * entry, int lock)
{
struct hlist_head *list = d_hash(entry->d_parent, entry->d_name.hash);
- spin_lock(&dcache_lock);
+ if (lock)
+ spin_lock(&dcache_lock);
spin_lock(&entry->d_lock);
__d_rehash(entry, list);
spin_unlock(&entry->d_lock);
- spin_unlock(&dcache_lock);
+ if (lock)
+ spin_unlock(&dcache_lock);
}
+EXPORT_SYMBOL(d_rehash_cond);
+
+void d_rehash(struct dentry * entry)
+{
+ d_rehash_cond(entry, 1);
+ }
+
#define do_switch(x,y) do { \
__typeof__ (x) __tmp = x; \
x = y; y = __tmp; } while (0)
Index: linux-2.6.7-vanilla/include/linux/dcache.h
===================================================================
--- linux-2.6.7-vanilla.orig/include/linux/dcache.h 2004-07-01 12:24:53.602553208 +0300
+++ linux-2.6.7-vanilla/include/linux/dcache.h 2004-07-01 12:27:29.757814000 +0300
@@ -159,6 +159,8 @@
#define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */
#define DCACHE_UNHASHED 0x0010
+#define DCACHE_LUSTRE_INVALID 0x0020 /* Lustre invalidated */
+
extern spinlock_t dcache_lock;
@@ -254,6 +255,7 @@ extern int have_submounts(struct dentry
* This adds the entry to the hash queues.
*/
extern void d_rehash(struct dentry *);
+extern void d_rehash_cond(struct dentry *, int lock);
/**
* d_add - add dentry to hash queues
|