linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: bugzilla-daemon@bugzilla.kernel.org
To: linux-ext4@vger.kernel.org
Subject: [Bug 103111] auto_da_alloc mount option not working
Date: Tue, 25 Aug 2015 18:05:08 +0000	[thread overview]
Message-ID: <bug-103111-13602-p1cj6XgNGT@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-103111-13602@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=103111

--- Comment #11 from Eric Sandeen <sandeen@redhat.com> ---
IOWS, it handles these two cases:

fd = open("foo.new")
write(fd,..)
close(fd)
rename("foo.new", "foo") // syncs out foo.new if it has delalloc blocks

and

fd = open("foo", O_TRUNC)
write(fd,..)
close(fd) // syncs out foo if "foo" had blocks prior to the O_TRUNC truncate

Your testcase does this if foo.new doesn't already exist:

fd = open("foo.new", O_TRUNC) // if foo.new has no blocks, O_TRUNC does nothing
rename("foo.new", "foo") // foo.new has no delalloc blocks, does nothing
write(fd)
close(fd) 

If "foo.new" does exist, 

fd = open("foo.new", O_TRUNC) // if foo.new has blocks, sets da_alloc flag
rename("foo.new", "foo") // foo.new has no delalloc blocks, does nothing
write(fd)
close(fd) // syncs out the data

IOWS, if example.txt starts with allocated blocks, this:

# rm example.txt1
# echo foobar > example.txt
# sync
# ./testcase

works as you hope, because testcase does:

fd = open("example.txt", O_TRUNC) // example.txt has blocks, sets da_alloc flag
rename("example.txt", "example.txt1") // "example.txt" no has delalloc blocks
nothing happens
write(fd) // now we have delalloc blocks
close(fd) // syncs out the data


So it's not that the heuristic is broken; your testcase just doesn't
necessarily meet the conditions of the heuristic.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

  parent reply	other threads:[~2015-08-25 18:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-19 13:34 [Bug 103111] New: auto_da_alloc mount option not working bugzilla-daemon
2015-08-19 16:13 ` [Bug 103111] " bugzilla-daemon
2015-08-20  5:48 ` bugzilla-daemon
2015-08-20  5:53 ` bugzilla-daemon
2015-08-20  5:54 ` bugzilla-daemon
2015-08-21 14:56 ` bugzilla-daemon
2015-08-21 14:59 ` bugzilla-daemon
2015-08-21 15:13 ` bugzilla-daemon
2015-08-21 15:16 ` bugzilla-daemon
2015-08-21 18:36 ` bugzilla-daemon
2015-08-25 17:49 ` bugzilla-daemon
2015-08-25 18:05 ` bugzilla-daemon [this message]
2015-08-28 16:49 ` bugzilla-daemon
2015-08-28 16:51 ` bugzilla-daemon
2015-08-29  3:25 ` bugzilla-daemon
2015-08-29  3:28 ` bugzilla-daemon
2015-08-29 19:33 ` bugzilla-daemon

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=bug-103111-13602-p1cj6XgNGT@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@bugzilla.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).