Skip to content

Commit

Permalink
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/jlbec/ocfs2

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2:
  ocfs2: Change repository in MAINTAINERS.
  ocfs2: Fix a missing credit when deleting from indexed directories.
  ocfs2/trivial: Remove unused variable in ocfs2_rename.
  ocfs2: Add missing iput() during error handling in ocfs2_dentry_attach_lock()
  ocfs2: Fix some printk() warnings.
  ocfs2: Fix 2 warning during ocfs2 make.
  ocfs2: Reserve 1 more cluster in expanding_inline_dir for indexed dir.
  • Loading branch information
Linus Torvalds committed May 2, 2009
2 parents 020f932 + 2191aeb commit 7e567b4
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 21 deletions.
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -4189,7 +4189,7 @@ P: Joel Becker
M: joel.becker@oracle.com
L: ocfs2-devel@oss.oracle.com (moderated for non-subscribers)
W: http://oss.oracle.com/projects/ocfs2/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2.git
T: git git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2.git
S: Supported
F: Documentation/filesystems/ocfs2.txt
F: Documentation/filesystems/dlmfs.txt
Expand Down
15 changes: 15 additions & 0 deletions fs/ocfs2/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,21 @@ int ocfs2_dentry_attach_lock(struct dentry *dentry,
else
mlog_errno(ret);

/*
* In case of error, manually free the allocation and do the iput().
* We need to do this because error here means no d_instantiate(),
* which means iput() will not be called during dput(dentry).
*/
if (ret < 0 && !alias) {
ocfs2_lock_res_free(&dl->dl_lockres);
BUG_ON(dl->dl_count != 1);
spin_lock(&dentry_attach_lock);
dentry->d_fsdata = NULL;
spin_unlock(&dentry_attach_lock);
kfree(dl);
iput(inode);
}

dput(alias);

return ret;
Expand Down
4 changes: 2 additions & 2 deletions fs/ocfs2/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -2697,7 +2697,7 @@ static int ocfs2_dx_dir_index_block(struct inode *dir,
u32 *num_dx_entries,
struct buffer_head *dirent_bh)
{
int ret, namelen, i;
int ret = 0, namelen, i;
char *de_buf, *limit;
struct ocfs2_dir_entry *de;
struct buffer_head *dx_leaf_bh;
Expand Down Expand Up @@ -2934,7 +2934,7 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh,
*/
BUG_ON(alloc > 2);

ret = ocfs2_reserve_clusters(osb, alloc, &data_ac);
ret = ocfs2_reserve_clusters(osb, alloc + dx_alloc, &data_ac);
if (ret) {
mlog_errno(ret);
goto out;
Expand Down
9 changes: 5 additions & 4 deletions fs/ocfs2/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb,

/* If the inode allocator bit is clear, this inode must be stale */
if (!set) {
mlog(0, "inode %llu suballoc bit is clear\n", blkno);
mlog(0, "inode %llu suballoc bit is clear\n",
(unsigned long long)blkno);
status = -ESTALE;
goto unlock_nfs_sync;
}
Expand All @@ -114,7 +115,7 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb,
if (status < 0) {
if (status == -ESTALE) {
mlog(0, "stale inode ino: %llu generation: %u\n",
blkno, handle->ih_generation);
(unsigned long long)blkno, handle->ih_generation);
}
result = ERR_PTR(status);
goto bail;
Expand All @@ -129,8 +130,8 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb,
check_gen:
if (handle->ih_generation != inode->i_generation) {
iput(inode);
mlog(0, "stale inode ino: %llu generation: %u\n", blkno,
handle->ih_generation);
mlog(0, "stale inode ino: %llu generation: %u\n",
(unsigned long long)blkno, handle->ih_generation);
result = ERR_PTR(-ESTALE);
goto bail;
}
Expand Down
5 changes: 3 additions & 2 deletions fs/ocfs2/journal.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,9 @@ static inline int ocfs2_unlink_credits(struct super_block *sb)
}

/* dinode + orphan dir dinode + inode alloc dinode + orphan dir entry +
* inode alloc group descriptor + orphan dir index leaf */
#define OCFS2_DELETE_INODE_CREDITS (3 * OCFS2_INODE_UPDATE_CREDITS + 3)
* inode alloc group descriptor + orphan dir index root +
* orphan dir index leaf */
#define OCFS2_DELETE_INODE_CREDITS (3 * OCFS2_INODE_UPDATE_CREDITS + 4)

/* dinode update, old dir dinode update, new dir dinode update, old
* dir dir entry, new dir dir entry, dir entry update for renaming
Expand Down
4 changes: 0 additions & 4 deletions fs/ocfs2/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1025,10 +1025,8 @@ static int ocfs2_rename(struct inode *old_dir,
struct inode *orphan_dir = NULL;
struct ocfs2_dinode *newfe = NULL;
char orphan_name[OCFS2_ORPHAN_NAMELEN + 1];
struct buffer_head *orphan_entry_bh = NULL;
struct buffer_head *newfe_bh = NULL;
struct buffer_head *old_inode_bh = NULL;
struct buffer_head *insert_entry_bh = NULL;
struct ocfs2_super *osb = NULL;
u64 newfe_blkno, old_de_ino;
handle_t *handle = NULL;
Expand Down Expand Up @@ -1455,8 +1453,6 @@ static int ocfs2_rename(struct inode *old_dir,
brelse(old_inode_bh);
brelse(old_dir_bh);
brelse(new_dir_bh);
brelse(orphan_entry_bh);
brelse(insert_entry_bh);

mlog_exit(status);

Expand Down
21 changes: 13 additions & 8 deletions fs/ocfs2/suballoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2197,26 +2197,29 @@ static int ocfs2_get_suballoc_slot_bit(struct ocfs2_super *osb, u64 blkno,
struct buffer_head *inode_bh = NULL;
struct ocfs2_dinode *inode_fe;

mlog_entry("blkno: %llu\n", blkno);
mlog_entry("blkno: %llu\n", (unsigned long long)blkno);

/* dirty read disk */
status = ocfs2_read_blocks_sync(osb, blkno, 1, &inode_bh);
if (status < 0) {
mlog(ML_ERROR, "read block %llu failed %d\n", blkno, status);
mlog(ML_ERROR, "read block %llu failed %d\n",
(unsigned long long)blkno, status);
goto bail;
}

inode_fe = (struct ocfs2_dinode *) inode_bh->b_data;
if (!OCFS2_IS_VALID_DINODE(inode_fe)) {
mlog(ML_ERROR, "invalid inode %llu requested\n", blkno);
mlog(ML_ERROR, "invalid inode %llu requested\n",
(unsigned long long)blkno);
status = -EINVAL;
goto bail;
}

if (le16_to_cpu(inode_fe->i_suballoc_slot) != OCFS2_INVALID_SLOT &&
if (le16_to_cpu(inode_fe->i_suballoc_slot) != (u16)OCFS2_INVALID_SLOT &&
(u32)le16_to_cpu(inode_fe->i_suballoc_slot) > osb->max_slots - 1) {
mlog(ML_ERROR, "inode %llu has invalid suballoc slot %u\n",
blkno, (u32)le16_to_cpu(inode_fe->i_suballoc_slot));
(unsigned long long)blkno,
(u32)le16_to_cpu(inode_fe->i_suballoc_slot));
status = -EINVAL;
goto bail;
}
Expand Down Expand Up @@ -2251,7 +2254,8 @@ static int ocfs2_test_suballoc_bit(struct ocfs2_super *osb,
u64 bg_blkno;
int status;

mlog_entry("blkno: %llu bit: %u\n", blkno, (unsigned int)bit);
mlog_entry("blkno: %llu bit: %u\n", (unsigned long long)blkno,
(unsigned int)bit);

alloc_fe = (struct ocfs2_dinode *)alloc_bh->b_data;
if ((bit + 1) > ocfs2_bits_per_group(&alloc_fe->id2.i_chain)) {
Expand All @@ -2266,7 +2270,8 @@ static int ocfs2_test_suballoc_bit(struct ocfs2_super *osb,
status = ocfs2_read_group_descriptor(suballoc, alloc_fe, bg_blkno,
&group_bh);
if (status < 0) {
mlog(ML_ERROR, "read group %llu failed %d\n", bg_blkno, status);
mlog(ML_ERROR, "read group %llu failed %d\n",
(unsigned long long)bg_blkno, status);
goto bail;
}

Expand Down Expand Up @@ -2300,7 +2305,7 @@ int ocfs2_test_inode_bit(struct ocfs2_super *osb, u64 blkno, int *res)
struct inode *inode_alloc_inode;
struct buffer_head *alloc_bh = NULL;

mlog_entry("blkno: %llu", blkno);
mlog_entry("blkno: %llu", (unsigned long long)blkno);

status = ocfs2_get_suballoc_slot_bit(osb, blkno, &suballoc_slot,
&suballoc_bit);
Expand Down

0 comments on commit 7e567b4

Please sign in to comment.