diff options
Diffstat (limited to 'fs/reiserfs/journal.c')
| -rw-r--r-- | fs/reiserfs/journal.c | 16 | 
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index ba98546fabb..19fbc810e8e 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c @@ -50,6 +50,7 @@  #include <linux/blkdev.h>  #include <linux/backing-dev.h>  #include <linux/uaccess.h> +#include <linux/slab.h>  #include <asm/system.h> @@ -2217,6 +2218,15 @@ static int journal_read_transaction(struct super_block *sb,  		brelse(d_bh);  		return 1;  	} + +	if (bdev_read_only(sb->s_bdev)) { +		reiserfs_warning(sb, "clm-2076", +				 "device is readonly, unable to replay log"); +		brelse(c_bh); +		brelse(d_bh); +		return -EROFS; +	} +  	trans_id = get_desc_trans_id(desc);  	/* now we know we've got a good transaction, and it was inside the valid time ranges */  	log_blocks = kmalloc(get_desc_trans_len(desc) * @@ -2459,12 +2469,6 @@ static int journal_read(struct super_block *sb)  		goto start_log_replay;  	} -	if (continue_replay && bdev_read_only(sb->s_bdev)) { -		reiserfs_warning(sb, "clm-2076", -				 "device is readonly, unable to replay log"); -		return -1; -	} -  	/* ok, there are transactions that need to be replayed.  start with the first log block, find  	 ** all the valid transactions, and pick out the oldest.  	 */  |