All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: Fix quota file corruption
Date: Wed, 19 Feb 2014 22:18:40 +0100	[thread overview]
Message-ID: <20140219211840.GA20335@quack.suse.cz> (raw)
In-Reply-To: <CALoaWF7+dBMxJmTMm2w46uZnDVJBfZt+AbVN817s2SFsQMx76w@mail.gmail.com>

  Hello,

On Wed 19-02-14 17:56:35, Marty Sweet wrote:
> What errors do you see regarding corrupted quotas, something like below?
> kernel: [119890.305935] __quota_error: 3 callbacks suppressed
> kernel: [119890.305941] Quota error (device dm-8): find_free_dqentry:
> Data block full but it shouldn't
> kernel: [119890.306071] Quota error (device dm-8): qtree_write_dquot:
> Error -5 occurred while creating quota
> kernel: [119890.306203] (smbd,25964,2):ocfs2_acquire_dquot:817 ERROR:
> status = -5
  Yes, exactly that. I have a simple reproducer and I'm debugging the
issue so I should find the culprit soon.

								Honza
> On Wed, Feb 19, 2014 at 2:48 PM, Jan Kara <jack@suse.cz> wrote:
> > On Wed 19-02-14 14:11:02, Jan Kara wrote:
> >> Global quota files are accessed from different nodes and reading and
> >> writing of these files happens via block device page cache. Thus even
> >> though the access between nodes is properly serialized by quota file's
> >> inode lock we cannot rely on consistency of block device page cache
> >> between nodes. Indeed currently it is possible to corrupt quota files by
> >> creating and deleting quota structures from two nodes in parallel. Fix
> >> the problem by using OCFS2_BH_IGNORE_CACHE mount option when reading
> >> from quota file.
> >>
> >> CC: Goldwyn Rodrigues <rgoldwyn@suse.de>
> >> CC: Mark Fasheh <mfasheh@suse.de>
> >> Signed-off-by: Jan Kara <jack@suse.cz>
> >> ---
> >>  fs/ocfs2/quota_global.c | 3 ++-
> >>  1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >>   This is a quick fix for quota file corruption I have found during my testing
> >> (to be used for 3.13 and -stable kernels). Longer term we likely want to do
> >> something more clever. Ideally we would invalidate relevant blocks from buffer
> >> cache when node releases quota file's inode lock (similarly as we do it for
> >> page cache). I wanted to do it similarly as for e.g. extent tree blocks but
> >> I failed to find how consistency of those between nodes is achieved. Can
> >> anyone point me in the right direction? Thanks in advance.
> >   Hum, so this likely isn't the whole story because I can still see the
> > corruption. At least I've now found the metadata cache and basically
> > understand how it works so I'm now reading code around that and trying to
> > understand what screws up quota code...
> >
> >                                                                 Honza
> >
> >>
> >> diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c
> >> index aaa50611ec66..f1f0cca15db6 100644
> >> --- a/fs/ocfs2/quota_global.c
> >> +++ b/fs/ocfs2/quota_global.c
> >> @@ -151,7 +151,8 @@ int ocfs2_read_quota_phys_block(struct inode *inode, u64 p_block,
> >>       int rc;
> >>
> >>       *bhp = NULL;
> >> -     rc = ocfs2_read_blocks(INODE_CACHE(inode), p_block, 1, bhp, 0,
> >> +     rc = ocfs2_read_blocks(INODE_CACHE(inode), p_block, 1, bhp,
> >> +                            OCFS2_BH_IGNORE_CACHE,
> >>                              ocfs2_validate_quota_block);
> >>       if (rc)
> >>               mlog_errno(rc);
> >> --
> >> 1.8.1.4
> >>
> > --
> > Jan Kara <jack@suse.cz>
> > SUSE Labs, CR
> >
> > _______________________________________________
> > Ocfs2-devel mailing list
> > Ocfs2-devel at oss.oracle.com
> > https://oss.oracle.com/mailman/listinfo/ocfs2-devel
> 
> 
> 
> -- 
> Marty
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2014-02-19 21:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-19 13:11 [Ocfs2-devel] [PATCH] ocfs2: Fix quota file corruption Jan Kara
2014-02-19 14:48 ` Jan Kara
2014-02-19 17:56   ` Marty Sweet
2014-02-19 21:18     ` Jan Kara [this message]
2014-02-20 11:39 Jan Kara
2014-02-24 22:28 ` Mark Fasheh
2014-10-10 14:23 [PATCH 0/2 v2] Fix data corruption when blocksize < pagesize for mmapped data Jan Kara
2014-10-10 14:23 ` [Ocfs2-devel] [PATCH] ocfs2: Fix quota file corruption Jan Kara

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=20140219211840.GA20335@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=ocfs2-devel@oss.oracle.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.