Code Monkey home page Code Monkey logo

Comments (11)

kakra avatar kakra commented on June 1, 2024

This is around here, it's always the crawler thread that exposes this kernel backtrace:

1244         /*
1245          * This walks the tree of merged and resolved refs. Tree blocks are
1246          * read in as needed. Unique entries are added to the ulist, and
1247          * the list of found roots is updated.
1248          *
1249          * We release the entire tree in one go before returning.
1250          */
1251         node = rb_first(&preftrees.direct.root);
1252         while (node) {
1253                 ref = rb_entry(node, struct prelim_ref, rbnode);
1254                 node = rb_next(&ref->rbnode);
1255                 WARN_ON(ref->count < 0);
1256                 if (roots && ref->count && ref->root_id && ref->parent == 0) {
1257                         if (sc && sc->root_objectid &&
1258                             ref->root_id != sc->root_objectid) {
1259                                 ret = BACKREF_FOUND_SHARED;
1260                                 goto out;
1261                         }

from bees.

Zygo avatar Zygo commented on June 1, 2024

I've been seeing that warning for years. It's a lot more common post-v4.14 (it occurs about once an hour on v4.12, once a minute on v4.14).

I'm not sure whether the various if (...ref->count...) statements do useful things when ref->count is negative. Whatever they do seems to be mostly harmless, given the thousands of times it has occurred for me over the past few years. I wonder if this could lead to things like FIEMAP falsely reporting extents as shared (possibly causing nodatacow to fail unnecessarily)?

from bees.

kakra avatar kakra commented on June 1, 2024

I think I saw something about ref->count in 4.14.13, I'll look if I can identify the patch again... Hang on...

from bees.

kakra avatar kakra commented on June 1, 2024

Can't find it... No idea where I found it. I'll try to ignore it keeping in mind that you're seeing it much more often without any visible effects.

from bees.

Zygo avatar Zygo commented on June 1, 2024

Maybe torvalds/linux@ec35e48 which was also cherry-picked for v4.14.13.

I haven't tested that yet, but I don't think it affects this WARN_ON. A comment elsewhere states that ref->count may be negative for delayed refs, and bees probably ends up calling LOGICAL_INO on a lot of those.

from bees.

kakra avatar kakra commented on June 1, 2024

Yes, I found this, too. Maybe I'm confusing with an older commit that actually replaced an WARN_ON(...)

from bees.

Zygo avatar Zygo commented on June 1, 2024

This happens on v4.14.14 too.

There was an earlier commit that touched this WARN_ON, but it didn't make a semantic change, it was just a code cleanup.

from bees.

Zygo avatar Zygo commented on June 1, 2024

https://www.spinics.net/lists/linux-btrfs/msg74077.html

Assuming that the above patch is accepted, the offending kernel warning will be killed.

from bees.

kakra avatar kakra commented on June 1, 2024

Nice work...

Would it make sense to guard the WARN_ON with if (node->action != BTRFS_DROP_DELAYED_REF) then, so it is still caught in other cases, instead of removing it completely?

from bees.

Zygo avatar Zygo commented on June 1, 2024

That would be a good question for the list. Sprinkling the code with random WARN_ONs is generally frowned upon without a compelling reason--probably to avoid having issues like this pop up 7 years later.

from bees.

Zygo avatar Zygo commented on June 1, 2024

This has been merged into upstream kernels 4.14.29 and 4.16-rc2. 4.9.x, 4.4x, and other LTS kernels don't need it because it doesn't affect them.

from bees.

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.