Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fa4f895f authored by Namjae Jeon's avatar Namjae Jeon
Browse files

exfat: fix write failure on kernels prior to 4.8.



rw flags agrument in write_dirty_buffer() and __sync_dirty_buffer() was
changed since linux 4.8 kernels.

Reported-by: default avatarkuehnelth <kuehnelth@gmail.com>
Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
parent 2363111b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -224,7 +224,11 @@ int exfat_update_bhs(struct buffer_head **bhs, int nr_bhs, int sync)
		set_buffer_uptodate(bhs[i]);
		mark_buffer_dirty(bhs[i]);
		if (sync)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
			write_dirty_buffer(bhs[i], REQ_SYNC);
#else
			write_dirty_buffer(bhs[i], WRITE_SYNC);
#endif
	}

	for (i = 0; i < nr_bhs && sync; i++) {
+1 −1
Original line number Diff line number Diff line
@@ -141,7 +141,7 @@ static int exfat_set_vol_flags(struct super_block *sb, unsigned short new_flags)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
	__sync_dirty_buffer(sbi->boot_bh, REQ_SYNC | REQ_FUA | REQ_PREFLUSH);
#else
	__sync_dirty_buffer(sbi->boot_bh, REQ_SYNC | REQ_FUA | REQ_FLUSH);
	__sync_dirty_buffer(sbi->boot_bh, WRITE_FLUSH_FUA);
#endif

	return 0;