Commit c8ad8894 authored by Trond Myklebust's avatar Trond Myklebust

NFSv4.2/pnfs: Use GFP_NOIO for layoutstat reporting in the writeback path

Prevent a potential deadlock.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent d099d7b8
...@@ -510,7 +510,8 @@ nfs4_ff_layout_stat_io_start_read(struct nfs4_ff_layout_mirror *mirror, ...@@ -510,7 +510,8 @@ nfs4_ff_layout_stat_io_start_read(struct nfs4_ff_layout_mirror *mirror,
spin_unlock(&mirror->lock); spin_unlock(&mirror->lock);
if (report) if (report)
pnfs_report_layoutstat(mirror->lseg->pls_layout->plh_inode); pnfs_report_layoutstat(mirror->lseg->pls_layout->plh_inode,
GFP_KERNEL);
} }
static void static void
...@@ -538,7 +539,8 @@ nfs4_ff_layout_stat_io_start_write(struct nfs4_ff_layout_mirror *mirror, ...@@ -538,7 +539,8 @@ nfs4_ff_layout_stat_io_start_write(struct nfs4_ff_layout_mirror *mirror,
spin_unlock(&mirror->lock); spin_unlock(&mirror->lock);
if (report) if (report)
pnfs_report_layoutstat(mirror->lseg->pls_layout->plh_inode); pnfs_report_layoutstat(mirror->lseg->pls_layout->plh_inode,
GFP_NOIO);
} }
static void static void
......
...@@ -2267,7 +2267,7 @@ struct nfs4_threshold *pnfs_mdsthreshold_alloc(void) ...@@ -2267,7 +2267,7 @@ struct nfs4_threshold *pnfs_mdsthreshold_alloc(void)
#if IS_ENABLED(CONFIG_NFS_V4_2) #if IS_ENABLED(CONFIG_NFS_V4_2)
int int
pnfs_report_layoutstat(struct inode *inode) pnfs_report_layoutstat(struct inode *inode, gfp_t gfp_flags)
{ {
struct pnfs_layoutdriver_type *ld = NFS_SERVER(inode)->pnfs_curr_ld; struct pnfs_layoutdriver_type *ld = NFS_SERVER(inode)->pnfs_curr_ld;
struct nfs_server *server = NFS_SERVER(inode); struct nfs_server *server = NFS_SERVER(inode);
...@@ -2294,7 +2294,7 @@ pnfs_report_layoutstat(struct inode *inode) ...@@ -2294,7 +2294,7 @@ pnfs_report_layoutstat(struct inode *inode)
pnfs_get_layout_hdr(hdr); pnfs_get_layout_hdr(hdr);
spin_unlock(&inode->i_lock); spin_unlock(&inode->i_lock);
data = kzalloc(sizeof(*data), GFP_KERNEL); data = kzalloc(sizeof(*data), gfp_flags);
if (!data) { if (!data) {
status = -ENOMEM; status = -ENOMEM;
goto out_put; goto out_put;
......
...@@ -691,10 +691,10 @@ static inline void nfs4_pnfs_v3_ds_connect_unload(void) ...@@ -691,10 +691,10 @@ static inline void nfs4_pnfs_v3_ds_connect_unload(void)
#endif /* CONFIG_NFS_V4_1 */ #endif /* CONFIG_NFS_V4_1 */
#if IS_ENABLED(CONFIG_NFS_V4_2) #if IS_ENABLED(CONFIG_NFS_V4_2)
int pnfs_report_layoutstat(struct inode *inode); int pnfs_report_layoutstat(struct inode *inode, gfp_t gfp_flags);
#else #else
static inline int static inline int
pnfs_report_layoutstat(struct inode *inode) pnfs_report_layoutstat(struct inode *inode, gfp_t gfp_flags)
{ {
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment