Whamcloud - gitweb
b=7278
authorgreen <green>
Thu, 11 Aug 2005 10:47:53 +0000 (10:47 +0000)
committergreen <green>
Thu, 11 Aug 2005 10:47:53 +0000 (10:47 +0000)
r=adilger
Trick libsysio not to enforce O_EXCL open flag. MDS will enforce it for us.

lustre/ChangeLog
lustre/liblustre/namei.c

index d19a51d..73e759e 100644 (file)
@@ -33,6 +33,12 @@ Details    : The MDS has an upcall /proc/fs/lustre/mds/{mds}/group_upcall
              (set to /usr/sbin/l_getgroups if enabled) which will do MDS-side
              lookups for user supplementary groups into a cache.
 
+Severity   : minor
+Bugzilla   : 7278
+Description: O_CREAT|O_EXCL open flags in liblustre always return -EEXIST
+Details    : Make libsysio to not enforce O_EXCL by clearing the flag,
+             for liblustre O_EXCL is enforced by MDS.
+
 2005-08-08  Cluster File Systems, Inc. <info@clusterfs.com>
        * version 1.4.4
        * bug fixes
index 0df523a..c6c43b9 100644 (file)
@@ -501,6 +501,12 @@ translate_lookup_intent(struct intent *intent, const char *path)
         if (it->it_flags & O_CREAT) {
                 it->it_op |= IT_CREAT;
                 it->it_create_mode = *((int*)intent->int_arg1);
+                /* XXX libsysio hack. For O_EXCL, libsysio depends on
+                   this lookup to return negative result, but then there is no
+                   way to find out original intent in ll_iop_open(). So we just
+                   clear O_EXCL from libsysio flags here to avoid checking
+                   for negative result. O_EXCL would be enforced by MDS. */
+                *((int*)intent->int_arg2) &= ~O_EXCL;
         }
 
         if (intent->int_opmask & INT_GETATTR)