Whamcloud - gitweb
Branch b1_6
authorbobijam <bobijam>
Tue, 10 Jul 2007 02:39:34 +0000 (02:39 +0000)
committerbobijam <bobijam>
Tue, 10 Jul 2007 02:39:34 +0000 (02:39 +0000)
b=12784
i=green
i=adilger

Original patch by miles@cray.com

Description: bad return value and errno from fcntl call
Details    : In liblustre API, errno should be a negative value if error
             happens.

lustre/ChangeLog
lustre/liblustre/super.c

index 2cdfe82..7d2f827 100644 (file)
@@ -443,6 +443,12 @@ Description: replace obdo_alloc() with OBDO_ALLOC macro
 Details    : nothing special is done in obdo_alloc() function, and for 
              debugging purpose, it needs to be replaced with macros.
 
+Severity   : normal
+Bugzilla   : 12784
+Description: bad return value and errno from fcntl call
+Details    : In liblustre API, errno should be a negative value if error
+             happens.
+
 --------------------------------------------------------------------------------
 
 2007-05-03  Cluster File Systems, Inc. <info@clusterfs.com>
index 6267ce5..93260a9 100644 (file)
@@ -1397,7 +1397,7 @@ static int llu_fcntl_getlk(struct inode *ino, struct flock *flock)
         struct file_lock fl;
         int error;
 
-        error = EINVAL;
+        error = -EINVAL;
         if ((flock->l_type != F_RDLCK) && (flock->l_type != F_WRLCK))
                 goto out;
 
@@ -1479,8 +1479,8 @@ static int llu_iop_fcntl(struct inode *ino, int cmd, va_list ap, int *rtn)
                         LCONSOLE_ERROR_MSG(0x010, "liblustre does not support "
                                            "the O_NONBLOCK or O_ASYNC flags. "
                                            "Please fix your application.\n");
-                        *rtn = -EINVAL;
-                        err = EINVAL;
+                        *rtn = -1;
+                        err = -EINVAL;
                         break;
                 }
                 lli->lli_open_flags = (int)(flags & FCNTL_FLMASK) |
@@ -1515,8 +1515,8 @@ static int llu_iop_fcntl(struct inode *ino, int cmd, va_list ap, int *rtn)
                 break;
         default:
                 CERROR("unsupported fcntl cmd %x\n", cmd);
-                *rtn = -ENOSYS;
-                err = ENOSYS;
+                *rtn = -1;
+                err = -ENOSYS;
                 break;
         }