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;
int rc, buflen;
ENTRY;
+ if (!(sbi->ll_flags & LL_SBI_RMT_CLIENT))
+ RETURN(-EBADE);
+
LASSERT(ioc->cmd && ioc->cmd_len && ioc->res && ioc->res_len);
OBD_ALLOC(cmd, ioc->cmd_len);
int buflen, rc;
ENTRY;
- if (!(sbi->ll_flags & LL_SBI_ACL) ||
- !(sbi->ll_flags & LL_SBI_RMT_CLIENT))
+ if (!(sbi->ll_flags & LL_SBI_RMT_CLIENT))
+ RETURN(-EBADE);
+
+ if (!(sbi->ll_flags & LL_SBI_ACL))
RETURN(-EOPNOTSUPP);
LASSERT(ioc->cmd && ioc->cmd_len && ioc->res && ioc->res_len);
rc = ioctl(fd, LL_IOC_GETFACL, &data);
close(fd);
- if (rc) {
+ if (errno == EBADE) {
+ fprintf(stderr, "Please use getfacl directly!\n");
+ rc = 1;
+ } else if (rc) {
err_msg("getfacl %s failed", fname);
} else {
printf("%s", out);
rc = ioctl(fd, LL_IOC_SETFACL, &data);
close(fd);
- if (errno == EOPNOTSUPP) {
+ if (errno == EBADE) {
+ fprintf(stderr, "Please use setfacl directly!\n");
+ rc = 1;
+ } else if (errno == EOPNOTSUPP) {
fprintf(stderr, "setfacl: %s: %s\n", fname, strerror(errno));
rc = 1;
} else if (rc) {