Jim Meyering píše v Pá 17. 04. 2009 v 13:54 +0200: > Ondřej Vašík wrote: > > as reported in rhbz #496142 by Eric Sandeen, mv produces a lot of > > unwanted messages when moving files to filesystem without xattr support. > > I guess mv selinux/xattr diagnostic error messages should be reduced as > > is done for cp -a, attached patch should do that. > ... > > + mv: do not produce diagnostic errors for preserving xattr's to > > + prevent message spam on file systems without xattr support. > > Thanks for the patch, but mv's charter is stricter than that of cp -a. > I.e., people expect mv to preserve all attributes when the source > and destination are on the same file system, so IMHO, failure to > preserve any attribute (e.g., for an inter-device mv) requires > _some_ diagnosis.
Ok, reduce_diagnostics only reduces diagnostic messages for recently
added SELinux and xattrs which were completely ignored in the past - so
I don't think that people expect mv to preserve them all the time.
SELinux preserving failures were already suppresed in mv for ENOTSUP and
ENODATA in the past and as xattrs are similar and were added just few
months ago, it could be handled same way. However the situation slightly
differs - as SELinux preserving diagnostics are handled directly by
copy.c and xattrs preserving are handled by libattr - so there is no
easy way how to suppress at least ENOTSUP and ENODATA type errors like
done for SELinux.
> However, when there are many files, and mv is failing to preserve some
> attribute repeatedly, it would make sense to print only the first N
> such diagnostics, and then for the N+1st, print one more saying that
> there have been additional attribute-preservation failures, but mv will
> not display any more.
Changing proposed patch to not display diagnostics for ENODATA and
ENOTSUP errno's - as is done for mv and SELinux contexts.
Proposed patch attached...
Greetings,
Ondřej
From ea6855ed3311566e343a46cd5321c763967b7d1d Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?= <[email protected]> Date: Fri, 17 Apr 2009 11:00:35 +0200 Subject: [PATCH] mv: do not produce xattr preserving failures when not supported by filesystem src/copy.c: Do not show error diagnostics when xattrs not supported (reported by Eric Sandeen in rhbz #496142) --- NEWS | 3 +++ src/copy.c | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index d8ffde0..063d07f 100644 --- a/NEWS +++ b/NEWS @@ -42,6 +42,9 @@ GNU coreutils NEWS -*- outline -*- LS_COLORS environment variable. To disable it you can add something like this to your profile: eval `dircolors | sed s/hl=[^:]*:/hl=:/` + mv: do not produce diagnostic errors for preserving xattr's on file + systems without xattr support. + * Noteworthy changes in release 7.1 (2009-02-21) [stable] diff --git a/src/copy.c b/src/copy.c index 9b0e139..b21c098 100644 --- a/src/copy.c +++ b/src/copy.c @@ -139,10 +139,13 @@ copy_attr_error (struct error_context *ctx ATTRIBUTE_UNUSED, int err = errno; va_list ap; - /* use verror module to print error message */ - va_start (ap, fmt); - verror (0, err, fmt, ap); - va_end (ap); + if (errno != ENOTSUP && errno != ENODATA) + { + /* use verror module to print error message */ + va_start (ap, fmt); + verror (0, err, fmt, ap); + va_end (ap); + } } static char const * -- 1.5.6.1.156.ge903b
signature.asc
Description: Toto je digitálně podepsaná část zprávy
_______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
