From: Joel Becker <Joel.Becker@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 1/1] OCFS2: anti stale inode for nfs (V4)
Date: Tue, 24 Feb 2009 18:10:37 -0800 [thread overview]
Message-ID: <20090225021037.GC5209@mail.oracle.com> (raw)
In-Reply-To: <200902200924.n1K9Oqp1029041@rgminet15.oracle.com>
On Fri, Feb 20, 2009 at 05:23:50PM +0800, wengang wang wrote:
> changes from v3:
> 1, move codes that checks inode allocation bit to subfunction
> ocfs2_test_inode_bit().
>
> 2, release the suballoc lock just after we get it. we should release it asap
> and doing so doesn't affect functionility.
>
> 3, add inode alloc slot validation.
One last thing, sorry I missed it.
> +static int ocfs2_test_suballoc_bit(struct ocfs2_super *osb, struct inode *suballoc,
> + struct buffer_head *alloc_bh, u64 blkno, u16 bit,
> + int *res)
> +{
> + struct ocfs2_dinode *alloc_fe;
> + struct ocfs2_group_desc *group;
> + struct buffer_head *group_bh = NULL;
> + u64 bg_blkno;
> + int status;
> +
> + mlog_entry("blkno: %llu bit: %u\n", blkno, (unsigned int)bit);
> +
> + alloc_fe = (struct ocfs2_dinode *)alloc_bh->b_data;
> + BUG_ON((bit + 1) > ocfs2_bits_per_group(&alloc_fe->id2.i_chain));
> +
> + bg_blkno = ocfs2_which_suballoc_group(blkno, bit);
> + status = ocfs2_read_blocks_sync(osb, bg_blkno, 1, &group_bh);
> + if (status < 0)
> + goto bail;
> +
> + status = ocfs2_check_group_descriptor(osb->sb, alloc_fe, group_bh);
> + if (status < 0)
> + goto bail;
Just use ocfs2_read_group_descriptor() here. The locking code
will make sure it reads from disk if necessary.
Joel
--
One look at the From:
understanding has blossomed
.procmailrc grows
- Alexander Viro
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
next prev parent reply other threads:[~2009-02-25 2:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-20 9:23 [Ocfs2-devel] [PATCH 1/1] OCFS2: anti stale inode for nfs (V4) wengang wang
2009-02-25 2:08 ` Joel Becker
2009-02-25 3:44 ` Wengang Wang
2009-02-25 11:27 ` Joel Becker
2009-02-25 13:57 ` Wengang Wang
2009-02-25 16:58 ` Joel Becker
2009-02-27 6:48 ` Wengang Wang
2009-02-25 2:10 ` Joel Becker [this message]
2009-02-25 2:36 ` Tao Ma
2009-02-25 3:46 ` Wengang Wang
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=20090225021037.GC5209@mail.oracle.com \
--to=joel.becker@oracle.com \
--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.