mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	btrfs: sysfs, use btrfs_sysfs_remove_fsid to celanup errors in add_fsid
We have one simple function btrfs_sysfs_remove_fsid() to undo btrfs_sysfs_add_fsid(), which also does proper checks before releasing objects. One difference, if btrfs_sysfs_remove_fsid is used that now we also call kobject_del() which was missing before. This was tested (with kobject debug turned on) and no change in behaviour was found. This is a cleanup patch. Signed-off-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
		
							parent
							
								
									f657a31c86
								
							
						
					
					
						commit
						1f6087e69c
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -1371,7 +1371,7 @@ int btrfs_sysfs_add_fsid(struct btrfs_fs_devices *fs_devs)
 | 
				
			||||||
	if (!fs_devs->devices_kobj) {
 | 
						if (!fs_devs->devices_kobj) {
 | 
				
			||||||
		btrfs_err(fs_devs->fs_info,
 | 
							btrfs_err(fs_devs->fs_info,
 | 
				
			||||||
			  "failed to init sysfs device interface");
 | 
								  "failed to init sysfs device interface");
 | 
				
			||||||
		kobject_put(&fs_devs->fsid_kobj);
 | 
							btrfs_sysfs_remove_fsid(fs_devs);
 | 
				
			||||||
		return -ENOMEM;
 | 
							return -ENOMEM;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue