1 From ba288a873fb8ac3d1bf5563366558a905620c071 Mon Sep 17 00:00:00 2001
2 From: Steve French <stfrench@microsoft.com>
3 Date: Fri, 12 Jan 2024 23:08:51 -0600
4 Subject: cifs: fix flushing folio regression for 6.1 backport
6 filemap_get_folio works differenty in 6.1 vs. later kernels
7 (returning NULL in 6.1 instead of an error). Add
8 this minor correction which addresses the regression in the patch:
9 cifs: Fix flushing, invalidation and file size with copy_file_range()
11 Link: https://lore.kernel.org/all/a76b370f93cb928c049b94e1fde0d2da506dfcb2.camel@amazon.com/
12 Reported-by: "Jitindar Singh, Suraj" <surajjs@amazon.com>
13 Suggested-by: David Howells <dhowells@redhat.com>
14 Reported-by: Salvatore Bonaccorso <carnil@debian.org>
15 Signed-off-by: Steve French <stfrench@microsoft.com>
16 Tested-by: Salvatore Bonaccorso <carnil@debian.org>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19 fs/smb/client/cifsfs.c | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
22 --- a/fs/smb/client/cifsfs.c
23 +++ b/fs/smb/client/cifsfs.c
24 @@ -1240,7 +1240,7 @@ static int cifs_flush_folio(struct inode
27 folio = filemap_get_folio(inode->i_mapping, index);
32 size = folio_size(folio);