GFS2: Pull request (merge window)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Linus,
Please disregard my previous pull request and
consider pulling the following changes for the GFS2 file system.
Special note:
This time we had an unusual dependency on a patch (f9fe1c12) which went through David Miller's net-next tree, so we have a merge commit in our GFS2 for-next branch. After you pulled that patch, I encountered a strange anomaly. Despite the fact that I did a git pull of master immediately prior, my pull request somehow generated an incorrect diffstat which showed phantom changes we did not make, for:
block/bio.c | 12 +- block/blk-core.c | 30 ++- block/blk-mq-tag.c | 3 + block/blk-mq.c | 9 +- drivers/md/dm.c | 29 +- drivers/md/raid10.c | 3 +- fs/fs-writeback.c | 35 ++-
I asked around, but nobody could tell me what went wrong. Strangely, this command:
git log --oneline --right-only origin/master...FETCH_HEAD --stat
doesn't show this, but this one does:
git diff --stat --right-only origin/master...FETCH_HEAD
So I created a temporary local branch and used git merge to generate a correct diffstat. Hopefully this pull will just work.
If there are problems, let me know how to do it better for next time. (Next time we hopefully won't have any merge commits).
Regards,
Bob Peterson
----------------------------------------------------------------
The following changes since commit f9fe1c12d126f9887441fa5bb165046f30ddd4b5:
rhashtable: Add rhashtable_lookup_get_insert_fast (2017-03-21 17:52:45 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git tags/gfs2-4.12.fixes
for you to fetch changes up to ed17545d01e4a40086f1622c88ce64cc0241cfc2:
GFS2: Allow glocks to be unlocked after withdraw (2017-05-05 14:19:28 -0500)
----------------------------------------------------------------
We've got ten GFS2 patches for this merge window (plus one merge commit).
1. Andreas Gruenbacher wrote a patch to replace the deprecated call to rhashtable_walk_init with rhashtable_walk_enter.
2. Andreas also wrote a patch to eliminate redundant code in two of our debugfs sequence files.
3. Andreas also cleaned up the rhashtable key ugliness Linus pointed out during this cycle, following Linus's suggestions.
4. Andreas also wrote a patch to take advantage of his new function rhashtable_lookup_get_insert_fast. This makes glock lookup faster and more bullet-proof.
5. Andreas also wrote a patch to revert a patch in the evict path that caused occasional deadlocks, and is no longer needed.
6. Andrew Price wrote a patch to re-enable fallocate for the rindex system file to enable gfs2_grow to grow properly on secondary file system grow operations.
7. I wrote a patch to initialize an inode number field to make certain kernel trace points more understandable.
8. I also wrote a patch that makes GFS2 file system "withdraw" work more like it should by ignoring operations after a withdraw that would formerly cause a BUG() and kernel panic.
9. I also reworked the entire truncate/delete algorithm, scrapping the old recursive algorithm in favor of a new non-recursive algorithm. This was done for performance:
This way, GFS2 no longer needs to lock multiple resource groups while doing truncates and deletes of files that cross multiple resource group boundaries, allowing for better parallelism. It also solves a problem whereby deleting large files would request a large chunk of kernel memory, which resulted in a get_page_from_freelist warning.
10. Due to a regression found during testing, I added a new patch to correct "GFS2: Prevent BUG from occurring when normal Withdraws occur".
----------------------------------------------------------------
Andreas Gruenbacher (5):
gfs2: Replace rhashtable_walk_init with rhashtable_walk_enter
gfs2: Deduplicate gfs2_{glocks,glstats}_open
gfs2: Don't pack struct lm_lockname
gfs2: Switch to rhashtable_lookup_get_insert_fast Revert "GFS2: Wait for iopen glock dequeues"
Andrew Price (1):
gfs2: Re-enable fallocate for the rindex
Bob Peterson (5):
GFS2: Prevent BUG from occurring when normal Withdraws occur
GFS2: Temporarily zero i_no_addr when creating a dinode Merge commit 'f9fe1c1' into for-next
GFS2: Non-recursive delete
GFS2: Allow glocks to be unlocked after withdraw
fs/gfs2/bmap.c | 741 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------ fs/gfs2/file.c | 6 +- fs/gfs2/glock.c | 81 ++++++++--------- fs/gfs2/incore.h | 8 +- fs/gfs2/inode.c | 4 +- fs/gfs2/rgrp.c | 7 -- fs/gfs2/rgrp.h | 7 ++ fs/gfs2/super.c | 11 ++- 8 files changed, 518 insertions(+), 347 deletions(-)
Quoted 9 lines · Bob Peterson
I asked around, but nobody could tell me what went wrong. Strangely, this command:
git log --oneline --right-only origin/master...FETCH_HEAD --stat
doesn't show this, but this one does:
git diff --stat --right-only origin/master...FETCH_HEAD
So the fundamental difference between "git log" and "git diff" is that one is a "ser operation" on the commits in question, and the other is fundamentally a "operation between two endpoints".
And that's why "git log" will always show the "right" thing - because even in the presense of complex history, there's no ambiguity about which commits are part of the new set, and which are in the old set. So "git log" just does a set difference, and shows the commits in one set but not the other.
But "git diff", because it is fundamentally about two particular points in history, can have a hard time once you have complex history:
what are the two points?
In particular, what "git diff origin/master...FETCH_HEAD" means is really:
- find the common point (git calls it "merge base" because the common
point is also used for merging) between the two commits (origin/master and FETCH_HEAD)
- do the diff from that common point to the end result (FETCH_HEAD)
and for linear history that is all very obvious and unambiguous.
But once you have non-linear history, and particularly once you have back-merges (ie you're not just merging work that is uniquely your own from multiple of your *own* branches, but you're also doing merges of upstream code), the notion of that "common case" is no longer unambiguous. There is not necessarily any *one* common base, there can be multiple points in history that are common between the two branches, but are distinct points of history (ie one is not an ancestor of another).
And since a diff is fundamentally about just two end-points ("what are the differences between these two points in the history"), "git diff" fundamentally cannot handle that case without help.
So "git diff" will pick the first of the merge bases it finds, and just use that. Which even in the presense of more complex history will often work by luck, but more often just means that you'll see differences that aren't all from your tree, but some of them came from the *other* common point(s).
For example, after doing the pull, I can then do:
git merge-base --all HEAD^ HEAD^2
to see the merge bases of the merge in HEAD. In this case, because of your back-merge, there's two of them (with more complex history, there can be more still):
f9fe1c12d126 rhashtable: Add rhashtable_lookup_get_insert_fast 69eea5a4ab9c Merge branch 'for-linus' of git://git.kernel.dk/linux-block
and because "git diff" will just pick the first one, you will basically have done
git diff f9fe1c12d126..FETCH_HEAD
and if you then look at the *set* of changes (with "git log" of that range), you'll see why that diff also ends up containing those block changes (because they came on from that other merge base: commit 69eea5a4ab9c that had that linux-block merge).
Now, doing a *merge* in git will take _all_ of those merge bases into account, and do something *much* more complicated than just a two-way diff. It will internally first create a single merge base (by recursively merging up all the other merge bases into a new internal commit), and then using that single merge base it will then do a normal three-way merge of the two branches.
"git diff' doesn't do that kind of complicated operation, and although it *could* do that merge base recursive merging dance, the problem would be what to do about conflicts (which "git merge" obviously can also have, but with git merge you have that whole manual conflict resolution case).
So once you have complex history that isn't just about merging your own local changes from other local branches, you'll start hitting this situation.
Visualizing the history with "gitk" for those cases is often a great way to see why there's no single point that can be diffed against.
But once you *do* have that kind of complex history, you're also expected to have the expertise to handle it:
Quoted 2 lines
So I created a temporary local branch and used git merge to generate a correct diffstat.
That's the correct thing to do. Hopefully the above explains *why* it's the correct thing to do.
(Although to be honest, I also am pretty used to parsing the wrong diffs, and people sometimes just send me the garbage diffstat and say "I don't know what happened", and I'll figure it out and can still validate that the garbage diffstat they sent me is what I too get if I do just a silly "git diff" without taking merge bases into account).
Linus