Merge tag 'mm-stable-2023-04-27-15-30' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-block.git] / fs / netfs / buffered_read.c
index e3d754a9e1b0873d40ab30e1949a75b14c619561..3404707ddbe7302201288e793287a1de5c5e24e7 100644 (file)
@@ -349,8 +349,8 @@ int netfs_write_begin(struct netfs_inode *ctx,
 retry:
        folio = __filemap_get_folio(mapping, index, FGP_WRITEBEGIN,
                                    mapping_gfp_mask(mapping));
-       if (!folio)
-               return -ENOMEM;
+       if (IS_ERR(folio))
+               return PTR_ERR(folio);
 
        if (ctx->ops->check_write_begin) {
                /* Allow the netfs (eg. ceph) to flush conflicts. */