Skip to content

Commit 9bb56d5

Browse files
neilbrowntorvalds
authored andcommitted
FAT: use io_schedule_timeout() instead of congestion_wait()
congestion_wait() in this context is just a sleep - block devices do not support congestion signalling any more. The goal for this wait, which was introduced in commit ae78bf9 ("[PATCH] add -o flush for fat") is to wait for any recently written data to get to storage. We currently have no direct mechanism to do this, so a simple wait that behaves identically to the current congestion_wait() is the best we can do. This is a step towards removing congestion_wait() Link: https://lkml.kernel.org/r/163936544519.22433.13400436295732112065@noble.neil.brown.name Signed-off-by: NeilBrown <neilb@suse.de> Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent e35fa56 commit 9bb56d5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

fs/fat/file.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,10 @@ long fat_generic_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
175175
static int fat_file_release(struct inode *inode, struct file *filp)
176176
{
177177
if ((filp->f_mode & FMODE_WRITE) &&
178-
MSDOS_SB(inode->i_sb)->options.flush) {
178+
MSDOS_SB(inode->i_sb)->options.flush) {
179179
fat_flush_inodes(inode->i_sb, inode, NULL);
180-
congestion_wait(BLK_RW_ASYNC, HZ/10);
180+
set_current_state(TASK_UNINTERRUPTIBLE);
181+
io_schedule_timeout(HZ/10);
181182
}
182183
return 0;
183184
}

0 commit comments

Comments
 (0)