Hello!

On Thu, Jun 28, 2007 at 01:57:11PM -0600, Adam Boggs wrote:
> Is there a patch for bug 11563 available for lustre 1.6.0.1?  My port
> is not working right and it's not immediately obvious why.

Here is the commit I dug out of cvs logs:

green       2007/05/16 20:43:03 GMT

  Modified:    .        ChangeLog
               llite    file.c llite_internal.h llite_lib.c
  Log:
  b=11563
  r=adilger,nathan
  
  Add -o localflock option to simulate  old noflock behaviour.

Revision  Changes    Path
1.176.2.3 +8 -0      lustre-core/ChangeLog

Index: ChangeLog
===================================================================
RCS file: /cvsroot/cfs/lustre-core/ChangeLog,v
retrieving revision 1.176.2.2
retrieving revision 1.176.2.3
diff -b -B -p -u -r1.176.2.2 -r1.176.2.3
--- ChangeLog   16 May 2007 15:50:24 -0000      1.176.2.2
+++ ChangeLog   16 May 2007 20:43:02 -0000      1.176.2.3
@@ -102,6 +102,14 @@ Details    : in some rare cases it was p
             an MDS multiple times.  Upon recovery the MDS would detect this
             and fail during startup.  Handle this more gracefully.
 
+Severity   : enhancement
+Bugzilla   : 11563
+Description: Add -o localflock option to simulate  old noflock
+behaviour.
+Details    : This will achieve local-only flock/fcntl locks
+            coherentness.
+
+
 
--------------------------------------------------------------------------------
 
 2007-05-03  Cluster File Systems, Inc. <[EMAIL PROTECTED]>



1.218.12.1 +19 -4     lustre-core/llite/file.c

Index: file.c
===================================================================
RCS file: /cvsroot/cfs/lustre-core/llite/file.c,v
retrieving revision 1.218
retrieving revision 1.218.12.1
diff -b -B -p -u -r1.218 -r1.218.12.1
--- file.c      5 Apr 2007 04:45:53 -0000       1.218
+++ file.c      16 May 2007 20:43:02 -0000      1.218.12.1
@@ -2612,6 +2612,7 @@ check_capabilities:
 }
 #endif
 
+/* -o localflock - only provides locally consistent flock locks */
 struct file_operations ll_file_operations = {
         .read           = ll_file_read,
         .write          = ll_file_write,
@@ -2624,10 +2625,6 @@ struct file_operations ll_file_operation
         .sendfile       = ll_file_sendfile,
 #endif
         .fsync          = ll_fsync,
-#ifdef HAVE_F_OP_FLOCK
-        .flock          = ll_file_noflock,
-#endif
-        .lock           = ll_file_noflock
 };
 
 struct file_operations ll_file_operations_flock = {
@@ -2648,6 +2645,24 @@ struct file_operations ll_file_operation
         .lock           = ll_file_flock
 };
 
+/* These are for -o noflock - to return ENOSYS on flock calls */
+struct file_operations ll_file_operations_noflock = {
+        .read           = ll_file_read,
+        .write          = ll_file_write,
+        .ioctl          = ll_file_ioctl,
+        .open           = ll_file_open,
+        .release        = ll_file_release,
+        .mmap           = ll_file_mmap,
+        .llseek         = ll_file_seek,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
+        .sendfile       = ll_file_sendfile,
+#endif
+        .fsync          = ll_fsync,
+#ifdef HAVE_F_OP_FLOCK
+        .flock          = ll_file_noflock,
+#endif
+        .lock           = ll_file_noflock
+};
 
 struct inode_operations ll_file_inode_operations = {
 #ifdef LUSTRE_KERNEL_VERSION



1.68.2.1  +2 -0      lustre-core/llite/llite_internal.h

Index: llite_internal.h
===================================================================
RCS file: /cvsroot/cfs/lustre-core/llite/llite_internal.h,v
retrieving revision 1.68
retrieving revision 1.68.2.1
diff -b -B -p -u -r1.68 -r1.68.2.1
--- llite_internal.h    10 May 2007 18:38:51 -0000      1.68
+++ llite_internal.h    16 May 2007 20:43:02 -0000      1.68.2.1
@@ -225,6 +225,7 @@ enum vfs_track_type {
 #define LL_SBI_USER_XATTR       0x08 /* support user xattr */
 #define LL_SBI_ACL              0x10 /* support ACL */
 #define LL_SBI_JOIN             0x20 /* support JOIN */
+#define LL_SBI_LOCALFLOCK       0x40 /* Local flocks support by kernel */
 
 struct ll_sb_info {
         struct list_head          ll_list;
@@ -484,6 +485,7 @@ int ll_sync_page_range(struct inode *, s
 /* llite/file.c */
 extern struct file_operations ll_file_operations;
 extern struct file_operations ll_file_operations_flock;
+extern struct file_operations ll_file_operations_noflock;
 extern struct inode_operations ll_file_inode_operations;
 extern int ll_inode_revalidate_it(struct dentry *, struct lookup_intent *);
 extern int ll_have_md_lock(struct inode *inode, __u64 bits);



1.134.2.1 +9 -2      lustre-core/llite/llite_lib.c

Index: llite_lib.c
===================================================================
RCS file: /cvsroot/cfs/lustre-core/llite/llite_lib.c,v
retrieving revision 1.134
retrieving revision 1.134.2.1
diff -b -B -p -u -r1.134 -r1.134.2.1
--- llite_lib.c 10 May 2007 18:38:51 -0000      1.134
+++ llite_lib.c 16 May 2007 20:43:02 -0000      1.134.2.1
@@ -170,8 +170,10 @@ static int client_common_fill_super(stru
         
         if (sbi->ll_flags & LL_SBI_FLOCK)
                 sbi->ll_fop = &ll_file_operations_flock;
-        else
+        else if (sbi->ll_flags & LL_SBI_LOCALFLOCK)
                 sbi->ll_fop = &ll_file_operations;
+        else
+                sbi->ll_fop = &ll_file_operations_noflock;
 
         err = obd_connect(&mdc_conn, obd, &sbi->ll_sb_uuid, data);
         if (err == -EBUSY) {
@@ -631,7 +633,12 @@ static int ll_options(char *options, int
                         *flags |= tmp;
                         goto next;
                 }
-                tmp = ll_set_opt("noflock", s1, LL_SBI_FLOCK);
+                tmp = ll_set_opt("localflock", s1, LL_SBI_LOCALFLOCK);
+                if (tmp) {
+                        *flags |= tmp;
+                        goto next;
+                }
+                tmp = ll_set_opt("noflock", s1, 
LL_SBI_FLOCK|LL_SBI_LOCALFLOCK);
                 if (tmp) {
                         *flags &= ~tmp;
                         goto next;



Bye,
    Oleg

_______________________________________________
Lustre-discuss mailing list
[email protected]
https://mail.clusterfs.com/mailman/listinfo/lustre-discuss

Reply via email to