@@ -308,8 +308,8 @@ static int bch2_ioc_goingdown(struct bch_fs *c, u32 __user *arg)
308
308
return ret ;
309
309
}
310
310
311
- static long __bch2_ioctl_subvolume_create (struct bch_fs * c , struct file * filp ,
312
- struct bch_ioctl_subvolume arg )
311
+ static long bch2_ioctl_subvolume_create (struct bch_fs * c , struct file * filp ,
312
+ struct bch_ioctl_subvolume arg )
313
313
{
314
314
struct inode * dir ;
315
315
struct bch_inode_info * inode ;
@@ -406,9 +406,12 @@ static long __bch2_ioctl_subvolume_create(struct bch_fs *c, struct file *filp,
406
406
!arg .src_ptr )
407
407
snapshot_src .subvol = inode_inum (to_bch_ei (dir )).subvol ;
408
408
409
+ down_write (& c -> snapshot_create_lock );
409
410
inode = __bch2_create (file_mnt_idmap (filp ), to_bch_ei (dir ),
410
411
dst_dentry , arg .mode |S_IFDIR ,
411
412
0 , snapshot_src , create_flags );
413
+ up_write (& c -> snapshot_create_lock );
414
+
412
415
error = PTR_ERR_OR_ZERO (inode );
413
416
if (error )
414
417
goto err3 ;
@@ -429,16 +432,6 @@ static long __bch2_ioctl_subvolume_create(struct bch_fs *c, struct file *filp,
429
432
return error ;
430
433
}
431
434
432
- static long bch2_ioctl_subvolume_create (struct bch_fs * c , struct file * filp ,
433
- struct bch_ioctl_subvolume arg )
434
- {
435
- down_write (& c -> snapshot_create_lock );
436
- long ret = __bch2_ioctl_subvolume_create (c , filp , arg );
437
- up_write (& c -> snapshot_create_lock );
438
-
439
- return ret ;
440
- }
441
-
442
435
static long bch2_ioctl_subvolume_destroy (struct bch_fs * c , struct file * filp ,
443
436
struct bch_ioctl_subvolume arg )
444
437
{
0 commit comments