aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ntfs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ntfs/file.c')
-rw-r--r--fs/ntfs/file.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c
index cf2a0e2330df..5fb341a16b52 100644
--- a/fs/ntfs/file.c
+++ b/fs/ntfs/file.c
@@ -1857,10 +1857,24 @@ static ssize_t ntfs_file_buffered_write(struct kiocb *iocb,
1857 if (ni->type != AT_INDEX_ALLOCATION) { 1857 if (ni->type != AT_INDEX_ALLOCATION) {
1858 /* If file is encrypted, deny access, just like NT4. */ 1858 /* If file is encrypted, deny access, just like NT4. */
1859 if (NInoEncrypted(ni)) { 1859 if (NInoEncrypted(ni)) {
1860 /*
1861 * Reminder for later: Encrypted files are _always_
1862 * non-resident so that the content can always be
1863 * encrypted.
1864 */
1860 ntfs_debug("Denying write access to encrypted file."); 1865 ntfs_debug("Denying write access to encrypted file.");
1861 return -EACCES; 1866 return -EACCES;
1862 } 1867 }
1863 if (NInoCompressed(ni)) { 1868 if (NInoCompressed(ni)) {
1869 /* Only unnamed $DATA attribute can be compressed. */
1870 BUG_ON(ni->type != AT_DATA);
1871 BUG_ON(ni->name_len);
1872 /*
1873 * Reminder for later: If resident, the data is not
1874 * actually compressed. Only on the switch to non-
1875 * resident does compression kick in. This is in
1876 * contrast to encrypted files (see above).
1877 */
1864 ntfs_error(vi->i_sb, "Writing to compressed files is " 1878 ntfs_error(vi->i_sb, "Writing to compressed files is "
1865 "not implemented yet. Sorry."); 1879 "not implemented yet. Sorry.");
1866 return -EOPNOTSUPP; 1880 return -EOPNOTSUPP;