mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	gfs2: Prevent double iput for journal on error
When a gfs2 file system is withdrawn it does iput on its journal to allow recovery from another cluster node. If it's unable to get a replacement inode for whatever reason, the journal descriptor would still be pointing at the evicted inode. So when unmount clears out the list of journals, it would do a second iput referencing the pointer. To avoid this, set the inode pointer to NULL. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
This commit is contained in:
		
							parent
							
								
									c412a97cf6
								
							
						
					
					
						commit
						04133b607a
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		| 
						 | 
					@ -204,6 +204,7 @@ static void signal_our_withdraw(struct gfs2_sbd *sdp)
 | 
				
			||||||
	 * exception code in glock_dq.
 | 
						 * exception code in glock_dq.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	iput(inode);
 | 
						iput(inode);
 | 
				
			||||||
 | 
						sdp->sd_jdesc->jd_inode = NULL;
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
	 * Wait until the journal inode's glock is freed. This allows try locks
 | 
						 * Wait until the journal inode's glock is freed. This allows try locks
 | 
				
			||||||
	 * on other nodes to be successful, otherwise we remain the owner of
 | 
						 * on other nodes to be successful, otherwise we remain the owner of
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue