On Sat, Feb 01, 2020 at 11:51:33AM +0800, qiwuchen55@xxxxxxxxx wrote: > From: chenqiwu <chenqiwu@xxxxxxxxxx> > > Remove trivial nowait check for btrfs_file_write_iter(), > since buffered writes will return -EINVAL if IOCB_NOWAIT > passed in the follow-up function generic_write_checks(). > > Signed-off-by: chenqiwu <chenqiwu@xxxxxxxxxx> > --- > fs/btrfs/file.c | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c > index a16da27..320af95 100644 > --- a/fs/btrfs/file.c > +++ b/fs/btrfs/file.c > @@ -1896,10 +1896,6 @@ static ssize_t btrfs_file_write_iter(struct kiocb *iocb, > loff_t oldsize; > int clean_page = 0; > > - if (!(iocb->ki_flags & IOCB_DIRECT) && > - (iocb->ki_flags & IOCB_NOWAIT)) > - return -EOPNOTSUPP; This returns a different error code for the condition than generic_write_checks, and is checked without the inode lock. I'm not sure if we should remove it, it's a fast-fail path for buffered+nowait, that probably does not happen that often.
