[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180712133019.zt65g2uh5jlf2mvp@kili.mountain>
Date: Thu, 12 Jul 2018 16:30:19 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: andreas.dilger@...el.com
Cc: linux-ext4@...r.kernel.org
Subject: [bug report] ext4: xattr-in-inode support
Hello Andreas Dilger,
The patch e50e5129f384: "ext4: xattr-in-inode support" from Jun 21,
2017, leads to the following static checker warning:
fs/ext4/xattr.c:1393 ext4_xattr_inode_write()
warn: 'bh' can also be NULL
fs/ext4/xattr.c
1380 block = 0;
1381 while (wsize < bufsize) {
1382 if (bh != NULL)
1383 brelse(bh);
1384 csize = (bufsize - wsize) > blocksize ? blocksize :
1385 bufsize - wsize;
1386 bh = ext4_getblk(handle, ea_inode, block, 0);
1387 if (IS_ERR(bh))
1388 return PTR_ERR(bh);
1389 ret = ext4_journal_get_write_access(handle, bh);
1390 if (ret)
1391 goto out;
1392
1393 memcpy(bh->b_data, buf, csize);
I don't know the code well enought to say if it's an issue. I really
wish there were comments when functions return a mix of error pointers
and NULL.
1394 set_buffer_uptodate(bh);
1395 ext4_handle_dirty_metadata(handle, ea_inode, bh);
1396
1397 buf += csize;
1398 wsize += csize;
1399 block += 1;
1400 }
regards,
dan carpenter
Powered by blists - more mailing lists