diff options
author | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:49:33 -0500 |
---|---|---|
committer | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:50:21 -0500 |
commit | da5029563a0a026c64821b09e8e7b4fd81d3fe1b (patch) | |
tree | 5d5618e0cb382390073377b1be7d0aa76879ac54 /fs/ceph | |
parent | b7ab39f631f505edc2bbdb86620d5493f995c9da (diff) |
fs: dcache scale d_unhashed
Protect d_unhashed(dentry) condition with d_lock. This means keeping
DCACHE_UNHASHED bit in synch with hash manipulations.
Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/dir.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 3ecf915a4550..571f270dca0f 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c | |||
@@ -136,6 +136,7 @@ more: | |||
136 | fi->at_end = 1; | 136 | fi->at_end = 1; |
137 | goto out_unlock; | 137 | goto out_unlock; |
138 | } | 138 | } |
139 | spin_lock(&dentry->d_lock); | ||
139 | if (!d_unhashed(dentry) && dentry->d_inode && | 140 | if (!d_unhashed(dentry) && dentry->d_inode && |
140 | ceph_snap(dentry->d_inode) != CEPH_SNAPDIR && | 141 | ceph_snap(dentry->d_inode) != CEPH_SNAPDIR && |
141 | ceph_ino(dentry->d_inode) != CEPH_INO_CEPH && | 142 | ceph_ino(dentry->d_inode) != CEPH_INO_CEPH && |
@@ -145,13 +146,13 @@ more: | |||
145 | dentry->d_name.len, dentry->d_name.name, di->offset, | 146 | dentry->d_name.len, dentry->d_name.name, di->offset, |
146 | filp->f_pos, d_unhashed(dentry) ? " unhashed" : "", | 147 | filp->f_pos, d_unhashed(dentry) ? " unhashed" : "", |
147 | !dentry->d_inode ? " null" : ""); | 148 | !dentry->d_inode ? " null" : ""); |
149 | spin_unlock(&dentry->d_lock); | ||
148 | p = p->prev; | 150 | p = p->prev; |
149 | dentry = list_entry(p, struct dentry, d_u.d_child); | 151 | dentry = list_entry(p, struct dentry, d_u.d_child); |
150 | di = ceph_dentry(dentry); | 152 | di = ceph_dentry(dentry); |
151 | } | 153 | } |
152 | 154 | ||
153 | spin_lock(&dentry->d_lock); | 155 | dget_dlock(dentry); |
154 | dentry->d_count++; | ||
155 | spin_unlock(&dentry->d_lock); | 156 | spin_unlock(&dentry->d_lock); |
156 | spin_unlock(&dcache_lock); | 157 | spin_unlock(&dcache_lock); |
157 | 158 | ||