linux cache file open fail print error
[openafs.git] / src / afs / LINUX / osi_file.c
index 7af6b6d..e1a11fb 100644 (file)
@@ -51,7 +51,7 @@ afs_linux_raw_open(afs_dcache_id_t *ainode)
            osi_Panic("Can't get dentry\n");
     tip = dp->d_inode;
 #endif
-    tip->i_flags |= MS_NOATIME;        /* Disable updating access times. */
+    tip->i_flags |= S_NOATIME; /* Disable updating access times. */
 
 #if defined(STRUCT_TASK_HAS_CRED)
     /* Use stashed credentials - prevent selinux/apparmor problems  */
@@ -61,7 +61,7 @@ afs_linux_raw_open(afs_dcache_id_t *ainode)
 #endif
     if (IS_ERR(filp))
 #if defined(LINUX_USE_FH)
-       osi_Panic("Can't open file\n");
+       osi_Panic("Can't open file: %d\n", PTR_ERR(filp));
 #else
        osi_Panic("Can't open inode %d\n", (int) ainode->ufs);
 #endif
@@ -387,7 +387,8 @@ osi_rdwr(struct osi_file *osifile, uio_t * uiop, int rw)
     /* seek to the desired position. Return -1 on error. */
     if (filp->f_op->llseek) {
        if (filp->f_op->llseek(filp, (loff_t) uiop->uio_offset, 0) != uiop->uio_offset)
-           return -1;
+           code = -1;
+           goto out;
     } else
        filp->f_pos = uiop->uio_offset;
 
@@ -425,6 +426,7 @@ osi_rdwr(struct osi_file *osifile, uio_t * uiop, int rw)
        code = 0;
     }
 
+out:
     if (uiop->uio_seg == AFS_UIOSYS)
        TO_KERNEL_SPACE();