2010-10-28 04:52:15

by Theodore Ts'o

[permalink] [raw]
Subject: [GIT PULL] ext4 update for 2.6.37

Hi Linus,

Please pull from:

git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git for_linus
or
git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git upstream-merge

the merge is somewhat complex, since there's been a lot of work going on
in parallel with discard and zeroout changes, as well as the change
block_prepare_write/__block_write_begin. The changes pass the xfstests
regression test suite, using both 1k and 4k block sizes --- both before
the upstream merge (the for_linus branch) and after doing a trial merge
with the head of your tree as of Wednesday evening (the upstream-merge
branch).

The changes this time around have two major features, which are
responsible for most of the new lines of code. One is lazy inode table
initialization, which allows ext4 file systems to be mkfs'ed very
quickly. The second is changing the I/O submission path so that it uses
the block I/O layer directly. This makes blktraces much smaller, and
makes ext4 far more scalable. On the boxacle "large file create"
workload, run with 48 and 192 threads on a 48-core AMD box, ext4 now has
a 3x increase in write throughput, and CPU usage has been reduced by a
factor of 3-4. Most of this was achieved by reducing spinlock
contention on the block queue submission locks.

We also added support for run-time discard of unused blocks using the
new FITRIM ioctl (which has been run by the linux-fs mailing list as a
generic file system-independent interface).

And, of course, a lot of bug fixes and clean ups.

- Ted

Brian King (1):
jbd2: Fix I/O hang in jbd2_journal_release_jbd_inode

Curt Wohlgemuth (1):
ext4: use dedicated slab caches for group_info structures

Dmitry Monakhov (1):
ext4: optimize orphan_list handling for ext4_setattr

Eric Sandeen (10):
ext4: stop looping in ext4_num_dirty_pages when max_pages reached
ext4: don't bump up LONG_MAX nr_to_write by a factor of 8
ext4: fix oops in trace_ext4_mb_release_group_pa
ext4: don't use ext4_allocation_contexts for tracing
ext4: queue conversion after adding to inode's completed IO list
ext4: remove unused ext4_sb_info members
ext4: tidy up a void argument in inode.c
ext4: implement writeback livelock avoidance using page tagging
ext4: update writeback_index based on last page scanned
ext4: move ext4_mb_{get,put}_buddy_cache_lock and make them static

Kazuya Mio (1):
ext4: fix compile error in ext4_fallocate()

Lukas Czerner (11):
ext4: check for negative error code from sb_issue_discard
ext4: don't hold spinlock while calling ext4_issue_discard()
Add helper function for blkdev_issue_zeroout (sb_issue_discard)
ext4: add support for lazy inode table initialization
ext4: add interface to advertise ext4 features in sysfs
ext4: use sb_issue_zeroout in setup_new_group_blocks
ext4: use sb_issue_zeroout in ext4_ext_zeroout
ext4: Use return value from sb_issue_discard()
fs: Add FITRIM ioctl
ext4: Add batched discard support for ext4
ext4: add batched_discard into ext4 feature list

Maciej Żenczykowski (1):
ext4: don't update sb journal_devnum when RO dev

Namhyung Kim (1):
ext4: Check return value of sb_getblk() and friends

Nicolas Kaiser (1):
ext4: fix unbalanced mutex unlock in error path of ext4_li_request_new

Sergey Senozhatsky (1):
ext4: fix NULL pointer dereference in print_daily_error_info()

Theodore Ts'o (18):
ext4: fix EOFBLOCKS_FL handling
jbd2: Add sanity check for attempts to start handle during umount
ext4: avoid uninitialized memory references in ext3_htree_next_block()
ext4: use search_dirblock() in ext4_dx_find_entry()
ext4: use KMEM_CACHE instead of kmem_cache_create
ext4: call mpage_da_submit_io() from mpage_da_map_blocks()
ext4: simplify ext4_writepage()
ext4: inline ext4_writepage() into mpage_da_submit_io()
ext4: inline walk_page_buffers() into mpage_da_submit_io
ext4: move mpage_put_bnr_to_bhs()'s functionality to mpage_da_submit_io()
ext4: use bio layer instead of buffer layer in mpage_da_submit_io
ext4: fix kernel oops if the journal superblock has a non-zero j_errno
ext4: rename {exit,init}_ext4_*() to ext4_{exit,init}_*()
ext4: make various ext4 functions be static
ext4: rename {ext,idx}_pblock and inline small extent functions
ext4: move flush_completed_IO to fs/ext4/fsync.c and make it static
ext4: rename mark_bitmap_end() to ext4_mark_bitmap_end()
ext4,jbd2: convert tracepoints to use major/minor numbers

