Skip to content

Commit

Permalink
FAT: use io_schedule_timeout() instead of congestion_wait()
Browse files Browse the repository at this point in the history
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: Stephen Rothwell <sfr@canb.auug.org.au>
  • Loading branch information
NeilBrown authored and Stephen Rothwell committed Jan 4, 2022
1 parent fe8eb5f commit f6c4d92
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/fat/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,10 @@ long fat_generic_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
static int fat_file_release(struct inode *inode, struct file *filp)
{
if ((filp->f_mode & FMODE_WRITE) &&
MSDOS_SB(inode->i_sb)->options.flush) {
MSDOS_SB(inode->i_sb)->options.flush) {
fat_flush_inodes(inode->i_sb, inode, NULL);
congestion_wait(BLK_RW_ASYNC, HZ/10);
set_current_state(TASK_UNINTERRUPTIBLE);
io_schedule_timeout(HZ/10);
}
return 0;
}
Expand Down

0 comments on commit f6c4d92

Please sign in to comment.