Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/ufs Bump UFS1 extended attribute max name length to 256



details:   https://anonhg.NetBSD.org/src/rev/ae8abbc04f22
branches:  trunk
changeset: 805126:ae8abbc04f22
user:      manu <manu%NetBSD.org@localhost>
date:      Fri Dec 19 10:59:21 2014 +0000

description:
Bump UFS1 extended attribute max name length to 256

For extended attribute name max length, kernel filesystem-independant
code use either EXTATTR_MAXNAMELEN (BSD API) or XATTR_NAME_MAX (Linux API),
which are both defined as KERNEL_NAME_MAX and fits Linux limit of 255
without training \0.

UFS1 code had a lower limit that broke Linux compatibility. We can bump
the limit without sacrifying backward compatibility, because:

1) There is no API exposing this limit outside the kernel. Upper kernel
layers have a larger limit handle the increase without a hitch

2) Each attribute has its own backing store in the fileystem, the name
of the backing store matching the attribute name. A newer kernel can
create/read/write backing store for longer attribute names and will
have no problem with existing shorter names.

diffstat:

 sys/ufs/ufs/extattr.h |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 64ae7ce082ce -r ae8abbc04f22 sys/ufs/ufs/extattr.h
--- a/sys/ufs/ufs/extattr.h     Fri Dec 19 10:59:06 2014 +0000
+++ b/sys/ufs/ufs/extattr.h     Fri Dec 19 10:59:21 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: extattr.h,v 1.10 2011/10/09 21:15:34 chs Exp $ */
+/*     $NetBSD: extattr.h,v 1.11 2014/12/19 10:59:21 manu Exp $        */
 
 /*-
  * Copyright (c) 1999-2001 Robert N. M. Watson
@@ -43,7 +43,7 @@
 #define        UFS_EXTATTR_FSROOTSUBDIR        ".attribute"
 #define        UFS_EXTATTR_SUBDIR_SYSTEM       "system"
 #define        UFS_EXTATTR_SUBDIR_USER         "user"
-#define        UFS_EXTATTR_MAXEXTATTRNAME      65      /* including null */
+#define        UFS_EXTATTR_MAXEXTATTRNAME      256     /* including null */
 
 #define        UFS_EXTATTR_ATTR_FLAG_INUSE     0x00000001      /* attr has been set */
 #define        UFS_EXTATTR_PERM_KERNEL         0x00000000



Home | Main Index | Thread Index | Old Index