From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Thu, 26 Mar 2020 13:35:59 -0500 Subject: [Cluster-devel] [GFS2 PATCH 0/4 v5] Clean up and fix quota data allocate and free Message-ID: <20200326183603.123323-1-rpeterso@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit This patch set cleans up a recently discovered race between file close and chown. The problem was that file close would free the quota data structures attached to the in-core inode, but chown relied on them to exist. So if the timing of the close is wrong, the chown can result in kernel panic. The problem is easily recreated with this: On terminal session 1: while true; do chown test /mnt/gfs2/test; chown root /mnt/gfs2/test; done On terminal session 2: while true; do echo "a" > /mnt/gfs2/test; echo "b" > /mnt/gfs2/test;done This is version 5, which implements more of Andreas's suggestions and fixes up a bug or two, plus some patches written by Andreas. Andreas Gruenbacher (2): gfs2: Split gfs2_rsqa_delete into gfs2_rs_delete and gfs2_qa_put gfs2: Remove unnecessary gfs2_qa_{get,put} pairs Bob Peterson (2): gfs2: eliminate gfs2_rsqa_alloc in favor of gfs2_qa_alloc gfs2: Change inode qa_data to allow multiple users fs/gfs2/acl.c | 7 ++++-- fs/gfs2/bmap.c | 5 ++-- fs/gfs2/file.c | 43 +++++++++++++-------------------- fs/gfs2/incore.h | 1 + fs/gfs2/inode.c | 35 ++++++++++++++++----------- fs/gfs2/quota.c | 63 +++++++++++++++++++++++++++++------------------- fs/gfs2/quota.h | 4 +-- fs/gfs2/rgrp.c | 15 ++---------- fs/gfs2/rgrp.h | 3 +-- fs/gfs2/super.c | 5 +++- fs/gfs2/xattr.c | 12 ++++++--- 11 files changed, 102 insertions(+), 91 deletions(-) -- 2.25.1