Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit adfefb55 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes:
  [GFS2] gfs2_dir_read_data(): fix uninitialized variable usage
  [GFS2] fs/gfs2/ops_fstype.c:fill_super_meta(): fix NULL dereference
  [GFS2] fs/gfs2/dir.c:gfs2_dir_write_data(): don't use an uninitialized variable
  [GFS2] fs/gfs2/ops_fstype.c:gfs2_get_sb_meta(): remove unused variable
  [GFS2] fs/gfs2/dir.c:gfs2_dir_write_data(): remove dead code
  [GFS2] gfs2 endianness bug: be16 assigned to be32 field
  [GFS2] Fix bmap to map extents properly
  [DLM] fix iovec length in recvmsg
parents d2c5f06e b7d8ac3e
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -519,6 +519,7 @@ static int receive_from_sock(void)
	msg.msg_flags = 0;
	msg.msg_flags = 0;
	msg.msg_control = incmsg;
	msg.msg_control = incmsg;
	msg.msg_controllen = sizeof(incmsg);
	msg.msg_controllen = sizeof(incmsg);
	msg.msg_iovlen = 1;


	/* I don't see why this circular buffer stuff is necessary for SCTP
	/* I don't see why this circular buffer stuff is necessary for SCTP
	 * which is a packet-based protocol, but the whole thing breaks under
	 * which is a packet-based protocol, but the whole thing breaks under
+7 −6
Original line number Original line Diff line number Diff line
@@ -434,8 +434,7 @@ static int lookup_block(struct gfs2_inode *ip, struct buffer_head *bh,
 */
 */


