Skip to content

Commit 592fe89

Browse files
committed
Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull ext4 regression fixes from Ted Ts'o: "This fixes a scalability problem reported by Andi Kleen and Tim Chen; they were quite secretive about the precise nature of their workload, but they later admitted that it only showed up when they were using a large sparse file, so the amount of data I/O that was needed was close to zero. I'm not sure how realistic this is and it's only a regression if you consider changes made since 2.6.39 to be a "regression" vis-a-vis the policy regarding post-merge window bug fixes, but Linus agreed it was worth fixing, so I'm including it in this pull request. This also fixes the journalled quota mount options, which I accidentally broke while I was cleaning up the mount option handling." * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext4: fix handling of journalled quota options ext4: address scalability issue by removing extent cache statistics
2 parents d44c6d4 + 57f73c2 commit 592fe89

File tree

3 files changed

+15
-40
lines changed

3 files changed

+15
-40
lines changed

fs/ext4/ext4.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,9 +1203,6 @@ struct ext4_sb_info {
12031203
unsigned long s_ext_blocks;
12041204
unsigned long s_ext_extents;
12051205
#endif
1206-
/* ext4 extent cache stats */
1207-
unsigned long extent_cache_hits;
1208-
unsigned long extent_cache_misses;
12091206

12101207
/* for buddy allocator */
12111208
struct ext4_group_info ***s_group_info;

fs/ext4/extents.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2066,10 +2066,6 @@ static int ext4_ext_check_cache(struct inode *inode, ext4_lblk_t block,
20662066
ret = 1;
20672067
}
20682068
errout:
2069-
if (!ret)
2070-
sbi->extent_cache_misses++;
2071-
else
2072-
sbi->extent_cache_hits++;
20732069
trace_ext4_ext_in_cache(inode, block, ret);
20742070
spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);
20752071
return ret;

