linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kirill Tkhai <ktkhai@virtuozzo.com>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu, jack@suse.com, adilger.kernel@dilger.ca,
	ktkhai@virtuozzo.com
Subject: [Q] e4defrag and append-only files
Date: Mon, 9 Dec 2019 13:54:24 +0300	[thread overview]
Message-ID: <a2b2fcf4-4b71-e78c-5a10-627097df44fb@virtuozzo.com> (raw)

Hi,

on one of production nodes I observe the situation, when many fragmented files
never become defragmented, becase of they have "a" extended attribute.
The reason is append-only file can't be open for write without O_APPEND attribute:

$lsattr a.txt
-----a--------e----- a.txt

$strace e4defrag a.txt
openat(AT_FDCWD, "a.txt", O_RDWR)       = -1 EPERM (Operation not permitted)

Simple O_APPEND passed to open() solves the situation.

The question is: can't we just do this?

Let's observe the file restrictions we may have.

"Append-only" extended attribute restriction is weaker, than RO file permissions (0444).
But RO files are being processed by e4defrag, since e4defrag runs by root, and it easily
ignores RO file permissions, while "append-only" files are always ignored by the util.
Is there a fundamental reason we must skip them?

Thanks,
Kirill

             reply	other threads:[~2019-12-09 10:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-09 10:54 Kirill Tkhai [this message]
2019-12-10 10:10 ` [Q] e4defrag and append-only files Jan Kara

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=a2b2fcf4-4b71-e78c-5a10-627097df44fb@virtuozzo.com \
    --to=ktkhai@virtuozzo.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=jack@suse.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).