Commit 9552e19f authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet
Browse files

bcachefs: Fix dio write path with loopback dio mode



When the iov_iter is a bvec iter, it's possible the IO was submitted
from a kthread that didn't have an mm to switch to.

Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent 4d126dc8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2110,7 +2110,7 @@ static long bch2_dio_write_loop(struct dio_write *dio)
	while (1) {
		iter_count = dio->iter.count;

		if (kthread)
		if (kthread && dio->mm)
			kthread_use_mm(dio->mm);
		BUG_ON(current->faults_disabled_mapping);
		current->faults_disabled_mapping = mapping;
@@ -2120,7 +2120,7 @@ static long bch2_dio_write_loop(struct dio_write *dio)
		dropped_locks = fdm_dropped_locks();

		current->faults_disabled_mapping = NULL;
		if (kthread)
		if (kthread && dio->mm)
			kthread_unuse_mm(dio->mm);

		/*