<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/quotaops.h, branch v4.9.243</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.243</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.243'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2019-12-21T09:42:08Z</updated>
<entry>
<title>quota: Check that quota is not dirty before release</title>
<updated>2019-12-21T09:42:08Z</updated>
<author>
<name>Dmitry Monakhov</name>
<email>dmtrmonakhov@yandex-team.ru</email>
</author>
<published>2019-10-31T10:39:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=072d24ef6cb1f309f6c45c71e5b0f04a2e9d48a6'/>
<id>urn:sha1:072d24ef6cb1f309f6c45c71e5b0f04a2e9d48a6</id>
<content type='text'>
commit df4bb5d128e2c44848aeb36b7ceceba3ac85080d upstream.

There is a race window where quota was redirted once we drop dq_list_lock inside dqput(),
but before we grab dquot-&gt;dq_lock inside dquot_release()

TASK1                                                       TASK2 (chowner)
-&gt;dqput()
  we_slept:
    spin_lock(&amp;dq_list_lock)
    if (dquot_dirty(dquot)) {
          spin_unlock(&amp;dq_list_lock);
          dquot-&gt;dq_sb-&gt;dq_op-&gt;write_dquot(dquot);
          goto we_slept
    if (test_bit(DQ_ACTIVE_B, &amp;dquot-&gt;dq_flags)) {
          spin_unlock(&amp;dq_list_lock);
          dquot-&gt;dq_sb-&gt;dq_op-&gt;release_dquot(dquot);
                                                            dqget()
							    mark_dquot_dirty()
							    dqput()
          goto we_slept;
        }
So dquot dirty quota will be released by TASK1, but on next we_sleept loop
we detect this and call -&gt;write_dquot() for it.
XFSTEST: https://github.com/dmonakhov/xfstests/commit/440a80d4cbb39e9234df4d7240aee1d551c36107

Link: https://lore.kernel.org/r/20191031103920.3919-2-dmonakhov@openvz.org
CC: stable@vger.kernel.org
Signed-off-by: Dmitry Monakhov &lt;dmtrmonakhov@yandex-team.ru&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>quota: fix wrong condition in is_quota_modification()</title>
<updated>2019-10-05T10:30:36Z</updated>
<author>
<name>Chao Yu</name>
<email>yuchao0@huawei.com</email>
</author>
<published>2019-09-11T09:36:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1fcdaaaa2f0e8829512c9ba2d6cf53c59c603f8c'/>
<id>urn:sha1:1fcdaaaa2f0e8829512c9ba2d6cf53c59c603f8c</id>
<content type='text'>
commit 6565c182094f69e4ffdece337d395eb7ec760efc upstream.

Quoted from
commit 3da40c7b0898 ("ext4: only call ext4_truncate when size &lt;= isize")

" At LSF we decided that if we truncate up from isize we shouldn't trim
  fallocated blocks that were fallocated with KEEP_SIZE and are past the
 new i_size.  This patch fixes ext4 to do this. "

And generic/092 of fstest have covered this case for long time, however
is_quota_modification() didn't adjust based on that rule, so that in
below condition, we will lose to quota block change:
- fallocate blocks beyond EOF
- remount
- truncate(file_path, file_size)

Fix it.

Link: https://lore.kernel.org/r/20190911093650.35329-1-yuchao0@huawei.com
Fixes: 3da40c7b0898 ("ext4: only call ext4_truncate when size &lt;= isize")
CC: stable@vger.kernel.org
Signed-off-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>quota: Add support for -&gt;get_nextdqblk() for VFS quota</title>
<updated>2016-02-09T12:05:23Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2016-01-25T18:24:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=be6257b251cebd2deb8c76d43e387e28e3f7412d'/>
<id>urn:sha1:be6257b251cebd2deb8c76d43e387e28e3f7412d</id>
<content type='text'>
Add infrastructure for supporting get_nextdqblk() callback for VFS
quotas. Translate the operation into a callback to appropriate
filesystem and consequently to quota format callback.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>quota: Propagate error from -&gt;acquire_dquot()</title>
<updated>2015-07-23T18:59:10Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2015-06-24T16:07:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6184fc0b8dd76c6aedc7a26e93254993e14e52de'/>
<id>urn:sha1:6184fc0b8dd76c6aedc7a26e93254993e14e52de</id>
<content type='text'>
Currently when some error happened in -&gt;acquire_dquot(), dqget() just
returned NULL. That was indistinguishable from a case when e.g. someone
run quotaoff and so was generally silently ignored. However
-&gt;acquire_dquot() can fail because of ENOSPC or EIO in which case user
should better know. So propagate error up from -&gt;acquire_dquot properly.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>Merge branch 'quota_interface' into for_next_testing</title>
<updated>2015-03-16T09:26:41Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2015-03-16T09:26:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7dca0548a21e5efa445b68a73554ef863e09c623'/>
<id>urn:sha1:7dca0548a21e5efa445b68a73554ef863e09c623</id>
<content type='text'>
</content>
</entry>
<entry>
<title>quota: reorder flags in quota state</title>
<updated>2015-03-04T15:42:46Z</updated>
<author>
<name>Konstantin Khlebnikov</name>
<email>khlebnikov@yandex-team.ru</email>
</author>
<published>2015-02-12T16:08:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=781970240a56d1c15a9b8ee37d28987b8182f060'/>
<id>urn:sha1:781970240a56d1c15a9b8ee37d28987b8182f060</id>
<content type='text'>
Flags in struct quota_state keep flags for each quota type and
some common flags. This patch reorders typed flags:

Before:

0 USRQUOTA DQUOT_USAGE_ENABLED
1 USRQUOTA DQUOT_LIMITS_ENABLED
2 USRQUOTA DQUOT_SUSPENDED
3 GRPQUOTA DQUOT_USAGE_ENABLED
4 GRPQUOTA DQUOT_LIMITS_ENABLED
5 GRPQUOTA DQUOT_SUSPENDED
6          DQUOT_QUOTA_SYS_FILE
7          DQUOT_NEGATIVE_USAGE

After:

0 USRQUOTA DQUOT_USAGE_ENABLED
1 GRPQUOTA DQUOT_USAGE_ENABLED
2 USRQUOTA DQUOT_LIMITS_ENABLED
3 GRPQUOTA DQUOT_LIMITS_ENABLED
4 USRQUOTA DQUOT_SUSPENDED
5 GRPQUOTA DQUOT_SUSPENDED
6          DQUOT_QUOTA_SYS_FILE
7          DQUOT_NEGATIVE_USAGE

Now we can get bitmap of all enabled/suspended quota types without loop.
For example suspended: (flags / DQUOT_SUSPENDED) &amp; ((1 &lt;&lt; MAXQUOTAS) - 1).

add/remove: 0/1 grow/shrink: 3/11 up/down: 56/-215 (-159)
function                                     old     new   delta
__dquot_initialize                           423     447     +24
dquot_transfer                               181     197     +16
dquot_alloc_inode                            286     302     +16
dquot_reclaim_space_nodirty                  316     313      -3
dquot_claim_space_nodirty                    314     311      -3
dquot_resume                                 286     281      -5
dquot_free_inode                             332     324      -8
__dquot_alloc_space                          500     492      -8
dquot_disable                               1944    1929     -15
dquot_quota_enable                           252     236     -16
__dquot_free_space                           750     734     -16
dquot_writeback_dquots                       625     608     -17
__dquot_transfer                            1186    1154     -32
dquot_quota_sync                             299     261     -38
dquot_active.isra                             54       -     -54

Signed-off-by: Konstantin Khlebnikov &lt;khlebnikov@yandex-team.ru&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>quota: Make -&gt;set_info use structure with neccesary info to VFS and XFS</title>
<updated>2015-03-04T15:06:38Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2014-12-16T11:03:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5eacb2ac029161d94969a511e0adf7dca28cda1f'/>
<id>urn:sha1:5eacb2ac029161d94969a511e0adf7dca28cda1f</id>
<content type='text'>
Change -&gt;set_info to take new qc_info structure which contains all the
necessary information both for XFS and VFS. Convert Q_SETINFO handler
to use this structure.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>quota: Make VFS quotas use new interface for getting quota info</title>
<updated>2015-03-04T15:06:34Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2014-11-18T23:42:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0a240339a8deeb13a19043389bba4285a6c0592e'/>
<id>urn:sha1:0a240339a8deeb13a19043389bba4285a6c0592e</id>
<content type='text'>
Create new internal interface for getting information about quota which
contains everything needed for both VFS quotas and XFS quotas. Make VFS
use this and hook it up to Q_GETINFO.

Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>quota: Add -&gt;quota_{enable,disable} callbacks for VFS quotas</title>
<updated>2015-01-30T11:50:32Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2014-10-06T16:40:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3e2af67e66ff025796af1a8a1fcbb4236304f90c'/>
<id>urn:sha1:3e2af67e66ff025796af1a8a1fcbb4236304f90c</id>
<content type='text'>
Add functions which translate -&gt;quota_enable / -&gt;quota_disable calls
into appropriate changes in VFS quota. This will enable filesystems
supporting VFS quota files in system inodes to be controlled via
Q_XQUOTA[ON|OFF] quotactls for better userspace compatibility.

Also provide a vector for quotactl using these functions which can be
used by filesystems with quota files stored in hidden system files.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
<entry>
<title>quota: Wire up -&gt;quota_{enable,disable} callbacks into Q_QUOTA{ON,OFF}</title>
<updated>2015-01-30T11:50:16Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2014-10-08T14:07:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d3b863248577504f6eecca2a464d6ddf86b71584'/>
<id>urn:sha1:d3b863248577504f6eecca2a464d6ddf86b71584</id>
<content type='text'>
Make Q_QUOTAON / Q_QUOTAOFF quotactl call -&gt;quota_enable /
-&gt;quota_disable callback when provided. To match current behavior of
ocfs2 &amp; ext4 we make these quotactls turn on / off quota enforcement for
appropriate quota type.

Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
</content>
</entry>
</feed>
