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

Commit 551395ae 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] Prefer strlcpy() over snprintf()
  [GFS2] Fix cast from unsigned int to s64
  [GFS2] filesystem consistency error from do_strip
parents a8375bd8 00377d8e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -249,7 +249,7 @@ static int inode_go_lock(struct gfs2_holder *gh)
	struct gfs2_inode *ip = gl->gl_object;
	int error = 0;

	if (!ip)
	if (!ip || (gh->gh_flags & GL_SKIP))
		return 0;

	if (test_bit(GIF_INVALID, &ip->i_flags)) {
+1 −0
Original line number Diff line number Diff line
@@ -236,6 +236,7 @@ enum {
	GIF_INVALID		= 0,
	GIF_QD_LOCKED		= 1,
	GIF_SW_PAGED		= 3,
	GIF_USER                = 4, /* user inode, not metadata addr space */
};

struct gfs2_dinode_host {
+5 −5
Original line number Diff line number Diff line
@@ -47,8 +47,7 @@ static int iget_test(struct inode *inode, void *opaque)
	struct gfs2_inode *ip = GFS2_I(inode);
	u64 *no_addr = opaque;

	if (ip->i_no_addr == *no_addr &&
	    inode->i_private != NULL)
	if (ip->i_no_addr == *no_addr && test_bit(GIF_USER, &ip->i_flags))
		return 1;

	return 0;
@@ -61,6 +60,7 @@ static int iget_set(struct inode *inode, void *opaque)

	inode->i_ino = (unsigned long)*no_addr;
	ip->i_no_addr = *no_addr;
	set_bit(GIF_USER, &ip->i_flags);
	return 0;
}

@@ -86,7 +86,7 @@ static int iget_skip_test(struct inode *inode, void *opaque)
	struct gfs2_inode *ip = GFS2_I(inode);
	struct gfs2_skip_data *data = opaque;

	if (ip->i_no_addr == data->no_addr && inode->i_private != NULL){
	if (ip->i_no_addr == data->no_addr && test_bit(GIF_USER, &ip->i_flags)){
		if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE)){
			data->skipped = 1;
			return 0;
@@ -105,6 +105,7 @@ static int iget_skip_set(struct inode *inode, void *opaque)
		return 1;
	inode->i_ino = (unsigned long)(data->no_addr);
	ip->i_no_addr = data->no_addr;
	set_bit(GIF_USER, &ip->i_flags);
	return 0;
}

@@ -187,7 +188,6 @@ struct inode *gfs2_inode_lookup(struct super_block *sb,

	if (inode->i_state & I_NEW) {
		struct gfs2_sbd *sdp = GFS2_SB(inode);
		inode->i_private = ip;
		ip->i_no_formal_ino = no_formal_ino;

		error = gfs2_glock_get(sdp, no_addr, &gfs2_inode_glops, CREATE, &ip->i_gl);
+4 −2
Original line number Diff line number Diff line
/*
 * Copyright (C) Sistina Software, Inc.  1997-2003 All rights reserved.
 * Copyright (C) 2004-2006 Red Hat, Inc.  All rights reserved.
 * Copyright (C) 2004-2008 Red Hat, Inc.  All rights reserved.
 *
 * This copyrighted material is made available to anyone wishing to use,
 * modify, copy, or redistribute it subject to the terms and conditions
@@ -69,13 +69,15 @@ static const struct address_space_operations aspace_aops = {
struct inode *gfs2_aspace_get(struct gfs2_sbd *sdp)
{
	struct inode *aspace;
	struct gfs2_inode *ip;

	aspace = new_inode(sdp->sd_vfs);
	if (aspace) {
		mapping_set_gfp_mask(aspace->i_mapping, GFP_NOFS);
		aspace->i_mapping->a_ops = &aspace_aops;
		aspace->i_size = ~0ULL;
		aspace->i_private = NULL;
		ip = GFS2_I(aspace);
		clear_bit(GIF_USER, &ip->i_flags);
		insert_inode_hash(aspace);
	}
	return aspace;
+2 −2
Original line number Diff line number Diff line
@@ -142,8 +142,8 @@ static int init_names(struct gfs2_sbd *sdp, int silent)
	if (!table[0])
		table = sdp->sd_vfs->s_id;

	snprintf(sdp->sd_proto_name, GFS2_FSNAME_LEN, "%s", proto);
	snprintf(sdp->sd_table_name, GFS2_FSNAME_LEN, "%s", table);
	strlcpy(sdp->sd_proto_name, proto, GFS2_FSNAME_LEN);
	strlcpy(sdp->sd_table_name, table, GFS2_FSNAME_LEN);

	table = sdp->sd_table_name;
	while ((table = strchr(table, '/')))
Loading