Showing error 1869

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: fs/gfs2/lops.c
Line in file: 521
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-11 08:47:26 UTC


Source:

491 *    and a flag which says whether the data block needs escaping or
492 *    not. This means we need a new log entry for each 251 or so data
493 *    blocks, which isn't an enormous overhead but twice as much as
494 *    for normal metadata blocks.
495 */
496static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le)
497{
498        struct gfs2_bufdata *bd = container_of(le, struct gfs2_bufdata, bd_le);
499        struct gfs2_trans *tr = current->journal_info;
500        struct address_space *mapping = bd->bd_bh->b_page->mapping;
501        struct gfs2_inode *ip = GFS2_I(mapping->host);
502
503        lock_buffer(bd->bd_bh);
504        gfs2_log_lock(sdp);
505        if (tr) {
506                if (!list_empty(&bd->bd_list_tr))
507                        goto out;
508                tr->tr_touched = 1;
509                if (gfs2_is_jdata(ip)) {
510                        tr->tr_num_buf++;
511                        list_add(&bd->bd_list_tr, &tr->tr_list_buf);
512                }
513        }
514        if (!list_empty(&le->le_list))
515                goto out;
516
517        set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags);
518        set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags);
519        if (gfs2_is_jdata(ip)) {
520                gfs2_pin(sdp, bd->bd_bh);
521                tr->tr_num_databuf_new++;
522                sdp->sd_log_num_databuf++;
523                list_add(&le->le_list, &sdp->sd_log_le_databuf);
524        } else {
525                list_add(&le->le_list, &sdp->sd_log_le_ordered);
526        }
527out:
528        gfs2_log_unlock(sdp);
529        unlock_buffer(bd->bd_bh);
530}
531
Show full sources