From: Taotao Chen <chentaotao@xxxxxxxxxxxxxx> Initialize fsdata with &iocb->ki_flags to allow filesystems to check iocb flags like IOCB_DONTCACHE during ->write_begin(). Signed-off-by: Taotao Chen <chentaotao@xxxxxxxxxxxxxx> --- mm/filemap.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/filemap.c b/mm/filemap.c index 7b90cbeb4a1a..9174b6310f0b 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -4087,7 +4087,11 @@ ssize_t generic_perform_write(struct kiocb *iocb, struct iov_iter *i) size_t offset; /* Offset into folio */ size_t bytes; /* Bytes to write to folio */ size_t copied; /* Bytes copied from user */ - void *fsdata = NULL; + /* + * Initialize fsdata with iocb flags pointer so that filesystems + * can check ki_flags (like IOCB_DONTCACHE) in write operations. + */ + void *fsdata = &iocb->ki_flags; bytes = iov_iter_count(i); retry: -- 2.34.1