diff options
| author | Jaegeuk Kim <jaegeuk@google.com> | 2019-10-01 22:28:02 -0700 |
|---|---|---|
| committer | Georg Veichtlbauer <georg@vware.at> | 2023-11-02 10:59:00 +0100 |
| commit | 445ebe52b249be196978c9959c467996b7b46e35 (patch) | |
| tree | c9fce2c6e8c836f2b27f33e3c64e30abb23b33e0 | |
| parent | 420c7da5ec99f942f2f7b77fdbd9059044f626e4 (diff) | |
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>
| -rw-r--r-- | security/pfe/pfk.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/security/pfe/pfk.c b/security/pfe/pfk.c index 2e5aa2fb6688..c49b30e66f46 100644 --- a/security/pfe/pfk.c +++ b/security/pfe/pfk.c @@ -198,6 +198,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)) @@ -207,11 +209,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%p.\n", inode); return inode; |
