Whamcloud - gitweb
For remote client, return directly when lfs getfacl / lfs setfacl
authorfanyong <fanyong>
Sun, 29 Oct 2006 13:12:19 +0000 (13:12 +0000)
committerfanyong <fanyong>
Sun, 29 Oct 2006 13:12:19 +0000 (13:12 +0000)
if server do not support ACL.

lustre/llite/llite_lib.c

index 10cb34a..e34cbd4 100644 (file)
@@ -264,8 +264,11 @@ static int client_common_fill_super(struct super_block *sb,
                 sb->s_flags |= MS_POSIXACL;
 #endif
                 sbi->ll_flags |= LL_SBI_ACL;
-        } else if (sbi->ll_flags & LL_SBI_ACL) {
+        } else {
                 LCONSOLE_INFO("client wants to enable acl, but mdt not!\n");
+#ifdef MS_POSIXACL
+                sb->s_flags &= ~MS_POSIXACL;
+#endif
                 sbi->ll_flags &= ~LL_SBI_ACL;
         }
 
@@ -2276,6 +2279,7 @@ void ll_finish_md_op_data(struct md_op_data *op_data)
 
 int ll_ioctl_getfacl(struct inode *inode, struct rmtacl_ioctl_data *ioc)
 {
+        struct ll_sb_info *sbi = ll_i2sbi(inode);
         struct ptlrpc_request *req = NULL;
         struct mdt_body *body;
         char *cmd, *buf;
@@ -2283,6 +2287,10 @@ int ll_ioctl_getfacl(struct inode *inode, struct rmtacl_ioctl_data *ioc)
         int rc, buflen;
         ENTRY;
 
+        if (!(sbi->ll_flags & LL_SBI_ACL) ||
+            !(sbi->ll_flags & LL_SBI_RMT_CLIENT))
+                RETURN(-EOPNOTSUPP);
+
         LASSERT(ioc->cmd && ioc->cmd_len && ioc->res && ioc->res_len);
 
         OBD_ALLOC(cmd, ioc->cmd_len);
@@ -2321,12 +2329,17 @@ out:
 
 int ll_ioctl_setfacl(struct inode *inode, struct rmtacl_ioctl_data *ioc)
 {
+        struct ll_sb_info *sbi = ll_i2sbi(inode);
         struct ptlrpc_request *req = NULL;
         char *cmd, *buf;
         struct obd_capa *oc;
         int buflen, rc;
         ENTRY;
 
+        if (!(sbi->ll_flags & LL_SBI_ACL) ||
+            !(sbi->ll_flags & LL_SBI_RMT_CLIENT))
+                RETURN(-EOPNOTSUPP);
+
         LASSERT(ioc->cmd && ioc->cmd_len && ioc->res && ioc->res_len);
 
         OBD_ALLOC(cmd, ioc->cmd_len);