summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/ext4_common.c4
-rw-r--r--fs/ext4/ext4_write.c2
-rw-r--r--fs/fat/fat_write.c2
-rw-r--r--fs/jffs2/jffs2_1pass.c2
4 files changed, 4 insertions, 6 deletions
diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c
index 1c1172163c..33d69c9c71 100644
--- a/fs/ext4/ext4_common.c
+++ b/fs/ext4/ext4_common.c
@@ -1380,7 +1380,7 @@ void ext4fs_allocate_blocks(struct ext2_inode *file_inode,
unsigned int no_blks_reqd = 0;
/* allocation of direct blocks */
- for (i = 0; i < INDIRECT_BLOCKS; i++) {
+ for (i = 0; total_remaining_blocks && i < INDIRECT_BLOCKS; i++) {
direct_blockno = ext4fs_get_new_blk_no();
if (direct_blockno == -1) {
printf("no block left to assign\n");
@@ -1390,8 +1390,6 @@ void ext4fs_allocate_blocks(struct ext2_inode *file_inode,
debug("DB %ld: %u\n", direct_blockno, total_remaining_blocks);
total_remaining_blocks--;
- if (total_remaining_blocks == 0)
- break;
}
alloc_single_indirect_block(file_inode, &total_remaining_blocks,
diff --git a/fs/ext4/ext4_write.c b/fs/ext4/ext4_write.c
index c42add9a7e..648a59672c 100644
--- a/fs/ext4/ext4_write.c
+++ b/fs/ext4/ext4_write.c
@@ -840,7 +840,7 @@ int ext4fs_write(const char *fname, unsigned char *buffer,
unsigned int ibmap_idx;
struct ext_filesystem *fs = get_fs();
ALLOC_CACHE_ALIGN_BUFFER(char, filename, 256);
- memset(filename, 0x00, sizeof(filename));
+ memset(filename, 0x00, 256);
g_parent_inode = zalloc(sizeof(struct ext2_inode));
if (!g_parent_inode)
diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
index ba7e3aeb0b..24ed5d3715 100644
--- a/fs/fat/fat_write.c
+++ b/fs/fat/fat_write.c
@@ -947,7 +947,7 @@ static int do_fat_write(const char *filename, void *buffer,
total_sector = bs.total_sect;
if (total_sector == 0)
- total_sector = cur_part_info.size;
+ total_sector = (int)cur_part_info.size; /* cast of lbaint_t */
if (mydata->fatsize == 32)
mydata->fatlength = bs.fat32_length;
diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
index 3fb5db383e..b1d6470219 100644
--- a/fs/jffs2/jffs2_1pass.c
+++ b/fs/jffs2/jffs2_1pass.c
@@ -724,7 +724,7 @@ jffs2_1pass_read_inode(struct b_lists *pL, u32 inode, char *dest)
for (b = pL->frag.listHead; b != NULL; b = b->next) {
jNode = (struct jffs2_raw_inode *) get_node_mem(b->offset,
pL->readbuf);
- if ((inode == jNode->ino)) {
+ if (inode == jNode->ino) {
#if 0
putLabeledWord("\r\n\r\nread_inode: totlen = ", jNode->totlen);
putLabeledWord("read_inode: inode = ", jNode->ino);