Skip to content

Commit

Permalink
fix the regression from "direct-io: Fix negative return from dio read…
Browse files Browse the repository at this point in the history
… beyond eof"

Sure, it's better to bail out of past-the-eof read and return 0 than return
a bogus negative value on such.  Only we'd better make sure we are bailing out
with 0 and not -ENOMEM...

Cc: [email protected]
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Dec 8, 2015
1 parent 4ad7862 commit 2d4594a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/direct-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,7 @@ do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
if (dio->flags & DIO_LOCKING)
mutex_unlock(&inode->i_mutex);
kmem_cache_free(dio_cache, dio);
retval = 0;
goto out;
}

Expand Down

0 comments on commit 2d4594a

Please sign in to comment.