diff options
Diffstat (limited to 'e2fsprogs/util.c')
-rw-r--r-- | e2fsprogs/util.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/e2fsprogs/util.c b/e2fsprogs/util.c index 3902f7ef3..537021df7 100644 --- a/e2fsprogs/util.c +++ b/e2fsprogs/util.c | |||
@@ -89,14 +89,20 @@ void check_mount(const char *device, int force, const char *type) | |||
89 | bb_error_msg("Could not determine if %s is mounted", device); | 89 | bb_error_msg("Could not determine if %s is mounted", device); |
90 | return; | 90 | return; |
91 | } | 91 | } |
92 | if (!(mount_flags & EXT2_MF_MOUNTED)) | 92 | if (mount_flags & EXT2_MF_MOUNTED) { |
93 | return; | 93 | bb_error_msg("%s is mounted !", device); |
94 | force_check: | ||
95 | if (force) | ||
96 | bb_error_msg("badblocks forced anyways"); | ||
97 | else | ||
98 | bb_error_msg_and_die("it's not safe to run badblocks!"); | ||
99 | } | ||
100 | |||
101 | if (mount_flags & EXT2_MF_BUSY) { | ||
102 | bb_error_msg("%s is apparently in use by the system", device); | ||
103 | goto force_check; | ||
104 | } | ||
94 | 105 | ||
95 | bb_error_msg("%s is mounted !", device); | ||
96 | if (force) | ||
97 | bb_error_msg("forcing anyways and ignoring /etc/mtab status"); | ||
98 | else | ||
99 | bb_error_msg_and_die("will not make a %s here!", type); | ||
100 | } | 106 | } |
101 | 107 | ||
102 | void parse_journal_opts(char **journal_device, int *journal_flags, | 108 | void parse_journal_opts(char **journal_device, int *journal_flags, |
@@ -189,10 +195,14 @@ int figure_journal_size(int size, ext2_filsys fs) | |||
189 | 195 | ||
190 | if (fs->super->s_blocks_count < 32768) | 196 | if (fs->super->s_blocks_count < 32768) |
191 | j_blocks = 1024; | 197 | j_blocks = 1024; |
192 | else if (fs->super->s_blocks_count < 262144) | 198 | else if (fs->super->s_blocks_count < 256*1024) |
193 | j_blocks = 4096; | 199 | j_blocks = 4096; |
194 | else | 200 | else if (fs->super->s_blocks_count < 512*1024) |
195 | j_blocks = 8192; | 201 | j_blocks = 8192; |
202 | else if (fs->super->s_blocks_count < 1024*1024) | ||
203 | j_blocks = 16384; | ||
204 | else | ||
205 | j_blocks = 32768; | ||
196 | 206 | ||
197 | return j_blocks; | 207 | return j_blocks; |
198 | } | 208 | } |