|
@@ -476,6 +476,7 @@ int fat_alloc_clusters(struct inode *inode, int *cluster, int nr_cluster)
|
|
sbi->prev_free = entry;
|
|
sbi->prev_free = entry;
|
|
if (sbi->free_clusters != -1)
|
|
if (sbi->free_clusters != -1)
|
|
sbi->free_clusters--;
|
|
sbi->free_clusters--;
|
|
|
|
+ sb->s_dirt = 1;
|
|
|
|
|
|
cluster[idx_clus] = entry;
|
|
cluster[idx_clus] = entry;
|
|
idx_clus++;
|
|
idx_clus++;
|
|
@@ -496,6 +497,7 @@ int fat_alloc_clusters(struct inode *inode, int *cluster, int nr_cluster)
|
|
|
|
|
|
/* Couldn't allocate the free entries */
|
|
/* Couldn't allocate the free entries */
|
|
sbi->free_clusters = 0;
|
|
sbi->free_clusters = 0;
|
|
|
|
+ sb->s_dirt = 1;
|
|
err = -ENOSPC;
|
|
err = -ENOSPC;
|
|
|
|
|
|
out:
|
|
out:
|
|
@@ -509,7 +511,6 @@ out:
|
|
}
|
|
}
|
|
for (i = 0; i < nr_bhs; i++)
|
|
for (i = 0; i < nr_bhs; i++)
|
|
brelse(bhs[i]);
|
|
brelse(bhs[i]);
|
|
- fat_clusters_flush(sb);
|
|
|
|
|
|
|
|
if (err && idx_clus)
|
|
if (err && idx_clus)
|
|
fat_free_clusters(inode, cluster[0]);
|
|
fat_free_clusters(inode, cluster[0]);
|
|
@@ -542,8 +543,10 @@ int fat_free_clusters(struct inode *inode, int cluster)
|
|
}
|
|
}
|
|
|
|
|
|
ops->ent_put(&fatent, FAT_ENT_FREE);
|
|
ops->ent_put(&fatent, FAT_ENT_FREE);
|
|
- if (sbi->free_clusters != -1)
|
|
|
|
|
|
+ if (sbi->free_clusters != -1) {
|
|
sbi->free_clusters++;
|
|
sbi->free_clusters++;
|
|
|
|
+ sb->s_dirt = 1;
|
|
|
|
+ }
|
|
|
|
|
|
if (nr_bhs + fatent.nr_bhs > MAX_BUF_PER_PAGE) {
|
|
if (nr_bhs + fatent.nr_bhs > MAX_BUF_PER_PAGE) {
|
|
if (sb->s_flags & MS_SYNCHRONOUS) {
|
|
if (sb->s_flags & MS_SYNCHRONOUS) {
|
|
@@ -605,6 +608,7 @@ int fat_count_free_clusters(struct super_block *sb)
|
|
} while (fat_ent_next(sbi, &fatent));
|
|
} while (fat_ent_next(sbi, &fatent));
|
|
}
|
|
}
|
|
sbi->free_clusters = free;
|
|
sbi->free_clusters = free;
|
|
|
|
+ sb->s_dirt = 1;
|
|
fatent_brelse(&fatent);
|
|
fatent_brelse(&fatent);
|
|
out:
|
|
out:
|
|
unlock_fat(sbi);
|
|
unlock_fat(sbi);
|