Skip to content

Commit

Permalink
cifs: fix flushing folio regression for 6.1 backport
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steve French authored and Greg Kroah-Hartman committed Jan 15, 2024
1 parent 0f22c8a commit f9ee31d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/smb/client/cifsfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f9ee31d

Please sign in to comment.