ICE, pfk: fix to set dio_inode precisely

When using loopback device with dio, we can't rely on page flag.

Bug: 141601405
Bug: 141860559
Bug: 140882488
Change-Id: I09526c25e8d5333853e777f29333f9fa8da37459
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
This commit is contained in:
Jaegeuk Kim
2019-10-01 22:28:02 -07:00
committed by Bruno Martins
parent c1316baf42
commit b5bdb49f03

View File

@@ -199,6 +199,8 @@ static inline bool pfk_is_ready(void)
*/
static struct inode *pfk_bio_get_inode(const struct bio *bio)
{
struct inode *inode;
if (!bio)
return NULL;
if (!bio_has_data((struct bio *)bio))
@@ -208,11 +210,9 @@ static struct inode *pfk_bio_get_inode(const struct bio *bio)
if (!bio->bi_io_vec->bv_page)
return NULL;
if (PageAnon(bio->bi_io_vec->bv_page)) {
struct inode *inode;
/* Using direct-io (O_DIRECT) without page cache */
inode = dio_bio_get_inode((struct bio *)bio);
/* Using direct-io (O_DIRECT) without page cache */
inode = dio_bio_get_inode((struct bio *)bio);
if (inode) {
pr_debug("inode on direct-io, inode = 0x%pK.\n", inode);
return inode;