Giter Club home page Giter Club logo

Comments (5)

lundman avatar lundman commented on August 23, 2024

Further details on this, it would appear that both ZOL and FBSD relies on that uio is not yet updated by the time we call update_pages(). But in OS X, the uio has already been depleted by the call to dmu_write_uio_dbuf(). Since the num_ivecs is now 0, uio_update() no longer moves offset along as expected. (And all calls that rely on it, including uiomove())

Possibly a more correct solution is to put these lines near the top of zfs_write()

struct uio *uio_copy = NULL;

            if ( vn_has_cached_data(vp) )
                uio_copy = uio_duplicate(uio);

So that if we know we will call update_pages() (vn_has_cached_data is a test for z_is_mmapped) then make a copy of the uio before we start.

Use uio_copy in the call to update_pages() (as well as call uio_free()). This makes everything work the same as above without manual calls to uio_setoffset() to fix the offset.

As above, we still die later in the mismatched data check.

from zfs.

lundman avatar lundman commented on August 23, 2024

So at the moment, we make a uio copy.
another option is to change update_pages() to be like ZFS wants it, where we pass offset and len.

Either way is fine by me.

from zfs.

BjoKaSH avatar BjoKaSH commented on August 23, 2024

Very nice analysis. Although I am not sure I got the whole story, I think the current approach is fine. Adjusting update_pages() is something we can still do if it may reduce the overall set of changes or makes things simpler by some other way.

from zfs.

JMoVS avatar JMoVS commented on August 23, 2024

@lundman I guess we can safely close this issue by now?

from zfs.

JMoVS avatar JMoVS commented on August 23, 2024

fixed by now

from zfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.