public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Ted Ts'o <tytso@mit.edu>
To: Lukas Czerner <lczerner@redhat.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH] ext4: setattr: Forbid setting data journalling when delalloc enabled
Date: Mon, 9 Jan 2012 10:55:04 -0500	[thread overview]
Message-ID: <20120109155504.GE22175@thunk.org> (raw)
In-Reply-To: <1326123903-21040-1-git-send-email-lczerner@redhat.com>

On Mon, Jan 09, 2012 at 04:45:03PM +0100, Lukas Czerner wrote:
> Ext4 does not support data journalling with delayed allocation enabled.
> We even does not allow to mount the file system with delayed allocation
> and data journalling enabled, but it can be set via FS_IOC_SETFLAGS
> which is wrong.
> 
> When data journalling and delayed allocation is enabled it can lead to
> troubles. Here is one example how to reproduce an oops:
> 
>  mkfs.ext4 /dev/sdd
>  mount /dev/sdd /mnt/test1
>  dd if=/dev/zero of=/mnt/test1/file bs=1M count=4
>  chattr +j /mnt/test1/file
>  dd if=/dev/zero of=/mnt/test1/file bs=1M count=4 conv=notrunc
>  chattr -j /mnt/test1/file
> 
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>

Don't we also need to add a check in ext4_should_journal_data() in
fs/ext4/ext4_jbd2.h?  Otherwise we could get in trouble if the data
journalling flag had been set previously when the file system was
mounted nodelalloc.

In fact it could be argued that we don't need to return EOPNOSUPP, or
printk a message, but simply make sure that the data journal flag is
ignored in if delayed allocation is enabled.  If that's true, we can
allow the user to set or clear the journal flag as much as they like;
it would just be ignored.

Thanks,

					- Ted

  reply	other threads:[~2012-01-09 15:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-09 15:45 [PATCH] ext4: setattr: Forbid setting data journalling when delalloc enabled Lukas Czerner
2012-01-09 15:55 ` Ted Ts'o [this message]
2012-01-09 16:22   ` Lukas Czerner

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=20120109155504.GE22175@thunk.org \
    --to=tytso@mit.edu \
    --cc=lczerner@redhat.com \
    --cc=linux-ext4@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