diff options
Diffstat (limited to 'fs/ocfs2/super.c')
| -rw-r--r-- | fs/ocfs2/super.c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 26675185b886..403c5660b306 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
| @@ -2069,6 +2069,8 @@ static int ocfs2_initialize_super(struct super_block *sb, | |||
| 2069 | cbits = le32_to_cpu(di->id2.i_super.s_clustersize_bits); | 2069 | cbits = le32_to_cpu(di->id2.i_super.s_clustersize_bits); |
| 2070 | bbits = le32_to_cpu(di->id2.i_super.s_blocksize_bits); | 2070 | bbits = le32_to_cpu(di->id2.i_super.s_blocksize_bits); |
| 2071 | sb->s_maxbytes = ocfs2_max_file_offset(bbits, cbits); | 2071 | sb->s_maxbytes = ocfs2_max_file_offset(bbits, cbits); |
| 2072 | memcpy(sb->s_uuid, di->id2.i_super.s_uuid, | ||
| 2073 | sizeof(di->id2.i_super.s_uuid)); | ||
| 2072 | 2074 | ||
| 2073 | osb->osb_dx_mask = (1 << (cbits - bbits)) - 1; | 2075 | osb->osb_dx_mask = (1 << (cbits - bbits)) - 1; |
| 2074 | 2076 | ||
| @@ -2333,7 +2335,7 @@ static int ocfs2_initialize_super(struct super_block *sb, | |||
| 2333 | mlog_errno(status); | 2335 | mlog_errno(status); |
| 2334 | goto bail; | 2336 | goto bail; |
| 2335 | } | 2337 | } |
| 2336 | cleancache_init_shared_fs((char *)&di->id2.i_super.s_uuid, sb); | 2338 | cleancache_init_shared_fs(sb); |
| 2337 | 2339 | ||
| 2338 | bail: | 2340 | bail: |
| 2339 | return status; | 2341 | return status; |
| @@ -2563,22 +2565,22 @@ static void ocfs2_handle_error(struct super_block *sb) | |||
| 2563 | ocfs2_set_ro_flag(osb, 0); | 2565 | ocfs2_set_ro_flag(osb, 0); |
| 2564 | } | 2566 | } |
| 2565 | 2567 | ||
| 2566 | static char error_buf[1024]; | 2568 | void __ocfs2_error(struct super_block *sb, const char *function, |
| 2567 | 2569 | const char *fmt, ...) | |
| 2568 | void __ocfs2_error(struct super_block *sb, | ||
| 2569 | const char *function, | ||
| 2570 | const char *fmt, ...) | ||
| 2571 | { | 2570 | { |
| 2571 | struct va_format vaf; | ||
| 2572 | va_list args; | 2572 | va_list args; |
| 2573 | 2573 | ||
| 2574 | va_start(args, fmt); | 2574 | va_start(args, fmt); |
| 2575 | vsnprintf(error_buf, sizeof(error_buf), fmt, args); | 2575 | vaf.fmt = fmt; |
| 2576 | va_end(args); | 2576 | vaf.va = &args; |
| 2577 | 2577 | ||
| 2578 | /* Not using mlog here because we want to show the actual | 2578 | /* Not using mlog here because we want to show the actual |
| 2579 | * function the error came from. */ | 2579 | * function the error came from. */ |
| 2580 | printk(KERN_CRIT "OCFS2: ERROR (device %s): %s: %s\n", | 2580 | printk(KERN_CRIT "OCFS2: ERROR (device %s): %s: %pV\n", |
| 2581 | sb->s_id, function, error_buf); | 2581 | sb->s_id, function, &vaf); |
| 2582 | |||
| 2583 | va_end(args); | ||
| 2582 | 2584 | ||
| 2583 | ocfs2_handle_error(sb); | 2585 | ocfs2_handle_error(sb); |
| 2584 | } | 2586 | } |
| @@ -2586,18 +2588,21 @@ void __ocfs2_error(struct super_block *sb, | |||
| 2586 | /* Handle critical errors. This is intentionally more drastic than | 2588 | /* Handle critical errors. This is intentionally more drastic than |
| 2587 | * ocfs2_handle_error, so we only use for things like journal errors, | 2589 | * ocfs2_handle_error, so we only use for things like journal errors, |
| 2588 | * etc. */ | 2590 | * etc. */ |
| 2589 | void __ocfs2_abort(struct super_block* sb, | 2591 | void __ocfs2_abort(struct super_block *sb, const char *function, |
| 2590 | const char *function, | ||
| 2591 | const char *fmt, ...) | 2592 | const char *fmt, ...) |
| 2592 | { | 2593 | { |
| 2594 | struct va_format vaf; | ||
| 2593 | va_list args; | 2595 | va_list args; |
| 2594 | 2596 | ||
| 2595 | va_start(args, fmt); | 2597 | va_start(args, fmt); |
| 2596 | vsnprintf(error_buf, sizeof(error_buf), fmt, args); | ||
| 2597 | va_end(args); | ||
| 2598 | 2598 | ||
| 2599 | printk(KERN_CRIT "OCFS2: abort (device %s): %s: %s\n", | 2599 | vaf.fmt = fmt; |
| 2600 | sb->s_id, function, error_buf); | 2600 | vaf.va = &args; |
| 2601 | |||
| 2602 | printk(KERN_CRIT "OCFS2: abort (device %s): %s: %pV\n", | ||
| 2603 | sb->s_id, function, &vaf); | ||
| 2604 | |||
| 2605 | va_end(args); | ||
| 2601 | 2606 | ||
| 2602 | /* We don't have the cluster support yet to go straight to | 2607 | /* We don't have the cluster support yet to go straight to |
| 2603 | * hard readonly in here. Until then, we want to keep | 2608 | * hard readonly in here. Until then, we want to keep |
