diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index a5f4be6b9213..d95125714ebb 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c @@ -750,7 +750,6 @@ static const struct address_space_operations gfs2_aops = { .release_folio = iomap_release_folio, .invalidate_folio = iomap_invalidate_folio, .bmap = gfs2_bmap, - .direct_IO = noop_direct_IO, .migrate_folio = filemap_migrate_folio, .is_partially_uptodate = iomap_is_partially_uptodate, .error_remove_page = generic_error_remove_page, diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index cb62c8f07d1e..a6ad64cee885 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c @@ -630,6 +630,9 @@ int gfs2_open_common(struct inode *inode, struct file *file) ret = generic_file_open(inode, file); if (ret) return ret; + + if (!gfs2_is_jdata(GFS2_I(inode))) + file->f_mode |= FMODE_CAN_ODIRECT; } fp = kzalloc(sizeof(struct gfs2_file), GFP_NOFS);