diff options
-rw-r--r-- | fs/nfs/nfs42proc.c | 3 | ||||
-rw-r--r-- | fs/nfs/pnfs.c | 7 | ||||
-rw-r--r-- | include/linux/nfs_fs.h | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index ee0248340a42..06c74cd93875 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c | |||
@@ -204,6 +204,9 @@ nfs42_layoutstat_release(void *calldata) | |||
204 | nfss->pnfs_curr_ld->cleanup_layoutstats(data); | 204 | nfss->pnfs_curr_ld->cleanup_layoutstats(data); |
205 | 205 | ||
206 | pnfs_put_layout_hdr(NFS_I(data->args.inode)->layout); | 206 | pnfs_put_layout_hdr(NFS_I(data->args.inode)->layout); |
207 | smp_mb__before_atomic(); | ||
208 | clear_bit(NFS_INO_LAYOUTSTATS, &NFS_I(data->args.inode)->flags); | ||
209 | smp_mb__after_atomic(); | ||
207 | nfs_iput_and_deactive(data->inode); | 210 | nfs_iput_and_deactive(data->inode); |
208 | kfree(data->args.devinfo); | 211 | kfree(data->args.devinfo); |
209 | kfree(data); | 212 | kfree(data); |
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 6279cff7df74..5b5224341bcd 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -2257,6 +2257,7 @@ pnfs_report_layoutstat(struct inode *inode) | |||
2257 | { | 2257 | { |
2258 | struct pnfs_layoutdriver_type *ld = NFS_SERVER(inode)->pnfs_curr_ld; | 2258 | struct pnfs_layoutdriver_type *ld = NFS_SERVER(inode)->pnfs_curr_ld; |
2259 | struct nfs_server *server = NFS_SERVER(inode); | 2259 | struct nfs_server *server = NFS_SERVER(inode); |
2260 | struct nfs_inode *nfsi = NFS_I(inode); | ||
2260 | struct nfs42_layoutstat_data *data; | 2261 | struct nfs42_layoutstat_data *data; |
2261 | struct pnfs_layout_hdr *hdr; | 2262 | struct pnfs_layout_hdr *hdr; |
2262 | int status = 0; | 2263 | int status = 0; |
@@ -2264,6 +2265,9 @@ pnfs_report_layoutstat(struct inode *inode) | |||
2264 | if (!pnfs_enabled_sb(server) || !ld->prepare_layoutstats) | 2265 | if (!pnfs_enabled_sb(server) || !ld->prepare_layoutstats) |
2265 | goto out; | 2266 | goto out; |
2266 | 2267 | ||
2268 | if (test_and_set_bit(NFS_INO_LAYOUTSTATS, &nfsi->flags)) | ||
2269 | goto out; | ||
2270 | |||
2267 | spin_lock(&inode->i_lock); | 2271 | spin_lock(&inode->i_lock); |
2268 | if (!NFS_I(inode)->layout) { | 2272 | if (!NFS_I(inode)->layout) { |
2269 | spin_unlock(&inode->i_lock); | 2273 | spin_unlock(&inode->i_lock); |
@@ -2296,6 +2300,9 @@ out_free: | |||
2296 | kfree(data); | 2300 | kfree(data); |
2297 | out_put: | 2301 | out_put: |
2298 | pnfs_put_layout_hdr(hdr); | 2302 | pnfs_put_layout_hdr(hdr); |
2303 | smp_mb__before_atomic(); | ||
2304 | clear_bit(NFS_INO_LAYOUTSTATS, &nfsi->flags); | ||
2305 | smp_mb__after_atomic(); | ||
2299 | goto out; | 2306 | goto out; |
2300 | } | 2307 | } |
2301 | EXPORT_SYMBOL_GPL(pnfs_report_layoutstat); | 2308 | EXPORT_SYMBOL_GPL(pnfs_report_layoutstat); |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index b95f914ce083..f91b5ade30c9 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -219,6 +219,7 @@ struct nfs_inode { | |||
219 | #define NFS_INO_COMMIT (7) /* inode is committing unstable writes */ | 219 | #define NFS_INO_COMMIT (7) /* inode is committing unstable writes */ |
220 | #define NFS_INO_LAYOUTCOMMIT (9) /* layoutcommit required */ | 220 | #define NFS_INO_LAYOUTCOMMIT (9) /* layoutcommit required */ |
221 | #define NFS_INO_LAYOUTCOMMITTING (10) /* layoutcommit inflight */ | 221 | #define NFS_INO_LAYOUTCOMMITTING (10) /* layoutcommit inflight */ |
222 | #define NFS_INO_LAYOUTSTATS (11) /* layoutstats inflight */ | ||
222 | 223 | ||
223 | static inline struct nfs_inode *NFS_I(const struct inode *inode) | 224 | static inline struct nfs_inode *NFS_I(const struct inode *inode) |
224 | { | 225 | { |