mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anton Altaparmakov <aia21@cam.ac.uk>
To: kronos@kronoz.cjb.net
Cc: linux-kernel@vger.kernel.org, Jean Delvare <khali@linux-fr.org>,
	Bas Vermeulen <bvermeul@blackstar.nl>
Subject: Re: 2.6.14-rc1 - kernel BUG at fs/ntfs/aops.c:403
Date: Mon, 19 Sep 2005 10:39:07 +0100	[thread overview]
Message-ID: <1127122747.493.5.camel@imp.csi.cam.ac.uk> (raw)
In-Reply-To: <20050917145150.GA5481@dreamland.darkstar.lan>

Hi,

On Sat, 2005-09-17 at 16:51 +0200, Luca wrote:
> Jean Delvare <khali@linux-fr.org> ha scritto:
> > Hi Anton, Bas, all,
> > 
> > [Bas Vermeulen]
> >> > I get a kernel BUG when mounting my (dirty) NTFS volume.
> >> > 
> >> > Sep 12 18:54:47 laptop kernel: [4294708.961000] NTFS volume version
> >> > 3.1. Sep 12 18:54:47 laptop kernel: [4294708.961000] NTFS-fs error
> >> > (device sda2): load_system_files(): Volume is dirty.  Mounting
> >> > read-only.  Run chkdsk and mount in Windows.
> >> > Sep 12 18:54:47 laptop kernel: [4294709.063000] ------------[ cut
> >> > here ]------------
> >> > Sep 12 18:54:47 laptop kernel: [4294709.063000] kernel BUG at
> >> > fs/ntfs/aops.c:403!
> >
> > I just hit the same BUG in different conditions. My NTFS volume is not
> > dirty, not compressed and the BUG triggered on use (updatedb), not
> > mount.
> 
> Same here, but it only triggers accessing a compressed directory. I can
> reproduce at will just by using 'ls' inside a compressed dir.

Below is the fix I just sent off to Linus.

Best regards,

        Anton
-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/

Subject: [PATCH 2/3] NTFS: Fix handling of compressed directories that I broke in earlier changeset.

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

---

 fs/ntfs/aops.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

4e64c88693fde1b1cbaa4cfecad43a0c3fad354e
diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c
--- a/fs/ntfs/aops.c
+++ b/fs/ntfs/aops.c
@@ -389,9 +389,11 @@ retry_readpage:
 	 * Only $DATA attributes can be encrypted and only unnamed $DATA
 	 * attributes can be compressed.  Index root can have the flags set but
 	 * 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 (NInoEncrypted(ni)) {
 			BUG_ON(ni->type != AT_DATA);
@@ -1341,9 +1343,11 @@ retry_writepage:
 	 * Only $DATA attributes can be encrypted and only unnamed $DATA
 	 * attributes can be compressed.  Index root can have the flags set but
 	 * 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 (NInoEncrypted(ni)) {
 			unlock_page(page);



  reply	other threads:[~2005-09-19  9:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-15  7:29 Bas Vermeulen
2005-09-15  8:58 ` Anton Altaparmakov
2005-09-15 19:24   ` Bas Vermeulen
2005-09-15 21:21     ` Anton Altaparmakov
2005-09-15 22:14       ` Bas Vermeulen
2005-09-16  0:11         ` Anton Altaparmakov
2005-09-17  9:44   ` Jean Delvare
2005-09-17 14:51     ` Luca
2005-09-19  9:39       ` Anton Altaparmakov [this message]
2005-09-20 17:44         ` Luca
2005-09-20 17:47           ` Anton Altaparmakov
2005-09-21 18:37         ` Jean Delvare
2005-09-21 19:34           ` Anton Altaparmakov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1127122747.493.5.camel@imp.csi.cam.ac.uk \
    --to=aia21@cam.ac.uk \
    --cc=bvermeul@blackstar.nl \
    --cc=khali@linux-fr.org \
    --cc=kronos@kronoz.cjb.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®