Skip to contentSkip to conversation

Check journal_begin() return codes

PATCH New Jan Kara 1 participant 1 message May 19, 2005

lore
Share & tools
lore

Jan Kara

author
#0 lore raw

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.

fs/reiserfs/inode.c +4 -2
diff -rup linux-2.6.12-rc4-quotareserve/fs/reiserfs/inode.c linux-2.6.12-rc4-transstart/fs/reiserfs/inode.c
@@ -2798,7 +2798,9 @@ int reiserfs_setattr(struct dentry *dent
 		    struct 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 *dent
 		    if (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