Commit 4e64c886 authored by Anton Altaparmakov's avatar Anton Altaparmakov

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

Signed-off-by: default avatarAnton Altaparmakov <aia21@cantab.net>
parent 5c9f6de3
...@@ -389,9 +389,11 @@ static int ntfs_readpage(struct file *file, struct page *page) ...@@ -389,9 +389,11 @@ static int ntfs_readpage(struct file *file, struct page *page)
* Only $DATA attributes can be encrypted and only unnamed $DATA * Only $DATA attributes can be encrypted and only unnamed $DATA
* attributes can be compressed. Index root can have the flags set but * attributes can be compressed. Index root can have the flags set but
* this means to create compressed/encrypted files, not that the * this means to create compressed/encrypted files, not that the
* attribute is compressed/encrypted. * attribute is compressed/encrypted. Note we need to check for
* AT_INDEX_ALLOCATION since this is the type of both directory and
* index inodes.
*/ */
if (ni->type != AT_INDEX_ROOT) { if (ni->type != AT_INDEX_ALLOCATION) {
/* If attribute is encrypted, deny access, just like NT4. */ /* If attribute is encrypted, deny access, just like NT4. */
if (NInoEncrypted(ni)) { if (NInoEncrypted(ni)) {
BUG_ON(ni->type != AT_DATA); BUG_ON(ni->type != AT_DATA);
...@@ -1341,9 +1343,11 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc) ...@@ -1341,9 +1343,11 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc)
* Only $DATA attributes can be encrypted and only unnamed $DATA * Only $DATA attributes can be encrypted and only unnamed $DATA
* attributes can be compressed. Index root can have the flags set but * attributes can be compressed. Index root can have the flags set but
* this means to create compressed/encrypted files, not that the * this means to create compressed/encrypted files, not that the
* attribute is compressed/encrypted. * attribute is compressed/encrypted. Note we need to check for
* AT_INDEX_ALLOCATION since this is the type of both directory and
* index inodes.
*/ */
if (ni->type != AT_INDEX_ROOT) { if (ni->type != AT_INDEX_ALLOCATION) {
/* If file is encrypted, deny access, just like NT4. */ /* If file is encrypted, deny access, just like NT4. */
if (NInoEncrypted(ni)) { if (NInoEncrypted(ni)) {
unlock_page(page); unlock_page(page);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment