From: Nathan Scott Date: Wed, 26 Jun 2002 06:30:53 +0000 (+0000) Subject: sync with (upcoming) kernel updates. X-Git-Tag: v2.2.0~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5f651f11e633e05b36f36685c8e4f4305a50615d;p=thirdparty%2Fxfsprogs-dev.git sync with (upcoming) kernel updates. --- diff --git a/include/xfs_acl.h b/include/xfs_acl.h index 35b6e66d8..b91d36358 100644 --- a/include/xfs_acl.h +++ b/include/xfs_acl.h @@ -65,8 +65,6 @@ typedef struct xfs_acl { #ifdef CONFIG_FS_POSIX_ACL -#include - 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__ */ diff --git a/libxlog/xfs_log_recover.c b/libxlog/xfs_log_recover.c index b270b1f83..0e62c45a1 100644 --- a/libxlog/xfs_log_recover.c +++ b/libxlog/xfs_log_recover.c @@ -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);