Check journal_begin() return codes
PATCH 1/1 Check journal_begin() return codes
Hello,
attached patch makes quota code in reiserfs properly check the return
code of journal_begin() and journal_end() functions. The patch is to be applied after the previous patch fixing the quota transaction size. Please apply.
Honza
Check return values of journal_begin() and journal_end() in the quota code for reiserfs.
Signed-off-by Jan Kara <[email protected]>
fs/reiserfs/inode.c +4 -2
@@ -2798,7 +2798,9 @@ int reiserfs_setattr(struct dentry *dentstruct reiserfs_transaction_handle th;/* (user+group)*(old+new) structure - we count quota info and , inode write (sb, inode) */ -journal_begin (&th, inode->i_sb,2 *(REISERFS_QUOTA_INIT_BLOCKS +REISERFS_QUOTA_DEL_BLOCKS )+2 ); + error =journal_begin (&th, inode->i_sb,2 *(REISERFS_QUOTA_INIT_BLOCKS +REISERFS_QUOTA_DEL_BLOCKS )+2 ); +if (error) + goto out; error =DQUOT_TRANSFER (inode, attr) ? -EDQUOT :0 ;if (error) {journal_end (&th, inode->i_sb,2 *(REISERFS_QUOTA_INIT_BLOCKS +REISERFS_QUOTA_DEL_BLOCKS )+2 );
@@ -2811,7 +2813,7 @@ int reiserfs_setattr(struct dentry *dentif (attr->ia_valid &ATTR_GID ) inode->i_gid = attr->ia_gid;mark_inode_dirty (inode); -journal_end (&th, inode->i_sb,2 *(REISERFS_QUOTA_INIT_BLOCKS +REISERFS_QUOTA_DEL_BLOCKS )+2 ); + error =journal_end (&th, inode->i_sb,2 *(REISERFS_QUOTA_INIT_BLOCKS +REISERFS_QUOTA_DEL_BLOCKS )+2 ); } }if (!error)
fs/reiserfs/super.c +48 -18
123 lines not on this page · raw message