NTFS: Fix handling of compressed directories that I broke in earlier changeset.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>

+8 -4
+8 -4
fs/ntfs/aops.c
··· 389 389 * Only $DATA attributes can be encrypted and only unnamed $DATA 390 390 * attributes can be compressed. Index root can have the flags set but 391 391 * this means to create compressed/encrypted files, not that the 392 - * attribute is compressed/encrypted. 392 + * attribute is compressed/encrypted. Note we need to check for 393 + * AT_INDEX_ALLOCATION since this is the type of both directory and 394 + * index inodes. 393 395 */ 394 - if (ni->type != AT_INDEX_ROOT) { 396 + if (ni->type != AT_INDEX_ALLOCATION) { 395 397 /* If attribute is encrypted, deny access, just like NT4. */ 396 398 if (NInoEncrypted(ni)) { 397 399 BUG_ON(ni->type != AT_DATA); ··· 1343 1341 * Only $DATA attributes can be encrypted and only unnamed $DATA 1344 1342 * attributes can be compressed. Index root can have the flags set but 1345 1343 * this means to create compressed/encrypted files, not that the 1346 - * attribute is compressed/encrypted. 1344 + * attribute is compressed/encrypted. Note we need to check for 1345 + * AT_INDEX_ALLOCATION since this is the type of both directory and 1346 + * index inodes. 1347 1347 */ 1348 - if (ni->type != AT_INDEX_ROOT) { 1348 + if (ni->type != AT_INDEX_ALLOCATION) { 1349 1349 /* If file is encrypted, deny access, just like NT4. */ 1350 1350 if (NInoEncrypted(ni)) { 1351 1351 unlock_page(page);