aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ntfs/ChangeLog3
-rw-r--r--fs/ntfs/attrib.c8
2 files changed, 11 insertions, 0 deletions
diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog
index a916c8b0697a..aff749db314c 100644
--- a/fs/ntfs/ChangeLog
+++ b/fs/ntfs/ChangeLog
@@ -132,6 +132,9 @@ ToDo/Notes:
132 with a 64-bit variable and a int, i.e. 32-bit, constant. This causes 132 with a 64-bit variable and a int, i.e. 32-bit, constant. This causes
133 the higher order 32-bits of the 64-bit variable to be zeroed. To fix 133 the higher order 32-bits of the 64-bit variable to be zeroed. To fix
134 this cast the 'const' to the same 64-bit type as 'var'. 134 this cast the 'const' to the same 64-bit type as 'var'.
135 - Change the runlist terminator of the newly allocated cluster(s) to
136 LCN_ENOENT in ntfs_attr_make_non_resident(). Otherwise the runlist
137 code gets confused.
135 138
1362.1.22 - Many bug and race fixes and error handling improvements. 1392.1.22 - Many bug and race fixes and error handling improvements.
137 140
diff --git a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c
index 104eedfb2507..34ea405b883d 100644
--- a/fs/ntfs/attrib.c
+++ b/fs/ntfs/attrib.c
@@ -1285,6 +1285,8 @@ int ntfs_attr_make_non_resident(ntfs_inode *ni)
1285 new_size = (i_size_read(vi) + vol->cluster_size - 1) & 1285 new_size = (i_size_read(vi) + vol->cluster_size - 1) &
1286 ~(vol->cluster_size - 1); 1286 ~(vol->cluster_size - 1);
1287 if (new_size > 0) { 1287 if (new_size > 0) {
1288 runlist_element *rl2;
1289
1288 /* 1290 /*
1289 * Will need the page later and since the page lock nests 1291 * Will need the page later and since the page lock nests
1290 * outside all ntfs locks, we need to get the page now. 1292 * outside all ntfs locks, we need to get the page now.
@@ -1304,6 +1306,12 @@ int ntfs_attr_make_non_resident(ntfs_inode *ni)
1304 err); 1306 err);
1305 goto page_err_out; 1307 goto page_err_out;
1306 } 1308 }
1309 /* Change the runlist terminator to LCN_ENOENT. */
1310 rl2 = rl;
1311 while (rl2->length)
1312 rl2++;
1313 BUG_ON(rl2->lcn != LCN_RL_NOT_MAPPED);
1314 rl2->lcn = LCN_ENOENT;
1307 } else { 1315 } else {
1308 rl = NULL; 1316 rl = NULL;
1309 page = NULL; 1317 page = NULL;