From: Joel Becker <Joel.Becker@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 1/2] ocfs2: return EROFS instead of BUG in ocfs2_insert_at_leaf.
Date: Fri, 12 Jun 2009 14:42:52 -0700 [thread overview]
Message-ID: <20090612214252.GE22662@mail.oracle.com> (raw)
In-Reply-To: <1244787516-13475-1-git-send-email-tao.ma@oracle.com>
On Fri, Jun 12, 2009 at 02:18:35PM +0800, Tao Ma wrote:
> As Mark's suggestion, change BUG to EROFS in ocfs2_insert_at_leaf.
>
> Signed-off-by: Tao Ma <tao.ma@oracle.com>
I see that Mark is rethinking this, and I'll wait on that. But
I do have one comment.
> @@ -3703,23 +3703,28 @@ static void ocfs2_insert_at_leaf(struct ocfs2_extent_rec *insert_rec,
> + le16_to_cpu(rec->e_leaf_clusters);
> BUG_ON(le32_to_cpu(insert_rec->e_cpos) < range);
>
> - mlog_bug_on_msg(le16_to_cpu(el->l_next_free_rec) >=
> - le16_to_cpu(el->l_count),
> - "inode %lu, depth %u, count %u, next free %u, "
> - "rec.cpos %u, rec.clusters %u, "
> - "insert.cpos %u, insert.clusters %u\n",
> - inode->i_ino,
> - le16_to_cpu(el->l_tree_depth),
> - le16_to_cpu(el->l_count),
> - le16_to_cpu(el->l_next_free_rec),
> - le32_to_cpu(el->l_recs[i].e_cpos),
> - le16_to_cpu(el->l_recs[i].e_leaf_clusters),
> - le32_to_cpu(insert_rec->e_cpos),
> - le16_to_cpu(insert_rec->e_leaf_clusters));
> + if (le16_to_cpu(el->l_next_free_rec) >=
> + le16_to_cpu(el->l_count)) {
> + mlog(ML_ERROR, "l_next_free_rec > l_count, "
> + "inode %lu, depth %u, count %u, next free %u, "
> + "rec.cpos %u, rec.clusters %u, "
> + "insert.cpos %u, insert.clusters %u\n",
> + inode->i_ino,
> + le16_to_cpu(el->l_tree_depth),
> + le16_to_cpu(el->l_count),
> + le16_to_cpu(el->l_next_free_rec),
> + le32_to_cpu(el->l_recs[i].e_cpos),
> + le16_to_cpu(el->l_recs[i].e_leaf_clusters),
> + le32_to_cpu(insert_rec->e_cpos),
> + le16_to_cpu(insert_rec->e_leaf_clusters));
> + ret = -EROFS;
> + goto out;
> + }
Shouldn't this be ocfs2_error() instead of ML_ERROR? If we're
returning EROFS, we should actually be setting the fs readonly.
Joel
--
"I'm living so far beyond my income that we may almost be said
to be living apart."
- e e cummings
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
next prev parent reply other threads:[~2009-06-12 21:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-12 15:03 [Ocfs2-devel] [PATCH 0/2] ocfs2: Adjust rightmost path in ocfs2_add_branch.v2 Tao Ma
2009-06-12 6:18 ` [Ocfs2-devel] [PATCH 1/2] ocfs2: return EROFS instead of BUG in ocfs2_insert_at_leaf Tao Ma
2009-06-12 21:42 ` Joel Becker [this message]
2009-06-12 6:18 ` [Ocfs2-devel] [PATCH 2/2] ocfs2: Adjust rightmost path in ocfs2_add_branch Tao Ma
2009-06-12 16:13 ` Mark Fasheh
2009-06-12 21:56 ` Joel Becker
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=20090612214252.GE22662@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.