File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -980,6 +980,8 @@ int bch2_data_update_init(struct btree_trans *trans,
980
980
goto out_nocow_unlock ;
981
981
}
982
982
983
+ bch2_trans_unlock (trans );
984
+
983
985
ret = __bch2_data_update_bios_init (m , c , io_opts , buf_bytes );
984
986
if (ret )
985
987
goto out_nocow_unlock ;
Original file line number Diff line number Diff line change @@ -359,16 +359,14 @@ int bch2_move_extent(struct moving_context *ctxt,
359
359
return 0 ;
360
360
}
361
361
362
- /*
363
- * Before memory allocations & taking nocow locks in
364
- * bch2_data_update_init():
365
- */
366
- bch2_trans_unlock (trans );
367
-
368
- struct moving_io * io = kzalloc (sizeof (struct moving_io ), GFP_KERNEL );
362
+ struct moving_io * io = allocate_dropping_locks (trans , ret ,
363
+ kzalloc (sizeof (struct moving_io ), _gfp ));
369
364
if (!io )
370
365
goto err ;
371
366
367
+ if (ret )
368
+ goto err_free ;
369
+
372
370
INIT_LIST_HEAD (& io -> io_list );
373
371
io -> write .ctxt = ctxt ;
374
372
io -> read_sectors = k .k -> size ;
@@ -388,6 +386,8 @@ int bch2_move_extent(struct moving_context *ctxt,
388
386
io -> write .op .c = c ;
389
387
io -> write .data_opts = data_opts ;
390
388
389
+ bch2_trans_unlock (trans );
390
+
391
391
ret = bch2_data_update_bios_init (& io -> write , c , & io_opts );
392
392
if (ret )
393
393
goto err_free ;
You can’t perform that action at this time.
0 commit comments