]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
sync with (upcoming) kernel updates.
authorNathan Scott <nathans@sgi.com>
Wed, 26 Jun 2002 06:30:53 +0000 (06:30 +0000)
committerNathan Scott <nathans@sgi.com>
Wed, 26 Jun 2002 06:30:53 +0000 (06:30 +0000)
include/xfs_acl.h
libxlog/xfs_log_recover.c

index 35b6e66d8c3997d4f1419b28efeb87e02e9ee379..b91d363588b42db28f3fec37b7885bd9c69b6109 100644 (file)
@@ -65,8 +65,6 @@ typedef struct xfs_acl {
 
 #ifdef CONFIG_FS_POSIX_ACL
 
-#include <linux/posix_acl.h>
-
 struct vattr;
 struct vnode;
 struct xfs_inode;
@@ -84,6 +82,10 @@ extern int xfs_acl_vremove(struct vnode *vp, int);
 
 extern struct xfs_zone *xfs_acl_zone;
 
+#define _ACL_TYPE_ACCESS       1
+#define _ACL_TYPE_DEFAULT      2
+#define _ACL_PERM_INVALID(perm)        ((perm) & ~(ACL_READ|ACL_WRITE|ACL_EXECUTE))
+
 #define _ACL_DECL(a)           xfs_acl_t *(a) = NULL
 #define _ACL_ALLOC(a)          ((a) = kmem_zone_alloc(xfs_acl_zone, KM_SLEEP))
 #define _ACL_FREE(a)           ((a)? kmem_zone_free(xfs_acl_zone, (a)) : 0)
@@ -94,8 +96,10 @@ extern struct xfs_zone *xfs_acl_zone;
 #define _ACL_GET_DEFAULT(pv,pd)        (xfs_acl_vtoacl(pv,NULL,pd) == 0)
 #define _ACL_ACCESS_EXISTS     xfs_acl_vhasacl_access
 #define _ACL_DEFAULT_EXISTS    xfs_acl_vhasacl_default
-#define _ACL_XFS_IACCESS(i,m,c)        \
-       (XFS_IFORK_Q(i) ? xfs_acl_iaccess(i,m,c) : -1)
+#define _ACL_XFS_IACCESS(i,m,c)        (XFS_IFORK_Q(i) ? xfs_acl_iaccess(i,m,c) : -1)
+
+#define set_acl_flag(inode)    ((inode)->i_flags |= S_POSIXACL)
+#define clear_acl_flag(inode)  ((inode)->i_flags &= ~S_POSIXACL)
 
 #else
 #define xfs_acl_vset(v,p,sz,t) (-ENOTSUP)
@@ -112,6 +116,8 @@ extern struct xfs_zone *xfs_acl_zone;
 #define _ACL_ACCESS_EXISTS     (NULL)
 #define _ACL_DEFAULT_EXISTS    (NULL)
 #define _ACL_XFS_IACCESS(i,m,c)        (-1)
+#define set_acl_flag(inode)    do { } while (0)
+#define clear_acl_flag(inode)  do { } while (0)
 #endif
 
 #endif /* __KERNEL__ */
index b270b1f83db0c90c5c4e5f130f2ff0d72a7ed760..0e62c45a12db39d428d1654435e1802e0931a5e6 100644 (file)
@@ -1240,6 +1240,16 @@ xlog_do_recovery_pass(xlog_t     *log,
            rhead = (xlog_rec_header_t *)XFS_BUF_PTR(hbp);
            ASSERT(INT_GET(rhead->h_magicno, ARCH_CONVERT) == XLOG_HEADER_MAGIC_NUM);
            ASSERT(BTOBB(INT_GET(rhead->h_len, ARCH_CONVERT) <= INT_MAX));
+           bblks = (int) BTOBB(INT_GET(rhead->h_len, ARCH_CONVERT));   /* blocks in data section */
+
+           if ((INT_GET(rhead->h_magicno, ARCH_CONVERT) != XLOG_HEADER_MAGIC_NUM) ||
+               (BTOBB(INT_GET(rhead->h_len, ARCH_CONVERT) > INT_MAX)) ||
+               (bblks <= 0) ||
+               (blk_no > log->l_logBBsize)) {
+                   error = EFSCORRUPTED;
+                   goto bread_err2;
+           }
+
            if ((INT_GET(rhead->h_version, ARCH_CONVERT) & (~XLOG_VERSION_OKBITS)) != 0) {
                xlog_warn("XFS: xlog_do_recovery_pass: unrecognised log version number.");
                error = XFS_ERROR(EIO);