Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog.
+2.1.5:
+ - Minor bug fix in attribute list attribute handling that fixes the
+ I/O errors on "ls" of certain fragmented files found by at least two
+ people running Windows XP.
2.1.4:
- Minor update allowing compilation with all gcc versions (well, the
ones the kernel can be compiled with anyway).
sufficient for synchronisation here. We then just need to make sure
ntfs_readpage/writepage/truncate interoperate properly with us.
+2.1.5 - Fix minor bug in attribute list attribute handling.
+
+ - Fix bug in attribute list handling. Actually it is not as much a bug
+ as too much protection in that we were not allowing attribute lists
+ which waste space on disk while Windows XP clearly allows it and in
+ fact creates such attribute lists so our driver was failing.
+ - Update NTFS documentation ready for 2.6 kernel release.
+
2.1.4 - Reduce compiler requirements.
- Remove all uses of unnamed structs and unions in the driver to make
* load_attribute_list - load an attribute list into memory
* @vol: ntfs volume from which to read
* @run_list: run list of the attribute list
- * @al: destination buffer
+ * @al_start: destination buffer
* @size: size of the destination buffer in bytes
* @initialized_size: initialized size of the attribute list
*
*
* Return 0 on success or -errno on error.
*/
-int load_attribute_list(ntfs_volume *vol, run_list *run_list, u8 *al,
+int load_attribute_list(ntfs_volume *vol, run_list *run_list, u8 *al_start,
const s64 size, const s64 initialized_size)
{
LCN lcn;
+ u8 *al = al_start;
u8 *al_end = al + initialized_size;
run_list_element *rl;
struct buffer_head *bh;
}
if (initialized_size < size) {
initialize:
- memset(al + initialized_size, 0, size - initialized_size);
+ memset(al_start + initialized_size, 0, size - initialized_size);
}
done:
up_read(&run_list->lock);
return err;
do_final:
if (al < al_end) {
- /* Partial block. */
- memcpy(al, bh->b_data, al_end - al);
- brelse(bh);
/*
- * Skip sanity checking if initialized_size < size as it is
- * too much trouble.
+ * Partial block.
+ *
+ * Note: The attribute list can be smaller than its allocation
+ * by multiple clusters. This has been encountered by at least
+ * two people running Windows XP, thus we cannot do any
+ * truncation sanity checking here. (AIA)
*/
+ memcpy(al, bh->b_data, al_end - al);
+ brelse(bh);
if (initialized_size < size)
goto initialize;
- /* If the final lcn is partial all is fine. */
- if (((s64)(block - (lcn << vol->cluster_size_bits >>
- block_size_bits)) << block_size_bits >>
- vol->cluster_size_bits) == rl->length - 1) {
- if (!rl[1].length || (rl[1].lcn == LCN_RL_NOT_MAPPED
- && !rl[2].length))
- goto done;
- }
- } else
- brelse(bh);
+ goto done;
+ }
+ brelse(bh);
/* Real overflow! */
ntfs_error(sb, "Attribute list buffer overflow. Read attribute list "
"is truncated.");
const IGNORE_CASE_BOOL ic, const VCN lowest_vcn, const u8 *val,
const u32 val_len, attr_search_context *ctx);
-extern int load_attribute_list(ntfs_volume *vol, run_list *rl, u8 *al,
+extern int load_attribute_list(ntfs_volume *vol, run_list *rl, u8 *al_start,
const s64 size, const s64 initialized_size);
static inline s64 attribute_value_length(const ATTR_RECORD *a)