Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libperfuse Setting mode by fchmod(2) will break on glust...



details:   https://anonhg.NetBSD.org/src/rev/ced5a8426f31
branches:  trunk
changeset: 779438:ced5a8426f31
user:      manu <manu%NetBSD.org@localhost>
date:      Mon May 28 02:13:32 2012 +0000

description:
Setting mode by fchmod(2) will break on glusterfs-3.3 is we attempt
to set atime and mtime at the same time. Detect that situation just
like we detected ftruncate(2) and wipe atime and mtime if it occurs.

diffstat:

 lib/libperfuse/ops.c |  15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diffs (29 lines):

diff -r cad2d855246e -r ced5a8426f31 lib/libperfuse/ops.c
--- a/lib/libperfuse/ops.c      Mon May 28 00:45:31 2012 +0000
+++ b/lib/libperfuse/ops.c      Mon May 28 02:13:32 2012 +0000
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.54 2012/04/18 00:57:21 manu Exp $ */
+/*  $NetBSD: ops.c,v 1.55 2012/05/28 02:13:32 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -1849,6 +1849,19 @@
                fsi->mtimensec = 0;
                fsi->valid &= ~(FUSE_FATTR_ATIME|FUSE_FATTR_MTIME);
        }
+
+       /*
+        * There is the same mess with fchmod()
+        */
+       if ((vap->va_mode != (mode_t)PUFFS_VNOVAL) &&
+           (vap->va_uid == (uid_t)PUFFS_VNOVAL) &&
+           (vap->va_gid == (gid_t)PUFFS_VNOVAL)) {
+               fsi->atime = 0;
+               fsi->atimensec = 0;
+               fsi->mtime = 0;
+               fsi->mtimensec = 0;
+               fsi->valid &= ~(FUSE_FATTR_ATIME|FUSE_FATTR_MTIME);
+       }
                    
        /*
         * If nothing remain, discard the operation.



Home | Main Index | Thread Index | Old Index