static int gfs2_block_pointers(struct inode *inode, u64 lblock, int create,
static int gfs2_block_pointers(struct inode *inode, u64 lblock, int create,
			       struct buffer_head *bh_map, struct metapath *mp,
			       struct buffer_head *bh_map, struct metapath *mp)
			       unsigned int maxlen)
{
{
	struct gfs2_inode *ip = GFS2_I(inode);
	struct gfs2_inode *ip = GFS2_I(inode);
	struct gfs2_sbd *sdp = GFS2_SB(inode);
	struct gfs2_sbd *sdp = GFS2_SB(inode);
@@ -448,6 +447,7 @@ static int gfs2_block_pointers(struct inode *inode, u64 lblock, int create,
	int new = 0;
	int new = 0;
	u64 dblock = 0;
	u64 dblock = 0;
	int boundary;
	int boundary;
	unsigned int maxlen = bh_map->b_size >> inode->i_blkbits;


	BUG_ON(maxlen == 0);
	BUG_ON(maxlen == 0);


@@ -541,13 +541,13 @@ static inline void bmap_unlock(struct inode *inode, int create)
}
}


int gfs2_block_map(struct inode *inode, u64 lblock, int create,
int gfs2_block_map(struct inode *inode, u64 lblock, int create,
		   struct buffer_head *bh, unsigned int maxlen)
		   struct buffer_head *bh)
{
{
	struct metapath mp;
	struct metapath mp;
	int ret;
	int ret;


	bmap_lock(inode, create);
	bmap_lock(inode, create);
	ret = gfs2_block_pointers(inode, lblock, create, bh, &mp, maxlen);
	ret = gfs2_block_pointers(inode, lblock, create, bh, &mp);
	bmap_unlock(inode, create);
	bmap_unlock(inode, create);
	return ret;
	return ret;
}
}
@@ -555,7 +555,7 @@ int gfs2_block_map(struct inode *inode, u64 lblock, int create,
int gfs2_extent_map(struct inode *inode, u64 lblock, int *new, u64 *dblock, unsigned *extlen)
int gfs2_extent_map(struct inode *inode, u64 lblock, int *new, u64 *dblock, unsigned *extlen)
{
{
	struct metapath mp;
	struct metapath mp;
	struct buffer_head bh = { .b_state = 0, .b_blocknr = 0, .b_size = 0 };
	struct buffer_head bh = { .b_state = 0, .b_blocknr = 0 };
	int ret;
	int ret;
	int create = *new;
	int create = *new;


@@ -563,8 +563,9 @@ int gfs2_extent_map(struct inode *inode, u64 lblock, int *new, u64 *dblock, unsi
	BUG_ON(!dblock);
	BUG_ON(!dblock);
	BUG_ON(!new);
	BUG_ON(!new);


	bh.b_size = 1 << (inode->i_blkbits + 5);
	bmap_lock(inode, create);
	bmap_lock(inode, create);
	ret = gfs2_block_pointers(inode, lblock, create, &bh, &mp, 32);
	ret = gfs2_block_pointers(inode, lblock, create, &bh, &mp);
	bmap_unlock(inode, create);
	bmap_unlock(inode, create);
	*extlen = bh.b_size >> inode->i_blkbits;
	*extlen = bh.b_size >> inode->i_blkbits;
	*dblock = bh.b_blocknr;
	*dblock = bh.b_blocknr;
+1 −1
Original line number Original line Diff line number Diff line
@@ -15,7 +15,7 @@ struct gfs2_inode;
struct page;
struct page;


int gfs2_unstuff_dinode(struct gfs2_inode *ip, struct page *page);
int gfs2_unstuff_dinode(struct gfs2_inode *ip, struct page *page);
int gfs2_block_map(struct inode *inode, u64 lblock, int create, struct buffer_head *bh, unsigned int maxlen);
int gfs2_block_map(struct inode *inode, u64 lblock, int create, struct buffer_head *bh);
int gfs2_extent_map(struct inode *inode, u64 lblock, int *new, u64 *dblock, unsigned *extlen);
int gfs2_extent_map(struct inode *inode, u64 lblock, int *new, u64 *dblock, unsigned *extlen);


int gfs2_truncatei(struct gfs2_inode *ip, u64 size);
int gfs2_truncatei(struct gfs2_inode *ip, u64 size);
+3 −7
Original line number Original line Diff line number Diff line
@@ -184,7 +184,7 @@ static int gfs2_dir_write_data(struct gfs2_inode *ip, const char *buf,
	while (copied < size) {
	while (copied < size) {
		unsigned int amount;
		unsigned int amount;
		struct buffer_head *bh;
		struct buffer_head *bh;
		int new;
		int new = 0;


		amount = size - copied;
		amount = size - copied;
		if (amount > sdp->sd_sb.sb_bsize - o)
		if (amount > sdp->sd_sb.sb_bsize - o)
@@ -212,8 +212,6 @@ static int gfs2_dir_write_data(struct gfs2_inode *ip, const char *buf,
		gfs2_trans_add_bh(ip->i_gl, bh, 1);
		gfs2_trans_add_bh(ip->i_gl, bh, 1);
		memcpy(bh->b_data + o, buf, amount);
		memcpy(bh->b_data + o, buf, amount);
		brelse(bh);
		brelse(bh);
		if (error)
			goto fail;


		buf += amount;
		buf += amount;
		copied += amount;
		copied += amount;
@@ -317,8 +315,7 @@ static int gfs2_dir_read_data(struct gfs2_inode *ip, char *buf, u64 offset,
			if (!ra)
			if (!ra)
				extlen = 1;
				extlen = 1;
			bh = gfs2_meta_ra(ip->i_gl, dblock, extlen);
			bh = gfs2_meta_ra(ip->i_gl, dblock, extlen);
		}
		} else {
		if (!bh) {
			error = gfs2_meta_read(ip->i_gl, dblock, DIO_WAIT, &bh);
			error = gfs2_meta_read(ip->i_gl, dblock, DIO_WAIT, &bh);
			if (error)
			if (error)
				goto fail;
				goto fail;
@@ -332,7 +329,6 @@ static int gfs2_dir_read_data(struct gfs2_inode *ip, char *buf, u64 offset,
		extlen--;
		extlen--;
		memcpy(buf, bh->b_data + o, amount);
		memcpy(buf, bh->b_data + o, amount);
		brelse(bh);
		brelse(bh);
		bh = NULL;
		buf += amount;
		buf += amount;
		copied += amount;
		copied += amount;
		lblock++;
		lblock++;
@@ -815,7 +811,7 @@ static struct gfs2_leaf *new_leaf(struct inode *inode, struct buffer_head **pbh,
	leaf = (struct gfs2_leaf *)bh->b_data;
	leaf = (struct gfs2_leaf *)bh->b_data;
	leaf->lf_depth = cpu_to_be16(depth);
	leaf->lf_depth = cpu_to_be16(depth);
	leaf->lf_entries = 0;
	leaf->lf_entries = 0;
	leaf->lf_dirent_format = cpu_to_be16(GFS2_FORMAT_DE);
	leaf->lf_dirent_format = cpu_to_be32(GFS2_FORMAT_DE);
	leaf->lf_next = 0;
	leaf->lf_next = 0;
	memset(leaf->lf_reserved, 0, sizeof(leaf->lf_reserved));
	memset(leaf->lf_reserved, 0, sizeof(leaf->lf_reserved));
	dent = (struct gfs2_dirent *)(leaf+1);
	dent = (struct gfs2_dirent *)(leaf+1);
+4 −2
Original line number Original line Diff line number Diff line
@@ -312,10 +312,12 @@ void gfs2_log_release(struct gfs2_sbd *sdp, unsigned int blks)


static u64 log_bmap(struct gfs2_sbd *sdp, unsigned int lbn)
static u64 log_bmap(struct gfs2_sbd *sdp, unsigned int lbn)
{
{
	struct inode *inode = sdp->sd_jdesc->jd_inode;
	int error;
	int error;
	struct buffer_head bh_map;
	struct buffer_head bh_map = { .b_state = 0, .b_blocknr = 0 };


	error = gfs2_block_map(sdp->sd_jdesc->jd_inode, lbn, 0, &bh_map, 1);
	bh_map.b_size = 1 << inode->i_blkbits;
	error = gfs2_block_map(inode, lbn, 0, &bh_map);
	if (error || !bh_map.b_blocknr)
	if (error || !bh_map.b_blocknr)
		printk(KERN_INFO "error=%d, dbn=%llu lbn=%u", error, bh_map.b_blocknr, lbn);
		printk(KERN_INFO "error=%d, dbn=%llu lbn=%u", error, bh_map.b_blocknr, lbn);
	gfs2_assert_withdraw(sdp, !error && bh_map.b_blocknr);
	gfs2_assert_withdraw(sdp, !error && bh_map.b_blocknr);
Loading