fs/ext4/super.c

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,28 +1305,28 @@ static int set_qf_name(struct super_block *sb, int qtype, substring_t *args)
13051305
ext4_msg(sb, KERN_ERR,
13061306
"Cannot change journaled "
13071307
"quota options when quota turned on");
1308-
return 0;
1308+
return -1;
13091309
}
13101310
qname = match_strdup(args);
13111311
if (!qname) {
13121312
ext4_msg(sb, KERN_ERR,
13131313
"Not enough memory for storing quotafile name");
1314-
return 0;
1314+
return -1;
13151315
}
13161316
if (sbi->s_qf_names[qtype] &&
13171317
strcmp(sbi->s_qf_names[qtype], qname)) {
13181318
ext4_msg(sb, KERN_ERR,
13191319
"%s quota file already specified", QTYPE2NAME(qtype));
13201320
kfree(qname);
1321-
return 0;
1321+
return -1;
13221322
}
13231323
sbi->s_qf_names[qtype] = qname;
13241324
if (strchr(sbi->s_qf_names[qtype], '/')) {
13251325
ext4_msg(sb, KERN_ERR,
13261326
"quotafile must be on filesystem root");
13271327
kfree(sbi->s_qf_names[qtype]);
13281328
sbi->s_qf_names[qtype] = NULL;
1329-
return 0;
1329+
return -1;
13301330
}
13311331
set_opt(sb, QUOTA);
13321332
return 1;
@@ -1341,7 +1341,7 @@ static int clear_qf_name(struct super_block *sb, int qtype)
13411341
sbi->s_qf_names[qtype]) {
13421342
ext4_msg(sb, KERN_ERR, "Cannot change journaled quota options"
13431343
" when quota turned on");
1344-
return 0;
1344+
return -1;
13451345
}
13461346
/*
13471347
* The space will be released later when all options are confirmed
@@ -1450,6 +1450,16 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token,
14501450
const struct mount_opts *m;
14511451
int arg = 0;
14521452

1453+
#ifdef CONFIG_QUOTA
1454+
if (token == Opt_usrjquota)
1455+
return set_qf_name(sb, USRQUOTA, &args[0]);
1456+
else if (token == Opt_grpjquota)
1457+
return set_qf_name(sb, GRPQUOTA, &args[0]);
1458+
else if (token == Opt_offusrjquota)
1459+
return clear_qf_name(sb, USRQUOTA);
1460+
else if (token == Opt_offgrpjquota)
1461+
return clear_qf_name(sb, GRPQUOTA);
1462+
#endif
14531463
if (args->from && match_int(args, &arg))
14541464
return -1;
14551465
switch (token) {
@@ -1549,18 +1559,6 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token,
15491559
sbi->s_mount_opt |= m->mount_opt;
15501560
}
15511561
#ifdef CONFIG_QUOTA
1552-
} else if (token == Opt_usrjquota) {
1553-
if (!set_qf_name(sb, USRQUOTA, &args[0]))
1554-
return -1;
1555-
} else if (token == Opt_grpjquota) {
1556-
if (!set_qf_name(sb, GRPQUOTA, &args[0]))
1557-
return -1;
1558-
} else if (token == Opt_offusrjquota) {
1559-
if (!clear_qf_name(sb, USRQUOTA))
1560-
return -1;
1561-
} else if (token == Opt_offgrpjquota) {
1562-
if (!clear_qf_name(sb, GRPQUOTA))
1563-
return -1;
15641562
} else if (m->flags & MOPT_QFMT) {
15651563
if (sb_any_quota_loaded(sb) &&
15661564
sbi->s_jquota_fmt != m->mount_opt) {
@@ -2366,18 +2364,6 @@ static ssize_t lifetime_write_kbytes_show(struct ext4_attr *a,
23662364
EXT4_SB(sb)->s_sectors_written_start) >> 1)));
23672365
}
23682366

2369-
static ssize_t extent_cache_hits_show(struct ext4_attr *a,
2370-
struct ext4_sb_info *sbi, char *buf)
2371-
{
2372-
return snprintf(buf, PAGE_SIZE, "%lu\n", sbi->extent_cache_hits);
2373-
}
2374-
2375-
static ssize_t extent_cache_misses_show(struct ext4_attr *a,
2376-
struct ext4_sb_info *sbi, char *buf)
2377-
{
2378-
return snprintf(buf, PAGE_SIZE, "%lu\n", sbi->extent_cache_misses);
2379-
}
2380-
23812367
static ssize_t inode_readahead_blks_store(struct ext4_attr *a,
23822368
struct ext4_sb_info *sbi,
23832369
const char *buf, size_t count)
@@ -2435,8 +2421,6 @@ static struct ext4_attr ext4_attr_##name = __ATTR(name, mode, show, store)
24352421
EXT4_RO_ATTR(delayed_allocation_blocks);
24362422
EXT4_RO_ATTR(session_write_kbytes);
24372423
EXT4_RO_ATTR(lifetime_write_kbytes);
2438-
EXT4_RO_ATTR(extent_cache_hits);
2439-
EXT4_RO_ATTR(extent_cache_misses);
24402424
EXT4_ATTR_OFFSET(inode_readahead_blks, 0644, sbi_ui_show,
24412425
inode_readahead_blks_store, s_inode_readahead_blks);
24422426
EXT4_RW_ATTR_SBI_UI(inode_goal, s_inode_goal);
@@ -2452,8 +2436,6 @@ static struct attribute *ext4_attrs[] = {
24522436
ATTR_LIST(delayed_allocation_blocks),
24532437
ATTR_LIST(session_write_kbytes),
24542438
ATTR_LIST(lifetime_write_kbytes),
2455-
ATTR_LIST(extent_cache_hits),
2456-
ATTR_LIST(extent_cache_misses),
24572439
ATTR_LIST(inode_readahead_blks),
24582440
ATTR_LIST(inode_goal),
24592441
ATTR_LIST(mb_stats),

0 commit comments

Comments
 (0)