Toshiyuki Okajima (2):
ext4: improve llseek error handling for overly large seek offsets
ext4: fix potential infinite loop in ext4_da_writepages()

Wen Congyang (1):
ext4: avoid null dereference in trace_ext4_mballoc_discard

Documentation/filesystems/ext4.txt | 14 +
fs/ext4/Makefile | 2 +-
fs/ext4/balloc.c | 5 +-
fs/ext4/block_validity.c | 7 +-
fs/ext4/dir.c | 2 +-
fs/ext4/ext4.h | 110 ++++++--
fs/ext4/ext4_extents.h | 65 ++++-
fs/ext4/extents.c | 369 ++++++++++-------------
fs/ext4/file.c | 44 +++-
fs/ext4/fsync.c | 83 +++++
fs/ext4/ialloc.c | 136 ++++++++-
fs/ext4/inode.c | 587 +++++++++++++-----------------------
fs/ext4/mballoc.c | 554 ++++++++++++++++++++++------------
fs/ext4/migrate.c | 2 +-
fs/ext4/move_extent.c | 22 +-
fs/ext4/namei.c | 63 ++---
fs/ext4/page-io.c | 430 ++++++++++++++++++++++++++
fs/ext4/resize.c | 53 +---
fs/ext4/super.c | 531 +++++++++++++++++++++++++++++++--
fs/ext4/xattr.c | 4 +-
fs/ext4/xattr.h | 8 +-
fs/ioctl.c | 39 +++
fs/jbd2/checkpoint.c | 10 +
fs/jbd2/commit.c | 12 +-
fs/jbd2/journal.c | 4 +-
fs/jbd2/transaction.c | 1 +
include/linux/blkdev.h | 8 +
include/linux/fs.h | 8 +
include/linux/jbd2.h | 2 +-
include/linux/percpu_counter.h | 10 +
include/linux/writeback.h | 2 +
include/trace/events/ext4.h | 378 ++++++++++++++---------
include/trace/events/jbd2.h | 78 +++--
33 files changed, 2513 insertions(+), 1130 deletions(-)


2010-10-28 07:50:39

by Markus Trippelsdorf

[permalink] [raw]
Subject: Re: [GIT PULL] ext4 update for 2.6.37

On Thu, Oct 28, 2010 at 12:52:07AM -0400, Theodore Ts'o wrote:
> Hi Linus,
>
> Please pull from:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git for_linus
> or
> git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git upstream-merge
>
> the merge is somewhat complex, since there's been a lot of work going on
> in parallel with discard and zeroout changes, as well as the change
> block_prepare_write/__block_write_begin. The changes pass the xfstests
> regression test suite, using both 1k and 4k block sizes --- both before
> the upstream merge (the for_linus branch) and after doing a trial merge
> with the head of your tree as of Wednesday evening (the upstream-merge
> branch).

This misses a trivial ifdef wrapper in fs/ext4/super.c for
!CONFIG_EXT4_FS_XATTR configurations. Something like this:

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 0348ce0..5f82585 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4773,9 +4773,12 @@ static int __init ext4_init_fs(void)
if (err)
goto out3;

+#ifdef CONFIG_EXT4_FS_XATTR
err = ext4_init_xattr();
+#endif
if (err)
goto out2;
+
err = init_inodecache();
if (err)
goto out1;
--
Markus

2010-10-28 07:56:40

by Ingo Molnar

[permalink] [raw]
Subject: -tip: origin tree build failure (was: [GIT PULL] ext4 update for 2.6.37)


hi Ted,

> Theodore Ts'o (18):
> ext4: rename {exit,init}_ext4_*() to ext4_{exit,init}_*()

Today's -tip fails to build due to upstream commit 5dabfc7 ("ext4: rename
{exit,init}_ext4_*() to ext4_{exit,init}_*()"), on all[yes/mod]config with
CONFIG_EXT4_FS_XATTR disabled:

fs/ext4/super.c:4776: error: implicit declaration of function ‘ext4_init_xattr’

Commit 5dabfc7 renamed init_ext4_xattr to ext4_init_xattr but forgot to update the
definition in fs/ext4/xattr.h. The patch below fixes it.

Thanks,

Ingo

Signed-off-by: Ingo Molnar <[email protected]>

--- linux.orig/fs/ext4/xattr.h
+++ linux/fs/ext4/xattr.h
@@ -122,7 +122,7 @@ ext4_xattr_put_super(struct super_block
}

static __init inline int
-init_ext4_xattr(void)
+ext4_init_xattr(void)
{
return 0;
}

2010-10-28 12:12:57

by Theodore Ts'o

[permalink] [raw]
Subject: Re: -tip: origin tree build failure (was: [GIT PULL] ext4 update for 2.6.37)


On Oct 28, 2010, at 3:56 AM, Ingo Molnar wrote:

>
> hi Ted,
>
>> Theodore Ts'o (18):
>> ext4: rename {exit,init}_ext4_*() to ext4_{exit,init}_*()
>
> Today's -tip fails to build due to upstream commit 5dabfc7 ("ext4: rename
> {exit,init}_ext4_*() to ext4_{exit,init}_*()"), on all[yes/mod]config with
> CONFIG_EXT4_FS_XATTR disabled:
>
> fs/ext4/super.c:4776: error: implicit declaration of function ?ext4_init_xattr?
>
> Commit 5dabfc7 renamed init_ext4_xattr to ext4_init_xattr but forgot to update the
> definition in fs/ext4/xattr.h. The patch below fixes it.

Acked-by: "Theodore Ts'o" <[email protected]>

Thanks for catching this, my bad.

-- Ted

2010-10-28 16:31:37

by Linus Torvalds

[permalink] [raw]
Subject: Re: -tip: origin tree build failure (was: [GIT PULL] ext4 update for 2.6.37)

On Thu, Oct 28, 2010 at 12:56 AM, Ingo Molnar <[email protected]> wrote:
>
> Today's -tip fails to build due to upstream commit 5dabfc7 ("ext4: rename
> {exit,init}_ext4_*() to ext4_{exit,init}_*()"), on all[yes/mod]config with
> CONFIG_EXT4_FS_XATTR disabled:

Btw, could you try to write these things so that the changelog doesn't
have to be totally rewritten? Now I always end up having to move
things around and edit them to be useful from a long-term perspective,
which is kind of silly.

Linus

2010-10-28 16:38:54

by Ingo Molnar

[permalink] [raw]
Subject: Re: -tip: origin tree build failure (was: [GIT PULL] ext4 update for 2.6.37)


* Linus Torvalds <[email protected]> wrote:

> On Thu, Oct 28, 2010 at 12:56 AM, Ingo Molnar <[email protected]> wrote:
> >
> > Today's -tip fails to build due to upstream commit 5dabfc7 ("ext4: rename
> > {exit,init}_ext4_*() to ext4_{exit,init}_*()"), on all[yes/mod]config with
> > CONFIG_EXT4_FS_XATTR disabled:
>
> Btw, could you try to write these things so that the changelog doesn't have to be
> totally rewritten? Now I always end up having to move things around and edit them
> to be useful from a long-term perspective, which is kind of silly.

Heh, i was just lazy and used sfr's linux-next build bug reporting mails as a
template ;-)

Point taken in any case, i'll read your edited changelog and will change the
template accordingly.

Would this:

Upstream commit 5dabfc7 ("ext4: rename {exit,init}_ext4_*() to
ext4_{exit,init}_*()"), breaks the build on all[yes/mod]config with
CONFIG_EXT4_FS_XATTR disabled:

...

have been better?

Thanks,

Ingo

2010-10-28 16:55:59

by Theodore Ts'o

[permalink] [raw]
Subject: Re: -tip: origin tree build failure (was: [GIT PULL] ext4 update for 2.6.37)

Linus, if it's helpful, I have a pull request with correctly worded
changelogs here:

git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git for_linus

My apologies again for screwing up these configs. The following has
been tested with allnoconfig, and I'm currently in the process of
testing allyesconfig (which I'm fairly confident will compile, or at
least if it fails, it won't be due to changes that came in via my
tree).
- Ted

Ingo Molnar (2):
ext4: Fix build when !CONFIG_EXT4_FS_XATTR
fs: build fix when !CONFIG_BLOCK

fs/ext4/xattr.h | 2 +-
include/linux/fs.h | 1 +
2 files changed, 2 insertions(+), 1 deletions(-)

2010-10-28 17:00:26

by Linus Torvalds

[permalink] [raw]
Subject: Re: -tip: origin tree build failure (was: [GIT PULL] ext4 update for 2.6.37)

On Thu, Oct 28, 2010 at 9:38 AM, Ingo Molnar <[email protected]> wrote:
>
> Point taken in any case, i'll read your edited changelog and will change the
> template accordingly.
>
> Would this:
>
> ?Upstream commit 5dabfc7 ("ext4: rename {exit,init}_ext4_*() to
> ?ext4_{exit,init}_*()"), breaks the build on all[yes/mod]config with
> ?CONFIG_EXT4_FS_XATTR disabled:
>
> ?...
>
> have been better?

Yes. Except for the kernel the default git commit abbreviation is
borderline too short. Seven hex-chars can easily alias with a few more
pulls from me: git will not give aliases at the time it gives a
shorthand, but a month or two later the abbreviated commit may no
longer be unique.

So I suggest using --abbrev=12 or similar.

What I ended up writing your commit as was this:

ext4: fix compile with CONFIG_EXT4_FS_XATTR disabled

Commit 5dabfc78dced ("ext4: rename {exit,init}_ext4_*() to
ext4_{exit,init}_*()") causes

fs/ext4/super.c:4776: error: implicit declaration of function
?ext4_init_xattr?

when CONFIG_EXT4_FS_XATTR is disabled.

It renamed init_ext4_xattr to ext4_init_xattr but forgot to update the
dummy definition in fs/ext4/xattr.h.

Signed-off-by: Ingo Molnar <[email protected]>
Acked-by: "Theodore Ts'o" <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>

but that's just me.

Linus

2010-10-28 17:17:15

by Ingo Molnar

[permalink] [raw]
Subject: Re: -tip: origin tree build failure (was: [GIT PULL] ext4 update for 2.6.37)


* Linus Torvalds <[email protected]> wrote:

> On Thu, Oct 28, 2010 at 9:38 AM, Ingo Molnar <[email protected]> wrote:
> >
> > Point taken in any case, i'll read your edited changelog and will change the
> > template accordingly.
> >
> > Would this:
> >
> >  Upstream commit 5dabfc7 ("ext4: rename {exit,init}_ext4_*() to
> >  ext4_{exit,init}_*()"), breaks the build on all[yes/mod]config with
> >  CONFIG_EXT4_FS_XATTR disabled:
> >
> >  ...
> >
> > have been better?
>
> Yes. Except for the kernel the default git commit abbreviation is borderline too
> short. Seven hex-chars can easily alias with a few more pulls from me: git will
> not give aliases at the time it gives a shorthand, but a month or two later the
> abbreviated commit may no longer be unique.
>
> So I suggest using --abbrev=12 or similar.

ok. A helper script i use does this:

git log --pretty=format:"%h: %s" $@

I have added --abbrev=12. Might make sense to lengthen the %h default in upstream
Git as well?

> What I ended up writing your commit as was this:
>
> ext4: fix compile with CONFIG_EXT4_FS_XATTR disabled
>
> Commit 5dabfc78dced ("ext4: rename {exit,init}_ext4_*() to
> ext4_{exit,init}_*()") causes
>
> fs/ext4/super.c:4776: error: implicit declaration of function ‘ext4_init_xattr’
>
> when CONFIG_EXT4_FS_XATTR is disabled.
>
> It renamed init_ext4_xattr to ext4_init_xattr but forgot to update the
> dummy definition in fs/ext4/xattr.h.
>
> Signed-off-by: Ingo Molnar <[email protected]>
> Acked-by: "Theodore Ts'o" <[email protected]>
> Signed-off-by: Linus Torvalds <[email protected]>
>
> but that's just me.

Ok, this indeed is much nicer to read.

Thanks,

Ingo

2010-10-28 21:39:29

by Junio C Hamano

[permalink] [raw]
Subject: Re: -tip: origin tree build failure

Linus Torvalds <[email protected]> writes:

> Yes. Except for the kernel the default git commit abbreviation is
> borderline too short. Seven hex-chars can easily alias with a few more
> pulls from me: git will not give aliases at the time it gives a
> shorthand, but a month or two later the abbreviated commit may no
> longer be unique.
>
> So I suggest using --abbrev=12 or similar.

Would a new configuration to specify how many more letters to ensure the
uniqueness at the time of generation make sense?

By the way, I noticed that you started sending patches as attachments
lately. What made you change your mind?

Documentation/config.txt | 9 +++++++++
cache.h | 1 +
config.c | 7 +++++++
environment.c | 1 +
sha1_name.c | 4 +++-
5 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index 538ebb5..6994338 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -374,6 +374,15 @@ core.warnAmbiguousRefs::
If true, git will warn you if the ref name you passed it is ambiguous
and might match multiple refs in the .git/refs/ tree. True by default.

+core.abbrevguard::
+ Even though git makes sure that it uses enough hexdigits to show
+ an abbreviated object name unambiguously, as more objects are
+ added to the repository over time, a short name that used to be
+ unique will stop being unique. Git uses this many extra hexdigits
+ that are more than necessary to make the object name currently
+ unique, in the hope that its output will stay unique a bit longer.
+ Defaults to 0.
+
core.compression::
An integer -1..9, indicating a default compression level.
-1 is the zlib default. 0 means no compression,
diff --git a/cache.h b/cache.h
index 33decd9..931fb59 100644
--- a/cache.h
+++ b/cache.h
@@ -545,6 +545,7 @@ extern int assume_unchanged;
extern int prefer_symlink_refs;
extern int log_all_ref_updates;
extern int warn_ambiguous_refs;
+extern int unique_abbrev_extra_length;
extern int shared_repository;
extern const char *apply_default_whitespace;
extern const char *apply_default_ignorewhitespace;
diff --git a/config.c b/config.c
index 4b0a820..1aa72c2 100644
--- a/config.c
+++ b/config.c
@@ -489,6 +489,13 @@ static int git_default_core_config(const char *var, const char *value)
return 0;
}

+ if (!strcmp(var, "core.abbrevguard")) {
+ unique_abbrev_extra_length = git_config_int(var, value);
+ if (unique_abbrev_extra_length < 0)
+ unique_abbrev_extra_length = 0;
+ return 0;
+ }
+
if (!strcmp(var, "core.bare")) {
is_bare_repository_cfg = git_config_bool(var, value);
return 0;
diff --git a/environment.c b/environment.c
index de5581f..92e16b1 100644
--- a/environment.c
+++ b/environment.c
@@ -21,6 +21,7 @@ int prefer_symlink_refs;
int is_bare_repository_cfg = -1; /* unspecified */
int log_all_ref_updates = -1; /* unspecified */
int warn_ambiguous_refs = 1;
+int unique_abbrev_extra_length;
int repository_format_version;
const char *git_commit_encoding;
const char *git_log_output_encoding;
diff --git a/sha1_name.c b/sha1_name.c
index 484081d..4a226ad 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -206,7 +206,9 @@ const char *find_unique_abbrev(const unsigned char *sha1, int len)
if (exists
? !status
: status == SHORT_NAME_NOT_FOUND) {
- hex[len] = 0;
+ int cut_at = len + unique_abbrev_extra_length;
+ cut_at = (cut_at < 40) ? cut_at : 40;
+ hex[cut_at] = 0;
return hex;
}
len++;

2010-10-28 21:55:04

by Linus Torvalds

[permalink] [raw]
Subject: Re: -tip: origin tree build failure

On Thu, Oct 28, 2010 at 2:39 PM, Junio C Hamano <[email protected]> wrote:
>
> By the way, I noticed that you started sending patches as attachments
> lately. ?What made you change your mind?

Nothing. I still hate them. But the tools I use (web interface to
gmail) are broken in this respect. There's no way to include a file,
or specify that an attachement should be inlined. And don't tell me
about IMAP - if I wanted to use IMAP, I'd be living in a padded cell.

I have a deep love/hate relationship with gmail. Many things make it
wonderful, and I'm not regretting the switch (which was initially just
a trial while traveling).

But it has two issues that I absolutely detest:
(a) the idiotic inability to inline attachements and
(b) the android gmail app is a total piece of shit and cannot even do
simple text messages. Crazy.
(there are other small annoyances, but they are smallish in comparison
to the above big honking bugs)

Does anybody know anybody who works on the google mail clients and
could raise these as bugs inside google?

Linus

2010-11-01 16:30:53

by Roman Borisov

[permalink] [raw]
Subject: ext3 patches related to uninitialized memory references

Hello,

Do you have a plans for next patches commitment?

[PATCH 1/2] ext3: Avoid uninitialized memory references with a corrupted
htree directory
http://www.spinics.net/lists/linux-ext4/msg21215.html

[PATCH 2/2] ext3: Use search_dirblock() in ext3_dx_find_entry()
http://www.spinics.net/lists/linux-ext4/msg21216.html

I've found only the same patches for ext4 but not for ext3.

Thanks,
Roman