linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org
Subject: Is there any reason for us to use EXT4_MAXQUOTAS_INIT_BLOCKS?
Date: Wed, 15 Apr 2015 11:55:37 -0400	[thread overview]
Message-ID: <20150415155537.GA32494@thunk.org> (raw)

It looks to me like EXT4_MAXQUOTAS_INIT_BLOCKS includes the credits
neede to set up the quota records.  So if we move the call to
dquot_initialize(inode) outside of the normal transaction (which we
should probably do in all cases), that means that we shouldn't ever
need to use EXT4_MAX_QUOTAS_INIT_BLOCKS.  Is that right?

The reason why I ask is the following is a easy way to trigger a file
system problem:

mke2fs -Fq -t ext4 -b 4096 /dev/vdc 50M
mount -t ext4 -o usrquota,grpquota /dev/vdc
l8=12345678
l16=$l8$l8
l32=$l16$l16
l64=$l32$l32
dmesg -n 7
ln -s $l64 /vdc/link

This will result in:

[    5.229165] JBD2: ln wants too many credits (156 > 128)
[    5.230194] EXT4-fs error (device vdc) in __ext4_new_inode:843: error 28

In other places where we are allocating a new inode (such as mknod),
we're doing the following:

	credits = EXT4_DATA_TRANS_BLOCKS(dir->i_sb) +
			EXT4_INDEX_EXTRA_TRANS_BLOCKS + 3;

Which is 37 blocks, and I suspect that's still too darned much.  But
if we don't need to use EXT4_MAXQUOTAS_INIT_BLOCKS in ext4_mknod(), we
shouldn't be needing it in ext4_symlink(), either.

Am I missing anything?

Thanks,

					- Ted

             reply	other threads:[~2015-04-15 15:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-15 15:55 Theodore Ts'o [this message]
2015-04-15 20:47 ` Is there any reason for us to use EXT4_MAXQUOTAS_INIT_BLOCKS? Jan Kara
2015-04-15 23:27   ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150415155537.GA32494@thunk.org \
    --to=tytso@mit.edu \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).