From: Steve French Date: Sat, 13 Jan 2024 05:08:51 +0000 (-0600) Subject: cifs: fix flushing folio regression for 6.1 backport X-Git-Tag: v6.1.73~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9ee31dc7fcd3b5e9770561542a8355bf5de2a0b;p=thirdparty%2Fkernel%2Fstable.git cifs: fix flushing folio regression for 6.1 backport filemap_get_folio works differenty in 6.1 vs. later kernels (returning NULL in 6.1 instead of an error). Add this minor correction which addresses the regression in the patch: cifs: Fix flushing, invalidation and file size with copy_file_range() Link: https://lore.kernel.org/all/a76b370f93cb928c049b94e1fde0d2da506dfcb2.camel@amazon.com/ Reported-by: "Jitindar Singh, Suraj" Suggested-by: David Howells Reported-by: Salvatore Bonaccorso Signed-off-by: Steve French Tested-by: Salvatore Bonaccorso Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c index 2e15b182e59fc..7286a56aebfa9 100644 --- a/fs/smb/client/cifsfs.c +++ b/fs/smb/client/cifsfs.c @@ -1240,7 +1240,7 @@ static int cifs_flush_folio(struct inode *inode, loff_t pos, loff_t *_fstart, lo int rc = 0; folio = filemap_get_folio(inode->i_mapping, index); - if (IS_ERR(folio)) + if (!folio) return 0; size = folio_size(folio);