All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Martin Steigerwald <Martin@lichtvoll.de>
Cc: linux-xfs@oss.sgi.com
Subject: Re: xfs_fsr - problem with open files possible?
Date: Fri, 15 Jun 2007 11:58:25 -0500	[thread overview]
Message-ID: <4672C531.9020802@sandeen.net> (raw)
In-Reply-To: <200706151804.43067.Martin@lichtvoll.de>

Martin Steigerwald wrote:

> Could data loss happen when running xfs_fsr on files that are opened by an 
> application?

It should not; fsr performs a lot of safety checks and aborts under
problematic circumstances.  It will skip files if:

 * mandatory locks are present
 * file is marked immutable, append-only, or nodefrag
 * filesystem is shut down
 * change/modify times have been altered since defrag started
 * original file is mmapped

If you can clearly recreate it with xfs_fsr, it would be interesting to
compare the good & bad index files to see how they differ, it might
offer a clue as to what/why/how it changed.

> I did not came across any other corrupted files except a Mercurial 
> repository. I can not pinpoint this problem to XFS at all and have no 
> idea how and when it got corrupted. At least in my backup from some weeks 
> ago the repository has been okay. Unfortunately I do not know anymore 
> whether I made a commit to that repository while xfs_fsr was running or 
> not. But I think I didn't.
> 
> The filesystem itself was okay after fragmentation, I checked it via 
> xfs_check!
> 
> I can try to reproduce the problem. Would be handy tough to have an 
> xfs_fsr that can be limited only to operate on a certain directory and 
> its files and sub directories. This way I could create a new mailfolder, 
> copy some mails in there, have it opened so that KMail accesses the index 
> file and let xfs_fsr only run on this mailfolder.

>From the man page:

 Files marked as no-defrag will be skipped. The xfs_io(8) chattr command
 with the f attribute can be used to set or clear this flag.  Files  and
 directories created in a directory with the no-defrag flag will inherit
 the attribute.

so you can flag your mail directory or index files as no-defrag if you
like.  (I know this is the converse of what you wanted... but maybe helpful)

-Eric

> I can also open a bug report, but I first wanted to ask here.
> 
> Regards,

  reply	other threads:[~2007-06-15 17:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-15 16:04 xfs_fsr - problem with open files possible? Martin Steigerwald
2007-06-15 16:58 ` Eric Sandeen [this message]
2007-06-15 18:13   ` Martin Steigerwald
2007-06-15 20:04     ` Martin Steigerwald
2007-06-23 15:23   ` xfs_fsr and null byte areas in files (was: Re: xfs_fsr - problem with open files possible?) Martin Steigerwald

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=4672C531.9020802@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=Martin@lichtvoll.de \
    --cc=linux-xfs@oss.sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.