mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	btrfs: add missing iputs on orphan cleanup failure
We missed a couple of iput()s in the orphan cleanup failure paths, add them so we don't get refcount errors. The iput needs to be done in the check and not under a common label due to the way the code is structured. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
		
							parent
							
								
									9cf14029d5
								
							
						
					
					
						commit
						a13bb2c038
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
					@ -3691,6 +3691,7 @@ int btrfs_orphan_cleanup(struct btrfs_root *root)
 | 
				
			||||||
			trans = btrfs_start_transaction(root, 1);
 | 
								trans = btrfs_start_transaction(root, 1);
 | 
				
			||||||
			if (IS_ERR(trans)) {
 | 
								if (IS_ERR(trans)) {
 | 
				
			||||||
				ret = PTR_ERR(trans);
 | 
									ret = PTR_ERR(trans);
 | 
				
			||||||
 | 
									iput(inode);
 | 
				
			||||||
				goto out;
 | 
									goto out;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			btrfs_debug(fs_info, "auto deleting %Lu",
 | 
								btrfs_debug(fs_info, "auto deleting %Lu",
 | 
				
			||||||
| 
						 | 
					@ -3698,8 +3699,10 @@ int btrfs_orphan_cleanup(struct btrfs_root *root)
 | 
				
			||||||
			ret = btrfs_del_orphan_item(trans, root,
 | 
								ret = btrfs_del_orphan_item(trans, root,
 | 
				
			||||||
						    found_key.objectid);
 | 
											    found_key.objectid);
 | 
				
			||||||
			btrfs_end_transaction(trans);
 | 
								btrfs_end_transaction(trans);
 | 
				
			||||||
			if (ret)
 | 
								if (ret) {
 | 
				
			||||||
 | 
									iput(inode);
 | 
				
			||||||
				goto out;
 | 
									goto out;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue