Commit 62688e5b authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs

Pull UDF, ext3 & reiserfs fixes from Jan Kara:
 "A couple of fixes (udf, reiserfs, ext3) that accumulated over my
  vacation."

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  udf: fix retun value on error path in udf_load_logicalvol
  jbd: don't write superblock when unmounting an ro filesystem
  reiserfs: fix deadlocks with quotas
  quota: Move down dqptr_sem read after initializing default warn[] type at __dquot_alloc_space().
  UDF: During mount free lvid_bh before rescanning with different blocksize
  udf: fix udf_setsize() for file data in ICB
parents f4673d6f 68766a2e
...@@ -1113,6 +1113,11 @@ static void mark_journal_empty(journal_t *journal) ...@@ -1113,6 +1113,11 @@ static void mark_journal_empty(journal_t *journal)
BUG_ON(!mutex_is_locked(&journal->j_checkpoint_mutex)); BUG_ON(!mutex_is_locked(&journal->j_checkpoint_mutex));
spin_lock(&journal->j_state_lock); spin_lock(&journal->j_state_lock);
/* Is it already empty? */
if (sb->s_start == 0) {
spin_unlock(&journal->j_state_lock);
return;
}
jbd_debug(1, "JBD: Marking journal as empty (seq %d)\n", jbd_debug(1, "JBD: Marking journal as empty (seq %d)\n",
journal->j_tail_sequence); journal->j_tail_sequence);
......
...@@ -1589,10 +1589,10 @@ int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags) ...@@ -1589,10 +1589,10 @@ int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags)
goto out; goto out;
} }
down_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
for (cnt = 0; cnt < MAXQUOTAS; cnt++) for (cnt = 0; cnt < MAXQUOTAS; cnt++)
warn[cnt].w_type = QUOTA_NL_NOWARN; warn[cnt].w_type = QUOTA_NL_NOWARN;
down_read(&sb_dqopt(inode->i_sb)->dqptr_sem);
spin_lock(&dq_data_lock); spin_lock(&dq_data_lock);
for (cnt = 0; cnt < MAXQUOTAS; cnt++) { for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
if (!dquots[cnt]) if (!dquots[cnt])
......
...@@ -1334,9 +1334,7 @@ struct buffer_head *reiserfs_read_bitmap_block(struct super_block *sb, ...@@ -1334,9 +1334,7 @@ struct buffer_head *reiserfs_read_bitmap_block(struct super_block *sb,
else if (bitmap == 0) else if (bitmap == 0)
block = (REISERFS_DISK_OFFSET_IN_BYTES >> sb->s_blocksize_bits) + 1; block = (REISERFS_DISK_OFFSET_IN_BYTES >> sb->s_blocksize_bits) + 1;
reiserfs_write_unlock(sb);
bh = sb_bread(sb, block); bh = sb_bread(sb, block);
reiserfs_write_lock(sb);
if (bh == NULL) if (bh == NULL)
reiserfs_warning(sb, "sh-2029: %s: bitmap block (#%u) " reiserfs_warning(sb, "sh-2029: %s: bitmap block (#%u) "
"reading failed", __func__, block); "reading failed", __func__, block);
......
...@@ -76,10 +76,10 @@ void reiserfs_evict_inode(struct inode *inode) ...@@ -76,10 +76,10 @@ void reiserfs_evict_inode(struct inode *inode)
; ;
} }
out: out:
reiserfs_write_unlock_once(inode->i_sb, depth);
clear_inode(inode); /* note this must go after the journal_end to prevent deadlock */ clear_inode(inode); /* note this must go after the journal_end to prevent deadlock */
dquot_drop(inode); dquot_drop(inode);
inode->i_blocks = 0; inode->i_blocks = 0;
reiserfs_write_unlock_once(inode->i_sb, depth);
return; return;
no_delete: no_delete:
......
...@@ -1124,14 +1124,17 @@ int udf_setsize(struct inode *inode, loff_t newsize) ...@@ -1124,14 +1124,17 @@ int udf_setsize(struct inode *inode, loff_t newsize)
if (err) if (err)
return err; return err;
down_write(&iinfo->i_data_sem); down_write(&iinfo->i_data_sem);
} else } else {
iinfo->i_lenAlloc = newsize; iinfo->i_lenAlloc = newsize;
goto set_size;
}
} }
err = udf_extend_file(inode, newsize); err = udf_extend_file(inode, newsize);
if (err) { if (err) {
up_write(&iinfo->i_data_sem); up_write(&iinfo->i_data_sem);
return err; return err;
} }
set_size:
truncate_setsize(inode, newsize); truncate_setsize(inode, newsize);
up_write(&iinfo->i_data_sem); up_write(&iinfo->i_data_sem);
} else { } else {
......
...@@ -1344,6 +1344,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, ...@@ -1344,6 +1344,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
udf_err(sb, "error loading logical volume descriptor: " udf_err(sb, "error loading logical volume descriptor: "
"Partition table too long (%u > %lu)\n", table_len, "Partition table too long (%u > %lu)\n", table_len,
sb->s_blocksize - sizeof(*lvd)); sb->s_blocksize - sizeof(*lvd));
ret = 1;
goto out_bh; goto out_bh;
} }
...@@ -1388,8 +1389,10 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, ...@@ -1388,8 +1389,10 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block,
UDF_ID_SPARABLE, UDF_ID_SPARABLE,
strlen(UDF_ID_SPARABLE))) { strlen(UDF_ID_SPARABLE))) {
if (udf_load_sparable_map(sb, map, if (udf_load_sparable_map(sb, map,
(struct sparablePartitionMap *)gpm) < 0) (struct sparablePartitionMap *)gpm) < 0) {
ret = 1;
goto out_bh; goto out_bh;
}
} else if (!strncmp(upm2->partIdent.ident, } else if (!strncmp(upm2->partIdent.ident,
UDF_ID_METADATA, UDF_ID_METADATA,
strlen(UDF_ID_METADATA))) { strlen(UDF_ID_METADATA))) {
...@@ -2000,6 +2003,8 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) ...@@ -2000,6 +2003,8 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
if (!silent) if (!silent)
pr_notice("Rescanning with blocksize %d\n", pr_notice("Rescanning with blocksize %d\n",
UDF_DEFAULT_BLOCKSIZE); UDF_DEFAULT_BLOCKSIZE);
brelse(sbi->s_lvid_bh);
sbi->s_lvid_bh = NULL;
uopt.blocksize = UDF_DEFAULT_BLOCKSIZE; uopt.blocksize = UDF_DEFAULT_BLOCKSIZE;
ret = udf_load_vrs(sb, &uopt, silent, &fileset); ret = udf_load_vrs(sb, &uopt, silent, &fileset);
} }
......
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