Commit d2d0395f authored by Jeff Mahoney's avatar Jeff Mahoney Committed by Jeff Mahoney

reiserfs: locking, release lock around quota operations

Previous commits released the write lock across quota operations but
missed several places.  In particular, the free operations can also
call into the file system code and take the write lock, causing
deadlocks.

This patch introduces some more helpers and uses them for quota call
sites.  Without this patch applied, reiserfs + quotas runs into deadlocks
under anything more than trivial load.
Signed-off-by: default avatarJeff Mahoney <jeffm@suse.com>
parent 278f6679
...@@ -423,8 +423,11 @@ static void _reiserfs_free_block(struct reiserfs_transaction_handle *th, ...@@ -423,8 +423,11 @@ static void _reiserfs_free_block(struct reiserfs_transaction_handle *th,
set_sb_free_blocks(rs, sb_free_blocks(rs) + 1); set_sb_free_blocks(rs, sb_free_blocks(rs) + 1);
journal_mark_dirty(th, s, sbh); journal_mark_dirty(th, s, sbh);
if (for_unformatted) if (for_unformatted) {
int depth = reiserfs_write_unlock_nested(s);
dquot_free_block_nodirty(inode, 1); dquot_free_block_nodirty(inode, 1);
reiserfs_write_lock_nested(s, depth);
}
} }
void reiserfs_free_block(struct reiserfs_transaction_handle *th, void reiserfs_free_block(struct reiserfs_transaction_handle *th,
...@@ -1128,6 +1131,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start ...@@ -1128,6 +1131,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
b_blocknr_t finish = SB_BLOCK_COUNT(s) - 1; b_blocknr_t finish = SB_BLOCK_COUNT(s) - 1;
int passno = 0; int passno = 0;
int nr_allocated = 0; int nr_allocated = 0;
int depth;
determine_prealloc_size(hint); determine_prealloc_size(hint);
if (!hint->formatted_node) { if (!hint->formatted_node) {
...@@ -1137,10 +1141,13 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start ...@@ -1137,10 +1141,13 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
"reiserquota: allocating %d blocks id=%u", "reiserquota: allocating %d blocks id=%u",
amount_needed, hint->inode->i_uid); amount_needed, hint->inode->i_uid);
#endif #endif
depth = reiserfs_write_unlock_nested(s);
quota_ret = quota_ret =
dquot_alloc_block_nodirty(hint->inode, amount_needed); dquot_alloc_block_nodirty(hint->inode, amount_needed);
if (quota_ret) /* Quota exceeded? */ if (quota_ret) { /* Quota exceeded? */
reiserfs_write_lock_nested(s, depth);
return QUOTA_EXCEEDED; return QUOTA_EXCEEDED;
}
if (hint->preallocate && hint->prealloc_size) { if (hint->preallocate && hint->prealloc_size) {
#ifdef REISERQUOTA_DEBUG #ifdef REISERQUOTA_DEBUG
reiserfs_debug(s, REISERFS_DEBUG_CODE, reiserfs_debug(s, REISERFS_DEBUG_CODE,
...@@ -1153,6 +1160,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start ...@@ -1153,6 +1160,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
hint->preallocate = hint->prealloc_size = 0; hint->preallocate = hint->prealloc_size = 0;
} }
/* for unformatted nodes, force large allocations */ /* for unformatted nodes, force large allocations */
reiserfs_write_lock_nested(s, depth);
} }
do { do {
...@@ -1181,9 +1189,11 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start ...@@ -1181,9 +1189,11 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
hint->inode->i_uid); hint->inode->i_uid);
#endif #endif
/* Free not allocated blocks */ /* Free not allocated blocks */
depth = reiserfs_write_unlock_nested(s);
dquot_free_block_nodirty(hint->inode, dquot_free_block_nodirty(hint->inode,
amount_needed + hint->prealloc_size - amount_needed + hint->prealloc_size -
nr_allocated); nr_allocated);
reiserfs_write_lock_nested(s, depth);
} }
while (nr_allocated--) while (nr_allocated--)
reiserfs_free_block(hint->th, hint->inode, reiserfs_free_block(hint->th, hint->inode,
...@@ -1214,10 +1224,13 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start ...@@ -1214,10 +1224,13 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
REISERFS_I(hint->inode)->i_prealloc_count, REISERFS_I(hint->inode)->i_prealloc_count,
hint->inode->i_uid); hint->inode->i_uid);
#endif #endif
depth = reiserfs_write_unlock_nested(s);
dquot_free_block_nodirty(hint->inode, amount_needed + dquot_free_block_nodirty(hint->inode, amount_needed +
hint->prealloc_size - nr_allocated - hint->prealloc_size - nr_allocated -
REISERFS_I(hint->inode)-> REISERFS_I(hint->inode)->
i_prealloc_count); i_prealloc_count);
reiserfs_write_lock_nested(s, depth);
} }
return CARRY_ON; return CARRY_ON;
......
...@@ -57,8 +57,11 @@ void reiserfs_evict_inode(struct inode *inode) ...@@ -57,8 +57,11 @@ void reiserfs_evict_inode(struct inode *inode)
/* Do quota update inside a transaction for journaled quotas. We must do that /* Do quota update inside a transaction for journaled quotas. We must do that
* after delete_object so that quota updates go into the same transaction as * after delete_object so that quota updates go into the same transaction as
* stat data deletion */ * stat data deletion */
if (!err) if (!err) {
int depth = reiserfs_write_unlock_nested(inode->i_sb);
dquot_free_inode(inode); dquot_free_inode(inode);
reiserfs_write_lock_nested(inode->i_sb, depth);
}
if (journal_end(&th, inode->i_sb, jbegin_count)) if (journal_end(&th, inode->i_sb, jbegin_count))
goto out; goto out;
...@@ -1768,7 +1771,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, ...@@ -1768,7 +1771,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
struct inode *inode, struct inode *inode,
struct reiserfs_security_handle *security) struct reiserfs_security_handle *security)
{ {
struct super_block *sb; struct super_block *sb = dir->i_sb;
struct reiserfs_iget_args args; struct reiserfs_iget_args args;
INITIALIZE_PATH(path_to_key); INITIALIZE_PATH(path_to_key);
struct cpu_key key; struct cpu_key key;
...@@ -1780,9 +1783,9 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, ...@@ -1780,9 +1783,9 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
BUG_ON(!th->t_trans_id); BUG_ON(!th->t_trans_id);
reiserfs_write_unlock(inode->i_sb); depth = reiserfs_write_unlock_nested(sb);
err = dquot_alloc_inode(inode); err = dquot_alloc_inode(inode);
reiserfs_write_lock(inode->i_sb); reiserfs_write_lock_nested(sb, depth);
if (err) if (err)
goto out_end_trans; goto out_end_trans;
if (!dir->i_nlink) { if (!dir->i_nlink) {
...@@ -1790,8 +1793,6 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, ...@@ -1790,8 +1793,6 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
goto out_bad_inode; goto out_bad_inode;
} }
sb = dir->i_sb;
/* item head of new item */ /* item head of new item */
ih.ih_key.k_dir_id = reiserfs_choose_packing(dir); ih.ih_key.k_dir_id = reiserfs_choose_packing(dir);
ih.ih_key.k_objectid = cpu_to_le32(reiserfs_get_unused_objectid(th)); ih.ih_key.k_objectid = cpu_to_le32(reiserfs_get_unused_objectid(th));
...@@ -1983,14 +1984,16 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, ...@@ -1983,14 +1984,16 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
INODE_PKEY(inode)->k_objectid = 0; INODE_PKEY(inode)->k_objectid = 0;
/* Quota change must be inside a transaction for journaling */ /* Quota change must be inside a transaction for journaling */
depth = reiserfs_write_unlock_nested(inode->i_sb);
dquot_free_inode(inode); dquot_free_inode(inode);
reiserfs_write_lock_nested(inode->i_sb, depth);
out_end_trans: out_end_trans:
journal_end(th, th->t_super, th->t_blocks_allocated); journal_end(th, th->t_super, th->t_blocks_allocated);
reiserfs_write_unlock(inode->i_sb);
/* Drop can be outside and it needs more credits so it's better to have it outside */ /* Drop can be outside and it needs more credits so it's better to have it outside */
depth = reiserfs_write_unlock_nested(inode->i_sb);
dquot_drop(inode); dquot_drop(inode);
reiserfs_write_lock(inode->i_sb); reiserfs_write_lock_nested(inode->i_sb, depth);
inode->i_flags |= S_NOQUOTA; inode->i_flags |= S_NOQUOTA;
make_bad_inode(inode); make_bad_inode(inode);
......
...@@ -1186,6 +1186,7 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th, ...@@ -1186,6 +1186,7 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th,
struct item_head *q_ih; struct item_head *q_ih;
int quota_cut_bytes; int quota_cut_bytes;
int ret_value, del_size, removed; int ret_value, del_size, removed;
int depth;
#ifdef CONFIG_REISERFS_CHECK #ifdef CONFIG_REISERFS_CHECK
char mode; char mode;
...@@ -1295,7 +1296,9 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th, ...@@ -1295,7 +1296,9 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th,
"reiserquota delete_item(): freeing %u, id=%u type=%c", "reiserquota delete_item(): freeing %u, id=%u type=%c",
quota_cut_bytes, inode->i_uid, head2type(&s_ih)); quota_cut_bytes, inode->i_uid, head2type(&s_ih));
#endif #endif
depth = reiserfs_write_unlock_nested(inode->i_sb);
dquot_free_space_nodirty(inode, quota_cut_bytes); dquot_free_space_nodirty(inode, quota_cut_bytes);
reiserfs_write_lock_nested(inode->i_sb, depth);
/* Return deleted body length */ /* Return deleted body length */
return ret_value; return ret_value;
...@@ -1321,6 +1324,7 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th, ...@@ -1321,6 +1324,7 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th,
void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th, void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th,
struct inode *inode, struct reiserfs_key *key) struct inode *inode, struct reiserfs_key *key)
{ {
struct super_block *sb = th->t_super;
struct tree_balance tb; struct tree_balance tb;
INITIALIZE_PATH(path); INITIALIZE_PATH(path);
int item_len = 0; int item_len = 0;
...@@ -1373,14 +1377,17 @@ void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th, ...@@ -1373,14 +1377,17 @@ void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th,
if (retval == CARRY_ON) { if (retval == CARRY_ON) {
do_balance(&tb, NULL, NULL, M_DELETE); do_balance(&tb, NULL, NULL, M_DELETE);
if (inode) { /* Should we count quota for item? (we don't count quotas for save-links) */ if (inode) { /* Should we count quota for item? (we don't count quotas for save-links) */
int depth;
#ifdef REISERQUOTA_DEBUG #ifdef REISERQUOTA_DEBUG
reiserfs_debug(th->t_super, REISERFS_DEBUG_CODE, reiserfs_debug(th->t_super, REISERFS_DEBUG_CODE,
"reiserquota delete_solid_item(): freeing %u id=%u type=%c", "reiserquota delete_solid_item(): freeing %u id=%u type=%c",
quota_cut_bytes, inode->i_uid, quota_cut_bytes, inode->i_uid,
key2type(key)); key2type(key));
#endif #endif
depth = reiserfs_write_unlock_nested(sb);
dquot_free_space_nodirty(inode, dquot_free_space_nodirty(inode,
quota_cut_bytes); quota_cut_bytes);
reiserfs_write_lock_nested(sb, depth);
} }
break; break;
} }
...@@ -1557,6 +1564,7 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, ...@@ -1557,6 +1564,7 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
int retval2 = -1; int retval2 = -1;
int quota_cut_bytes; int quota_cut_bytes;
loff_t tail_pos = 0; loff_t tail_pos = 0;
int depth;
BUG_ON(!th->t_trans_id); BUG_ON(!th->t_trans_id);
...@@ -1729,7 +1737,9 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, ...@@ -1729,7 +1737,9 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
"reiserquota cut_from_item(): freeing %u id=%u type=%c", "reiserquota cut_from_item(): freeing %u id=%u type=%c",
quota_cut_bytes, inode->i_uid, '?'); quota_cut_bytes, inode->i_uid, '?');
#endif #endif
depth = reiserfs_write_unlock_nested(sb);
dquot_free_space_nodirty(inode, quota_cut_bytes); dquot_free_space_nodirty(inode, quota_cut_bytes);
reiserfs_write_lock_nested(sb, depth);
return ret_value; return ret_value;
} }
...@@ -1949,9 +1959,11 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree ...@@ -1949,9 +1959,11 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree
const char *body, /* Pointer to the bytes to paste. */ const char *body, /* Pointer to the bytes to paste. */
int pasted_size) int pasted_size)
{ /* Size of pasted bytes. */ { /* Size of pasted bytes. */
struct super_block *sb = inode->i_sb;
struct tree_balance s_paste_balance; struct tree_balance s_paste_balance;
int retval; int retval;
int fs_gen; int fs_gen;
int depth;
BUG_ON(!th->t_trans_id); BUG_ON(!th->t_trans_id);
...@@ -1964,9 +1976,9 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree ...@@ -1964,9 +1976,9 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree
key2type(&(key->on_disk_key))); key2type(&(key->on_disk_key)));
#endif #endif
reiserfs_write_unlock(inode->i_sb); depth = reiserfs_write_unlock_nested(sb);
retval = dquot_alloc_space_nodirty(inode, pasted_size); retval = dquot_alloc_space_nodirty(inode, pasted_size);
reiserfs_write_lock(inode->i_sb); reiserfs_write_lock_nested(sb, depth);
if (retval) { if (retval) {
pathrelse(search_path); pathrelse(search_path);
return retval; return retval;
...@@ -2023,7 +2035,9 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree ...@@ -2023,7 +2035,9 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree
pasted_size, inode->i_uid, pasted_size, inode->i_uid,
key2type(&(key->on_disk_key))); key2type(&(key->on_disk_key)));
#endif #endif
depth = reiserfs_write_unlock_nested(sb);
dquot_free_space_nodirty(inode, pasted_size); dquot_free_space_nodirty(inode, pasted_size);
reiserfs_write_lock_nested(sb, depth);
return retval; return retval;
} }
...@@ -2046,6 +2060,7 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th, ...@@ -2046,6 +2060,7 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th,
BUG_ON(!th->t_trans_id); BUG_ON(!th->t_trans_id);
if (inode) { /* Do we count quotas for item? */ if (inode) { /* Do we count quotas for item? */
int depth;
fs_gen = get_generation(inode->i_sb); fs_gen = get_generation(inode->i_sb);
quota_bytes = ih_item_len(ih); quota_bytes = ih_item_len(ih);
...@@ -2059,11 +2074,11 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th, ...@@ -2059,11 +2074,11 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th,
"reiserquota insert_item(): allocating %u id=%u type=%c", "reiserquota insert_item(): allocating %u id=%u type=%c",
quota_bytes, inode->i_uid, head2type(ih)); quota_bytes, inode->i_uid, head2type(ih));
#endif #endif
reiserfs_write_unlock(inode->i_sb);
/* We can't dirty inode here. It would be immediately written but /* We can't dirty inode here. It would be immediately written but
* appropriate stat item isn't inserted yet... */ * appropriate stat item isn't inserted yet... */
depth = reiserfs_write_unlock_nested(inode->i_sb);
retval = dquot_alloc_space_nodirty(inode, quota_bytes); retval = dquot_alloc_space_nodirty(inode, quota_bytes);
reiserfs_write_lock(inode->i_sb); reiserfs_write_lock_nested(inode->i_sb, depth);
if (retval) { if (retval) {
pathrelse(path); pathrelse(path);
return retval; return retval;
...@@ -2114,7 +2129,10 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th, ...@@ -2114,7 +2129,10 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th,
"reiserquota insert_item(): freeing %u id=%u type=%c", "reiserquota insert_item(): freeing %u id=%u type=%c",
quota_bytes, inode->i_uid, head2type(ih)); quota_bytes, inode->i_uid, head2type(ih));
#endif #endif
if (inode) if (inode) {
int depth = reiserfs_write_unlock_nested(inode->i_sb);
dquot_free_space_nodirty(inode, quota_bytes); dquot_free_space_nodirty(inode, quota_bytes);
reiserfs_write_lock_nested(inode->i_sb, depth);
}
return retval; return retval;
} }
...@@ -243,6 +243,7 @@ static int finish_unfinished(struct super_block *s) ...@@ -243,6 +243,7 @@ static int finish_unfinished(struct super_block *s)
done = 0; done = 0;
REISERFS_SB(s)->s_is_unlinked_ok = 1; REISERFS_SB(s)->s_is_unlinked_ok = 1;
while (!retval) { while (!retval) {
int depth;
retval = search_item(s, &max_cpu_key, &path); retval = search_item(s, &max_cpu_key, &path);
if (retval != ITEM_NOT_FOUND) { if (retval != ITEM_NOT_FOUND) {
reiserfs_error(s, "vs-2140", reiserfs_error(s, "vs-2140",
...@@ -298,9 +299,9 @@ static int finish_unfinished(struct super_block *s) ...@@ -298,9 +299,9 @@ static int finish_unfinished(struct super_block *s)
retval = remove_save_link_only(s, &save_link_key, 0); retval = remove_save_link_only(s, &save_link_key, 0);
continue; continue;
} }
reiserfs_write_unlock(s); depth = reiserfs_write_unlock_nested(inode->i_sb);
dquot_initialize(inode); dquot_initialize(inode);
reiserfs_write_lock(s); reiserfs_write_lock_nested(inode->i_sb, depth);
if (truncate && S_ISDIR(inode->i_mode)) { if (truncate && S_ISDIR(inode->i_mode)) {
/* We got a truncate request for a dir which is impossible. /* We got a truncate request for a dir which is impossible.
...@@ -356,10 +357,12 @@ static int finish_unfinished(struct super_block *s) ...@@ -356,10 +357,12 @@ static int finish_unfinished(struct super_block *s)
#ifdef CONFIG_QUOTA #ifdef CONFIG_QUOTA
/* Turn quotas off */ /* Turn quotas off */
reiserfs_write_unlock(s);
for (i = 0; i < MAXQUOTAS; i++) { for (i = 0; i < MAXQUOTAS; i++) {
if (sb_dqopt(s)->files[i] && quota_enabled[i]) if (sb_dqopt(s)->files[i] && quota_enabled[i])
dquot_quota_off(s, i); dquot_quota_off(s, i);
} }
reiserfs_write_lock(s);
if (ms_active_set) if (ms_active_set)
/* Restore the flag back */ /* Restore the flag back */
s->s_flags &= ~MS_ACTIVE; s->s_flags &= ~MS_ACTIVE;
...@@ -2098,6 +2101,7 @@ static int reiserfs_write_dquot(struct dquot *dquot) ...@@ -2098,6 +2101,7 @@ static int reiserfs_write_dquot(struct dquot *dquot)
{ {
struct reiserfs_transaction_handle th; struct reiserfs_transaction_handle th;
int ret, err; int ret, err;
int depth;
reiserfs_write_lock(dquot->dq_sb); reiserfs_write_lock(dquot->dq_sb);
ret = ret =
...@@ -2105,9 +2109,9 @@ static int reiserfs_write_dquot(struct dquot *dquot) ...@@ -2105,9 +2109,9 @@ static int reiserfs_write_dquot(struct dquot *dquot)
REISERFS_QUOTA_TRANS_BLOCKS(dquot->dq_sb)); REISERFS_QUOTA_TRANS_BLOCKS(dquot->dq_sb));
if (ret) if (ret)
goto out; goto out;
reiserfs_write_unlock(dquot->dq_sb); depth = reiserfs_write_unlock_nested(dquot->dq_sb);
ret = dquot_commit(dquot); ret = dquot_commit(dquot);
reiserfs_write_lock(dquot->dq_sb); reiserfs_write_lock_nested(dquot->dq_sb, depth);
err = err =
journal_end(&th, dquot->dq_sb, journal_end(&th, dquot->dq_sb,
REISERFS_QUOTA_TRANS_BLOCKS(dquot->dq_sb)); REISERFS_QUOTA_TRANS_BLOCKS(dquot->dq_sb));
...@@ -2122,6 +2126,7 @@ static int reiserfs_acquire_dquot(struct dquot *dquot) ...@@ -2122,6 +2126,7 @@ static int reiserfs_acquire_dquot(struct dquot *dquot)
{ {
struct reiserfs_transaction_handle th; struct reiserfs_transaction_handle th;
int ret, err; int ret, err;
int depth;
reiserfs_write_lock(dquot->dq_sb); reiserfs_write_lock(dquot->dq_sb);
ret = ret =
...@@ -2129,9 +2134,9 @@ static int reiserfs_acquire_dquot(struct dquot *dquot) ...@@ -2129,9 +2134,9 @@ static int reiserfs_acquire_dquot(struct dquot *dquot)
REISERFS_QUOTA_INIT_BLOCKS(dquot->dq_sb)); REISERFS_QUOTA_INIT_BLOCKS(dquot->dq_sb));
if (ret) if (ret)
goto out; goto out;
reiserfs_write_unlock(dquot->dq_sb); depth = reiserfs_write_unlock_nested(dquot->dq_sb);
ret = dquot_acquire(dquot); ret = dquot_acquire(dquot);
reiserfs_write_lock(dquot->dq_sb); reiserfs_write_lock_nested(dquot->dq_sb, depth);
err = err =
journal_end(&th, dquot->dq_sb, journal_end(&th, dquot->dq_sb,
REISERFS_QUOTA_INIT_BLOCKS(dquot->dq_sb)); REISERFS_QUOTA_INIT_BLOCKS(dquot->dq_sb));
...@@ -2184,15 +2189,16 @@ static int reiserfs_write_info(struct super_block *sb, int type) ...@@ -2184,15 +2189,16 @@ static int reiserfs_write_info(struct super_block *sb, int type)
{ {
struct reiserfs_transaction_handle th; struct reiserfs_transaction_handle th;
int ret, err; int ret, err;
int depth;
/* Data block + inode block */ /* Data block + inode block */
reiserfs_write_lock(sb); reiserfs_write_lock(sb);
ret = journal_begin(&th, sb, 2); ret = journal_begin(&th, sb, 2);
if (ret) if (ret)
goto out; goto out;
reiserfs_write_unlock(sb); depth = reiserfs_write_unlock_nested(sb);
ret = dquot_commit_info(sb, type); ret = dquot_commit_info(sb, type);
reiserfs_write_lock(sb); reiserfs_write_lock_nested(sb, depth);
err = journal_end(&th, sb, 2); err = journal_end(&th, sb, 2);
if (!ret && err) if (!ret && err)
ret = err; ret = err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment