/usr/src/kernel-patches/lustre/patches/vfs_races-2.6-rhel5.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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | diff -urp linux-2.6.18.rawops/fs/dcache.c linux-2.6.18.races/fs/dcache.c
--- linux-2.6.18.rawops/fs/dcache.c 2007-02-08 19:00:31.000000000 +0200
+++ linux-2.6.18.races/fs/dcache.c 2007-02-14 19:23:49.000000000 +0200
@@ -230,6 +230,13 @@ int d_invalidate(struct dentry * dentry)
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.
@@ -1400,13 +1407,21 @@ static void _d_rehash(struct dentry * en
* 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)
{
- spin_lock(&dcache_lock);
+ if (lock)
+ spin_lock(&dcache_lock);
spin_lock(&entry->d_lock);
_d_rehash(entry);
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 { \
@@ -1481,7 +1496,7 @@ static void switch_names(struct dentry *
* Update the dcache to reflect the move of a file name. Negative
* dcache entries should not be moved in this way.
*/
-static void d_move_locked(struct dentry * dentry, struct dentry * target)
+void d_move_locked(struct dentry * dentry, struct dentry * target)
{
struct hlist_head *list;
@@ -1549,6 +1563,8 @@ already_unhashed:
spin_unlock(&dentry->d_lock);
write_sequnlock(&rename_lock);
}
+
+EXPORT_SYMBOL(d_move_locked);
/**
* d_move - move a dentry
diff -urp linux-2.6.18.rawops/include/linux/dcache.h linux-2.6.18.races/include/linux/dcache.h
--- linux-2.6.18.rawops/include/linux/dcache.h 2007-02-14 16:52:37.000000000 +0200
+++ linux-2.6.18.races/include/linux/dcache.h 2007-02-14 19:21:14.000000000 +0200
@@ -177,6 +177,7 @@ d_iput: no no no yes
#define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */
#define DCACHE_UNHASHED 0x0010
+#define DCACHE_LUSTRE_INVALID 0x0040 /* Lustre invalidated */
#define DCACHE_INOTIFY_PARENT_WATCHED 0x0020 /* Parent inode is watched */
@@ -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
@@ -289,6 +291,7 @@ static inline struct dentry *d_add_uniqu
/* used for rename() and baskets */
extern void d_move(struct dentry *, struct dentry *);
+extern void d_move_locked(struct dentry *, struct dentry *);
/* appendix may either be NULL or be used for transname suffixes */
extern struct dentry * d_lookup(struct dentry *, struct qstr *);
|