From b8a55eb04ca7557608e32a083c4264ee9cb1beb0 Mon Sep 17 00:00:00 2001 From: Anton Altaparmakov Date: Sat, 25 Jun 2005 17:04:55 +0100 Subject: [PATCH] --- yaml --- r: 4879 b: refs/heads/master c: 1d58b27b8d77ecb816cfa8f846b78c845675eb89 h: refs/heads/master i: 4877: aa2cc41676605476ea65c46e2e5503ab336accae 4875: 2a6ce98ef917ad21d74adf467eb85ee1299f70ee 4871: 9b8a9cc499293669206c3df07f9afa9bf03515a7 4863: ded1aa481644ce48e4933c40a7e66a6fc182bfd2 v: v3 --- [refs] | 2 +- trunk/fs/ntfs/ChangeLog | 3 +++ trunk/fs/ntfs/attrib.c | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 1e6c083f99e3..8ca8d442a8f7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3bd1f4a173a3445f9919c21e775de2d8b9deacf8 +refs/heads/master: 1d58b27b8d77ecb816cfa8f846b78c845675eb89 diff --git a/trunk/fs/ntfs/ChangeLog b/trunk/fs/ntfs/ChangeLog index a916c8b0697a..aff749db314c 100644 --- a/trunk/fs/ntfs/ChangeLog +++ b/trunk/fs/ntfs/ChangeLog @@ -132,6 +132,9 @@ ToDo/Notes: with a 64-bit variable and a int, i.e. 32-bit, constant. This causes the higher order 32-bits of the 64-bit variable to be zeroed. To fix this cast the 'const' to the same 64-bit type as 'var'. + - Change the runlist terminator of the newly allocated cluster(s) to + LCN_ENOENT in ntfs_attr_make_non_resident(). Otherwise the runlist + code gets confused. 2.1.22 - Many bug and race fixes and error handling improvements. diff --git a/trunk/fs/ntfs/attrib.c b/trunk/fs/ntfs/attrib.c index 104eedfb2507..34ea405b883d 100644 --- a/trunk/fs/ntfs/attrib.c +++ b/trunk/fs/ntfs/attrib.c @@ -1285,6 +1285,8 @@ int ntfs_attr_make_non_resident(ntfs_inode *ni) new_size = (i_size_read(vi) + vol->cluster_size - 1) & ~(vol->cluster_size - 1); if (new_size > 0) { + runlist_element *rl2; + /* * Will need the page later and since the page lock nests * outside all ntfs locks, we need to get the page now. @@ -1304,6 +1306,12 @@ int ntfs_attr_make_non_resident(ntfs_inode *ni) err); goto page_err_out; } + /* Change the runlist terminator to LCN_ENOENT. */ + rl2 = rl; + while (rl2->length) + rl2++; + BUG_ON(rl2->lcn != LCN_RL_NOT_MAPPED); + rl2->lcn = LCN_ENOENT; } else { rl = NULL; page = NULL;