Message ID | 1314806452-8763-1-git-send-email-tm@tao.ma |
---|---|
State | Rejected, archived |
Headers | show |
On Thu, Sep 01, 2011 at 12:00:52AM +0800, Tao Ma wrote: > From: Tao Ma <boyu.mt@taobao.com> > > For all the callers of dx_probe, frame_in is passed in uninitialized. > So we should set frame->bh to NULL in the beginning of while, not > the end. Otherwise, the first "goto fail2" will try to brelse(frame->bh) > while frame->bh is still invalid. There's a "frame->bh = NULL" statement at the very beginning of dx_probe(). Shouldn't that do the trick? - Ted -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 09/04/2011 09:57 PM, Ted Ts'o wrote: > On Thu, Sep 01, 2011 at 12:00:52AM +0800, Tao Ma wrote: >> From: Tao Ma <boyu.mt@taobao.com> >> >> For all the callers of dx_probe, frame_in is passed in uninitialized. >> So we should set frame->bh to NULL in the beginning of while, not >> the end. Otherwise, the first "goto fail2" will try to brelse(frame->bh) >> while frame->bh is still invalid. > > There's a "frame->bh = NULL" statement at the very beginning of > dx_probe(). Shouldn't that do the trick? Oh, sorry for the false alarm. Thanks Tao -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index b754b77..86c5c69 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -404,6 +404,7 @@ dx_probe(const struct qstr *d_name, struct inode *dir, dxtrace(printk("Look up %x", hash)); while (1) { + frame->bh = NULL; count = dx_get_count(entries); if (!count || count > dx_get_limit(entries)) { ext4_warning(dir->i_sb, @@ -458,7 +459,6 @@ dx_probe(const struct qstr *d_name, struct inode *dir, goto fail2; } frame++; - frame->bh = NULL; } fail2: while (frame >= frame_in) {