All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Borisov <ext-roman.borisov@nokia.com>
To: linux-mtd@lists.infradead.org
Subject: question about jffs2: jffs2_scan_dirty_space() return value
Date: Fri, 15 Oct 2010 15:59:40 +0400	[thread overview]
Message-ID: <4CB8422C.7000409@nokia.com> (raw)

hello,

The question was born when I discovered that in fs/jffs2/scan.c 
jffs2_scan_medium() a return value from fs/jffs2/nodelist.c 
jffs2_scan_dirty_space() is not checked;
However return value from jffs2_scan_dirty_space() is checked anywhere else.
jffs2_scan_dirty_space() investigation showed that it can't return 
anything except 0;

The question is: should the jffs2_scan_dirty_space() be changed to 
return some error instead BUG() macro for example?
<code>
     if (unlikely(size > jeb->free_size)) {
         printk(KERN_CRIT "Dirty space 0x%x larger then free_size 0x%x 
(wasted 0x%x)\n",
                size, jeb->free_size, jeb->wasted_size);
-        BUG();
+    return some_error;
     }
</code>
In this case we also should update jffs2_scan_medium() to check the 
error code.

Thanks,
Roman

                 reply	other threads:[~2010-10-15 11:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4CB8422C.7000409@nokia.com \
    --to=ext-roman.borisov@nokia.com \
    --cc=linux-mtd@lists.infradead.org \
    /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.