Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet/dist/uts/common/fs/zfs Commit the ZFS fi...



details:   https://anonhg.NetBSD.org/src/rev/f3b29321e586
branches:  trunk
changeset: 1016305:f3b29321e586
user:      chs <chs%NetBSD.org@localhost>
date:      Sun Nov 15 00:54:13 2020 +0000

description:
Commit the ZFS file that I forgot in this previous commit:

Move the handling of PG_PAGEOUT from uvm_aio_aiodone_pages() to
uvm_page_unbusy() so that all callers of uvm_page_unbusy() don't need to
handle this flag separately.  Split out the pages part of uvm_aio_aiodone()
into uvm_aio_aiodone_pages() in rump just like in the real kernel.
In ZFS functions that can fail to copy data between the ARC and VM pages,
use uvm_aio_aiodone_pages() rather than uvm_page_unbusy() so that we can
handle these "I/O" errors.  Fixes PR 55702.

diffstat:

 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c |  20 +++--------------
 1 files changed, 4 insertions(+), 16 deletions(-)

diffs (56 lines):

diff -r 54786c202fd1 -r f3b29321e586 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c    Sun Nov 15 00:19:17 2020 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c    Sun Nov 15 00:54:13 2020 +0000
@@ -6049,20 +6049,13 @@
                            PAGE_SIZE, va, DMU_READ_PREFETCH);
                        zfs_unmap_page(pg, va);
 
-                       rw_enter(rw, RW_WRITER);
                        if (err != 0) {
-                               for (i = 0; i < npages; i++) {
-                                       pg = ap->a_m[i];
-                                       if ((pg->flags & PG_FAKE) != 0) {
-                                               uvm_pagefree(pg);
-                                       } else {
-                                               uvm_page_unbusy(&pg, 1);
-                                       }
-                               }
+                               uvm_aio_aiodone_pages(ap->a_m, npages, false, err);
                                memset(ap->a_m, 0, sizeof(ap->a_m[0]) *
                                    npages);
                                break;
                        }
+                       rw_enter(rw, RW_WRITER);
                        pg->flags &= ~(PG_FAKE);
                }
 
@@ -6089,14 +6082,13 @@
        voff_t          len, klen;
        int             err;
 
-       bool async = (flags & PGO_SYNCIO) == 0;
        bool *cleanedp;
        struct uvm_object *uobj = &vp->v_uobj;
        krwlock_t *rw = uobj->vmobjlock;
 
        if (zp->z_sa_hdl == NULL) {
                err = 0;
-               goto out_unbusy;
+               goto out;
        }
 
        /*
@@ -6170,12 +6162,8 @@
        }
        dmu_tx_commit(tx);
 
-out_unbusy:
-       rw_enter(rw, RW_WRITER);
-       uvm_page_unbusy(pp, count);
-       rw_exit(rw);
-
 out:
+       uvm_aio_aiodone_pages(pp, count, true, err);
        return (err);
 }
 



Home | Main Index | Thread Index | Old Index