mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	pnfs/blocklayout: set PNFS_LAYOUTRETURN_ON_ERROR
If there's an error doing I/O to block device, and the client resends the I/O to the MDS, the MDS must recall the layout from the client before processing the I/O. Let's preempt that exchange by returning the layout before falling back to the MDS when there's an error. Signed-off-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
		
							parent
							
								
									ad6b0241c9
								
							
						
					
					
						commit
						d78471d32b
					
				
					 2 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
					@ -887,6 +887,7 @@ static struct pnfs_layoutdriver_type blocklayout_type = {
 | 
				
			||||||
	.name				= "LAYOUT_BLOCK_VOLUME",
 | 
						.name				= "LAYOUT_BLOCK_VOLUME",
 | 
				
			||||||
	.owner				= THIS_MODULE,
 | 
						.owner				= THIS_MODULE,
 | 
				
			||||||
	.flags				= PNFS_LAYOUTRET_ON_SETATTR |
 | 
						.flags				= PNFS_LAYOUTRET_ON_SETATTR |
 | 
				
			||||||
 | 
										  PNFS_LAYOUTRET_ON_ERROR |
 | 
				
			||||||
					  PNFS_READ_WHOLE_PAGE,
 | 
										  PNFS_READ_WHOLE_PAGE,
 | 
				
			||||||
	.read_pagelist			= bl_read_pagelist,
 | 
						.read_pagelist			= bl_read_pagelist,
 | 
				
			||||||
	.write_pagelist			= bl_write_pagelist,
 | 
						.write_pagelist			= bl_write_pagelist,
 | 
				
			||||||
| 
						 | 
					@ -910,6 +911,7 @@ static struct pnfs_layoutdriver_type scsilayout_type = {
 | 
				
			||||||
	.name				= "LAYOUT_SCSI",
 | 
						.name				= "LAYOUT_SCSI",
 | 
				
			||||||
	.owner				= THIS_MODULE,
 | 
						.owner				= THIS_MODULE,
 | 
				
			||||||
	.flags				= PNFS_LAYOUTRET_ON_SETATTR |
 | 
						.flags				= PNFS_LAYOUTRET_ON_SETATTR |
 | 
				
			||||||
 | 
										  PNFS_LAYOUTRET_ON_ERROR |
 | 
				
			||||||
					  PNFS_READ_WHOLE_PAGE,
 | 
										  PNFS_READ_WHOLE_PAGE,
 | 
				
			||||||
	.read_pagelist			= bl_read_pagelist,
 | 
						.read_pagelist			= bl_read_pagelist,
 | 
				
			||||||
	.write_pagelist			= bl_write_pagelist,
 | 
						.write_pagelist			= bl_write_pagelist,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -524,8 +524,10 @@ static inline int pnfs_return_layout(struct inode *ino)
 | 
				
			||||||
	struct nfs_inode *nfsi = NFS_I(ino);
 | 
						struct nfs_inode *nfsi = NFS_I(ino);
 | 
				
			||||||
	struct nfs_server *nfss = NFS_SERVER(ino);
 | 
						struct nfs_server *nfss = NFS_SERVER(ino);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (pnfs_enabled_sb(nfss) && nfsi->layout)
 | 
						if (pnfs_enabled_sb(nfss) && nfsi->layout) {
 | 
				
			||||||
 | 
							set_bit(NFS_LAYOUT_RETURN_REQUESTED, &nfsi->layout->plh_flags);
 | 
				
			||||||
		return _pnfs_return_layout(ino);
 | 
							return _pnfs_return_layout(ino);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue