On 2013-02-09, at 14:53, Theodore Ts'o <tytso@xxxxxxx> wrote: > In ext4_{create,mknod,mkdir,symlink}(), don't start the journal handle > until the inode has been succesfully allocated. In order to do this, > we need to start the handle in the ext4_new_inode(). So create a new > variant of this function, ext4_new_inode_start_handle(), so the handle > can be created at the last possible minute, before we need to modify > the inode allocation bitmap block. > > Signed-off-by: "Theodore Ts'o" <tytso@xxxxxxx> > --- > fs/ext4/ext4.h | 17 ++++++++-- > fs/ext4/ialloc.c | 15 +++++++-- > fs/ext4/namei.c | 94 ++++++++++++++++++++++++++------------------------------ > 3 files changed, 71 insertions(+), 55 deletions(-) > > diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h > index 9897cdf..05940ce 100644 > --- a/fs/ext4/ext4.h > +++ b/fs/ext4/ext4.h > @@ -1991,9 +1991,20 @@ extern int ext4fs_dirhash(const char *name, int len, struct > dx_hash_info *hinfo); > > /* ialloc.c */ > -extern struct inode *ext4_new_inode(handle_t *, struct inode *, umode_t, > - const struct qstr *qstr, __u32 goal, > - uid_t *owner); > +extern struct inode *__ext4_new_inode(handle_t *, struct inode *, umode_t, > + const struct qstr *qstr, __u32 goal, > + uid_t *owner, int handle_type, > + unsigned int line_no, int nblocks); > + > +#define ext4_new_inode(handle, dir, mode, qstr, goal, owner) \ > + __ext4_new_inode((handle), (dir), (mode), (qstr), (goal), (owner), \ > + 0, 0, 0) > +#define ext4_new_inode_start_handle(dir, mode, qstr, goal, owner, \ > + type, nblocks) \ > + __ext4_new_inode(0, (dir), (mode), (qstr), (goal), (owner), \ Please use "NULL" instead of "0" for pointers. Cheers, Andreas-- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html