mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	bcachefs: Make sure c->vfs_sb is set before starting fs
This is necessary for the new blk_holder_ops, which want the vfs super_block available for synchronization. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
		
							parent
							
								
									13fd6be102
								
							
						
					
					
						commit
						1fdbe0b184
					
				
					 1 changed files with 8 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -2218,9 +2218,10 @@ static int bch2_fs_get_tree(struct fs_context *fc)
 | 
			
		|||
 | 
			
		||||
	bch2_opts_apply(&c->opts, opts);
 | 
			
		||||
 | 
			
		||||
	ret = bch2_fs_start(c);
 | 
			
		||||
	if (ret)
 | 
			
		||||
		goto err_stop_fs;
 | 
			
		||||
	/*
 | 
			
		||||
	 * need to initialise sb and set c->vfs_sb _before_ starting fs,
 | 
			
		||||
	 * for blk_holder_ops
 | 
			
		||||
	 */
 | 
			
		||||
 | 
			
		||||
	sb = sget(fc->fs_type, NULL, bch2_set_super, fc->sb_flags|SB_NOSEC, c);
 | 
			
		||||
	ret = PTR_ERR_OR_ZERO(sb);
 | 
			
		||||
| 
						 | 
				
			
			@ -2282,6 +2283,10 @@ static int bch2_fs_get_tree(struct fs_context *fc)
 | 
			
		|||
 | 
			
		||||
	sb->s_shrink->seeks = 0;
 | 
			
		||||
 | 
			
		||||
	ret = bch2_fs_start(c);
 | 
			
		||||
	if (ret)
 | 
			
		||||
		goto err_put_super;
 | 
			
		||||
 | 
			
		||||
	vinode = bch2_vfs_inode_get(c, BCACHEFS_ROOT_SUBVOL_INUM);
 | 
			
		||||
	ret = PTR_ERR_OR_ZERO(vinode);
 | 
			
		||||
	bch_err_msg(c, ret, "mounting: error getting root inode");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue