summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve French <stfrench@microsoft.com>2024-01-12 23:08:51 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-15 18:54:51 +0100
commitf9ee31dc7fcd3b5e9770561542a8355bf5de2a0b (patch)
tree2119197e013248012adf5f639177cedfecf2bebb
parent0f22c8a6efe63c16d1abf1e6c0317abbf121f883 (diff)
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" <surajjs@amazon.com> Suggested-by: David Howells <dhowells@redhat.com> Reported-by: Salvatore Bonaccorso <carnil@debian.org> Signed-off-by: Steve French <stfrench@microsoft.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/smb/client/cifsfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c
index 2e15b182e59f..7286a56aebfa 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);