Skip to contentSkip to conversation

lustre: project quota support and BLKSZGET

PATCH New James Simmons 1 participant 8 messages Oct 14, 2018 Staging

lore
Share & tools
lore
#0 lore raw

cover lustre: project quota support and BLKSZGET

Add support for BLKSZGET and project quota support that landed to lustre 2.10. This patch set depends on the earlier patch set sent and are not order independent.

Emoly Liu (1):
lustre: ioctl: Add BLKSSZGET ioctl support

Li Xi (1):
lustre: quota: add project quota support for Lustre

Oleg Drokin (2):
lustre: quota: cleanup codes of quota for new type
lustre: quota: add project id support

Wang Shilong (3):
lustre: quota: add setting/getting project id function
lustre: quota: add project inherit attributes
lustre: llite: extend inode flags into GET/SETXATTR ioctl

 .../lustre/include/uapi/linux/lustre/lustre_idl.h  | 40 ++++++++--
 .../lustre/include/uapi/linux/lustre/lustre_user.h | 15 +++-
 drivers/staging/lustre/lustre/include/cl_object.h  |  6 +-
 drivers/staging/lustre/lustre/include/obd.h        |  4 +
 drivers/staging/lustre/lustre/llite/dir.c          | 28 +++++--
 drivers/staging/lustre/lustre/llite/file.c         | 88 ++++++++++++++++++++++
 .../staging/lustre/lustre/llite/llite_internal.h   | 10 ++-
 drivers/staging/lustre/lustre/llite/llite_lib.c    | 17 ++++-
 drivers/staging/lustre/lustre/llite/vvp_object.c   |  9 ++-
 drivers/staging/lustre/lustre/mdc/mdc_lib.c        |  3 +
 drivers/staging/lustre/lustre/obdclass/obdo.c      |  7 ++
 drivers/staging/lustre/lustre/osc/osc_cache.c      |  1 +
 drivers/staging/lustre/lustre/osc/osc_quota.c      | 46 +++++++----
 drivers/staging/lustre/lustre/osc/osc_request.c    | 13 ++--
 .../staging/lustre/lustre/ptlrpc/pack_generic.c    |  8 +-
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c    | 30 +++++---
 16 files changed, 275 insertions(+), 50 deletions(-)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/7 lustre: quota: cleanup codes of quota for new type

From: Oleg Drokin <[email protected]>

This patch cleanups codes of quota to prepare for new type other than USRQUOTA/GRPQUOTA.

WC-bug-id: https://jira.whamcloud.com/browse/LU-4017
Reviewed-on: https://review.whamcloud.com/18894

---
 .../lustre/include/uapi/linux/lustre/lustre_idl.h  |  2 ++
 .../lustre/include/uapi/linux/lustre/lustre_user.h | 13 ++++++-
 drivers/staging/lustre/lustre/llite/dir.c          | 21 ++++++++---
 drivers/staging/lustre/lustre/osc/osc_quota.c      | 42 ++++++++++++++--------
 drivers/staging/lustre/lustre/osc/osc_request.c    |  2 +-
 5 files changed, 59 insertions(+), 21 deletions(-)
drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h +2 -0
index 66b15c7..9430f11 100644
@@ -1131,6 +1131,8 @@ static inline __u32 lov_mds_md_size(__u16 stripes, __u32 lmm_magic)
 
 #define OBD_MD_DEFAULT_MEA	(0x0040000000000000ULL) /* default MEA */
 
+#define OBD_MD_FLALLQUOTA (OBD_MD_FLUSRQUOTA | OBD_MD_FLGRPQUOTA)
+
 #define OBD_MD_FLGETATTR (OBD_MD_FLID    | OBD_MD_FLATIME | OBD_MD_FLMTIME | \
 			  OBD_MD_FLCTIME | OBD_MD_FLSIZE  | OBD_MD_FLBLKSZ | \
 			  OBD_MD_FLMODE  | OBD_MD_FLTYPE  | OBD_MD_FLUID   | \
drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h +12 -1
index 715f1c5..b1961df 100644
@@ -567,7 +567,18 @@ static inline void obd_uuid2fsname(char *buf, char *uuid, int buflen)
 #define LUSTRE_Q_INVALIDATE  0x80000b	/* deprecated as of 2.4 */
 #define LUSTRE_Q_FINVALIDATE 0x80000c	/* deprecated as of 2.4 */
 
-#define UGQUOTA 2       /* set both USRQUOTA and GRPQUOTA */
+#define ALLQUOTA 255	/* set all quota */
+
+static inline char *qtype_name(int qtype)
+{
+	switch (qtype) {
+	case USRQUOTA:
+		return "usr";
+	case GRPQUOTA:
+		return "grp";
+	}
+	return "unknown";
+}
 
 #define IDENTITY_DOWNCALL_MAGIC 0x6d6dd629
 
drivers/staging/lustre/lustre/llite/dir.c +16 -5
index 36cea8d..7047938 100644
@@ -902,6 +902,21 @@ static int copy_and_ioctl(int cmd, struct obd_export *exp,
 	return rc;
 }
 
+static inline int check_owner(int type, int id)
+{
+	switch (type) {
+	case USRQUOTA:
+		if (!uid_eq(current_euid(), make_kuid(&init_user_ns, id)))
+			return -EPERM;
+		break;
+	case GRPQUOTA:
+		if (!in_egroup_p(make_kgid(&init_user_ns, id)))
+			return -EPERM;
+		break;
+	}
+	return 0;
+}
+
 static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
 {
 	int cmd = qctl->qc_cmd;
@@ -917,11 +932,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
 			return -EPERM;
 		break;
 	case Q_GETQUOTA:
-		if (((type == USRQUOTA &&
-		      !uid_eq(current_euid(), make_kuid(&init_user_ns, id))) ||
-		     (type == GRPQUOTA &&
-		      !in_egroup_p(make_kgid(&init_user_ns, id)))) &&
-		      !capable(CAP_SYS_ADMIN))
+		if (check_owner(type, id) && !capable(CAP_SYS_ADMIN))
 			return -EPERM;
 		break;
 	case Q_GETINFO:
drivers/staging/lustre/lustre/osc/osc_quota.c +28 -14

84 lines not on this page · raw message

drivers/staging/lustre/lustre/osc/osc_request.c +1 -1
index 5bab8a3..1d21159 100644
@@ -1476,7 +1476,7 @@ static int osc_brw_fini_request(struct ptlrpc_request *req, int rc)
 
 	/* set/clear over quota flag for a uid/gid */
 	if (lustre_msg_get_opc(req->rq_reqmsg) == OST_WRITE &&
-	    body->oa.o_valid & (OBD_MD_FLUSRQUOTA | OBD_MD_FLGRPQUOTA)) {
+	    body->oa.o_valid & OBD_MD_FLALLQUOTA) {
 		unsigned int qid[MAXQUOTAS] = { body->oa.o_uid, body->oa.o_gid };
 
 		CDEBUG(D_QUOTA, "setdq for [%u %u] with valid %#llx, flags %x\n",
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH 2/7 lustre: quota: add project quota support for Lustre

In reply to James Simmons

From: Li Xi <[email protected]>

This patch adds necessary support of project quota, so that OSTs can be mounted successfully.

WC-bug-id: https://jira.whamcloud.com/browse/LU-4017
Reviewed-on: https://review.whamcloud.com/23947

---
 drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h  | 9 +++++++--
 drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h | 2 ++
 drivers/staging/lustre/lustre/llite/dir.c                      | 4 +++-
 drivers/staging/lustre/lustre/osc/osc_quota.c                  | 4 ++++
 4 files changed, 16 insertions(+), 3 deletions(-)
drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h +7 -2
index 9430f11..1220acd 100644
@@ -913,6 +913,9 @@ enum obdo_flags {
 	OBD_FL_IDONLY       = 0x00000010, /* set in o_flags only adjust obj id*/
 	OBD_FL_RECREATE_OBJS = 0x00000020, /* recreate missing obj */
 	OBD_FL_DEBUG_CHECK  = 0x00000040, /* echo client/server debug check */
+	OBD_FL_NO_PRJQUOTA  = 0x00000080, /* the object's project is over
+					   * quota
+					   */
 	OBD_FL_NO_USRQUOTA  = 0x00000100, /* the object's owner is over quota */
 	OBD_FL_NO_GRPQUOTA  = 0x00000200, /* the object's group is over quota */
 	OBD_FL_CREATE_CROW  = 0x00000400, /* object should be create on write */
@@ -1086,7 +1089,7 @@ static inline __u32 lov_mds_md_size(__u16 stripes, __u32 lmm_magic)
 #define OBD_MD_FLHANDLE		(0x00080000ULL) /* file/lock handle */
 #define OBD_MD_FLCKSUM		(0x00100000ULL) /* bulk data checksum */
 #define OBD_MD_FLQOS		(0x00200000ULL) /* quality of service stats */
-/*#define OBD_MD_FLOSCOPQ	(0x00400000ULL) osc opaque data, never used */
+#define OBD_MD_FLPRJQUOTA	(0x00400000ULL)	/* over quota flags sent from ost */
 /*	OBD_MD_FLCOOKIE		(0x00800000ULL) obsolete in 2.8 */
 #define OBD_MD_FLGROUP		(0x01000000ULL) /* group */
 #define OBD_MD_FLFID		(0x02000000ULL) /* ->ost write inline fid */
@@ -1131,7 +1134,9 @@ static inline __u32 lov_mds_md_size(__u16 stripes, __u32 lmm_magic)
 
 #define OBD_MD_DEFAULT_MEA	(0x0040000000000000ULL) /* default MEA */
 
-#define OBD_MD_FLALLQUOTA (OBD_MD_FLUSRQUOTA | OBD_MD_FLGRPQUOTA)
+#define OBD_MD_FLALLQUOTA (OBD_MD_FLUSRQUOTA | \
+			   OBD_MD_FLGRPQUOTA | \
+			   OBD_MD_FLPRJQUOTA)
 
 #define OBD_MD_FLGETATTR (OBD_MD_FLID    | OBD_MD_FLATIME | OBD_MD_FLMTIME | \
 			  OBD_MD_FLCTIME | OBD_MD_FLSIZE  | OBD_MD_FLBLKSZ | \
drivers/staging/lustre/include/uapi/linux/lustre/lustre_user.h +2 -0
index b1961df..9d553ce6 100644
@@ -576,6 +576,8 @@ static inline char *qtype_name(int qtype)
 		return "usr";
 	case GRPQUOTA:
 		return "grp";
+	case PRJQUOTA:
+		return "prj";
 	}
 	return "unknown";
 }
drivers/staging/lustre/lustre/llite/dir.c +3 -1
index 7047938..9fa0e2e 100644
@@ -902,7 +902,7 @@ static int copy_and_ioctl(int cmd, struct obd_export *exp,
 	return rc;
 }
 
-static inline int check_owner(int type, int id)
+static int check_owner(int type, int id)
 {
 	switch (type) {
 	case USRQUOTA:
@@ -913,6 +913,8 @@ static inline int check_owner(int type, int id)
 		if (!in_egroup_p(make_kgid(&init_user_ns, id)))
 			return -EPERM;
 		break;
+	case PRJQUOTA:
+		break;
 	}
 	return 0;
 }
drivers/staging/lustre/lustre/osc/osc_quota.c +4 -0
index 13ef482..555f1be 100644
@@ -85,6 +85,8 @@ static inline u32 md_quota_flag(int qtype)
 		return OBD_MD_FLUSRQUOTA;
 	case GRPQUOTA:
 		return OBD_MD_FLGRPQUOTA;
+	case PRJQUOTA:
+		return OBD_MD_FLPRJQUOTA;
 	default:
 		return 0;
 	}
@@ -97,6 +99,8 @@ static inline u32 fl_quota_flag(int qtype)
 		return OBD_FL_NO_USRQUOTA;
 	case GRPQUOTA:
 		return OBD_FL_NO_GRPQUOTA;
+	case PRJQUOTA:
+		return OBD_FL_NO_PRJQUOTA;
 	default:
 		return 0;
 	}
Signature · 1 line
1.8.3.1
#3 lore raw

PATCH 3/7 lustre: quota: add project id support

In reply to James Simmons

From: Oleg Drokin <[email protected]>

This patch is infrastructure change for Lustre project quota, project ID is considered as file attribute like UID/GID, MDS will return back project id to client upon open/getattr.

WC-bug-id: https://jira.whamcloud.com/browse/LU-4017
Reviewed-on: https://review.whamcloud.com/25812

---
 .../lustre/include/uapi/linux/lustre/lustre_idl.h     |  9 ++++++---
 drivers/staging/lustre/lustre/include/obd.h           |  1 +
 drivers/staging/lustre/lustre/llite/llite_internal.h  |  2 ++
 drivers/staging/lustre/lustre/llite/llite_lib.c       |  2 ++
 drivers/staging/lustre/lustre/llite/vvp_object.c      |  4 +++-
 drivers/staging/lustre/lustre/obdclass/obdo.c         |  7 +++++++
 drivers/staging/lustre/lustre/ptlrpc/pack_generic.c   |  8 +++++++-
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c       | 19 +++++++++++++------
 8 files changed, 41 insertions(+), 11 deletions(-)
drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h +6 -3
index 1220acd..a8ffde2 100644
@@ -1133,6 +1133,7 @@ static inline __u32 lov_mds_md_size(__u16 stripes, __u32 lmm_magic)
 							    */
 
 #define OBD_MD_DEFAULT_MEA	(0x0040000000000000ULL) /* default MEA */
+#define OBD_MD_FLPROJID		(0x0100000000000000ULL) /* project ID */
 
 #define OBD_MD_FLALLQUOTA (OBD_MD_FLUSRQUOTA | \
 			   OBD_MD_FLGRPQUOTA | \
@@ -1142,7 +1143,8 @@ static inline __u32 lov_mds_md_size(__u16 stripes, __u32 lmm_magic)
 			  OBD_MD_FLCTIME | OBD_MD_FLSIZE  | OBD_MD_FLBLKSZ | \
 			  OBD_MD_FLMODE  | OBD_MD_FLTYPE  | OBD_MD_FLUID   | \
 			  OBD_MD_FLGID   | OBD_MD_FLFLAGS | OBD_MD_FLNLINK | \
-			  OBD_MD_FLGENER | OBD_MD_FLRDEV  | OBD_MD_FLGROUP)
+			  OBD_MD_FLGENER | OBD_MD_FLRDEV  | OBD_MD_FLGROUP | \
+			  OBD_MD_FLPROJID)
 
 #define OBD_MD_FLXATTRALL (OBD_MD_FLXATTR | OBD_MD_FLXATTRLS)
 
@@ -1515,7 +1517,7 @@ struct mdt_body {
 	__u32	mbo_unused3;	/* was max_cookiesize until 2.8 */
 	__u32	mbo_uid_h;	/* high 32-bits of uid, for FUID */
 	__u32	mbo_gid_h;	/* high 32-bits of gid, for FUID */
-	__u32	mbo_padding_5;	/* also fix lustre_swab_mdt_body */
+	__u32	mbo_projid;	/* also fix lustre_swab_mdt_body */
 	__u64	mbo_padding_6;
 	__u64	mbo_padding_7;
 	__u64	mbo_padding_8;
@@ -2615,7 +2617,8 @@ struct obdo {
 					 * brw: grant space consumed on
 					 * the client for the write
 					 */
-	__u64		o_padding_4;
+	__u32		o_projid;
+	__u32		o_padding_4;	/* also fix lustre_swab_obdo() */
 	__u64		o_padding_5;
 	__u64		o_padding_6;
 };
drivers/staging/lustre/lustre/include/obd.h +1 -0
index cf3dbd6..81b4750 100644
@@ -1028,6 +1028,7 @@ static inline struct md_open_data *obd_mod_alloc(void)
 
 void obdo_from_inode(struct obdo *dst, struct inode *src, u32 valid);
 void obdo_set_parent_fid(struct obdo *dst, const struct lu_fid *parent);
+void obdo_set_o_projid(struct obdo *dst, u32 projid);
 
 /* return 1 if client should be resend request */
 static inline int client_should_resend(int resend, struct client_obd *cli)
drivers/staging/lustre/lustre/llite/llite_internal.h +2 -0
index 359bd53..ba9ba49 100644
@@ -237,6 +237,8 @@ struct ll_inode_info {
 	__u32				lli_layout_gen;
 	spinlock_t			lli_layout_lock;
 
+	u32				lli_projid;	/* project id */
+
 	struct rw_semaphore		lli_xattrs_list_rwsem;
 	struct mutex			lli_xattrs_enq_lock;
 	struct list_head		lli_xattrs;/* ll_xattr_entry->xe_list */
drivers/staging/lustre/lustre/llite/llite_lib.c +2 -0
index fae7e50..7320dc8 100644
@@ -1859,6 +1859,8 @@ int ll_update_inode(struct inode *inode, struct lustre_md *md)
 		inode->i_uid = make_kuid(&init_user_ns, body->mbo_uid);
 	if (body->mbo_valid & OBD_MD_FLGID)
 		inode->i_gid = make_kgid(&init_user_ns, body->mbo_gid);
+	if (body->mbo_valid & OBD_MD_FLPROJID)
+		lli->lli_projid = body->mbo_projid;
 	if (body->mbo_valid & OBD_MD_FLFLAGS)
 		inode->i_flags = ll_ext_to_inode_flags(body->mbo_flags);
 	if (body->mbo_valid & OBD_MD_FLNLINK)
drivers/staging/lustre/lustre/llite/vvp_object.c +3 -1
index 301a90d..c1f8b50 100644
@@ -193,9 +193,11 @@ static void vvp_req_attr_set(const struct lu_env *env, struct cl_object *obj,
 	oa = attr->cra_oa;
 	inode = vvp_object_inode(obj);
 
-	if (attr->cra_type == CRT_WRITE)
+	if (attr->cra_type == CRT_WRITE) {
 		valid_flags |= OBD_MD_FLMTIME | OBD_MD_FLCTIME |
 			       OBD_MD_FLUID | OBD_MD_FLGID;
+		obdo_set_o_projid(oa, ll_i2info(inode)->lli_projid);
+	}
 	obdo_from_inode(oa, inode, valid_flags & attr->cra_flags);
 	obdo_set_parent_fid(oa, &ll_i2info(inode)->lli_fid);
 	if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_INVALID_PFID))
drivers/staging/lustre/lustre/obdclass/obdo.c +7 -0
index 8013c1e..7c65d0d 100644
@@ -52,6 +52,13 @@ void obdo_set_parent_fid(struct obdo *dst, const struct lu_fid *parent)
 }
 EXPORT_SYMBOL(obdo_set_parent_fid);
 
+void obdo_set_o_projid(struct obdo *dst, u32 projid)
+{
+	dst->o_projid = projid;
+	dst->o_valid |= OBD_MD_FLPROJID;
+}
+EXPORT_SYMBOL(obdo_set_o_projid);
+
 /* WARNING: the file systems must take care not to tinker with
  * attributes they don't manage (such as blocks).
  */
drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +7 -1
index 96d0377..951bb92 100644
@@ -1614,6 +1614,7 @@ static void lustre_swab_obdo(struct obdo *o)
 	__swab32s(&o->o_uid_h);
 	__swab32s(&o->o_gid_h);
 	__swab64s(&o->o_data_version);
+	__swab32s(&o->o_projid);
 	BUILD_BUG_ON(offsetof(typeof(*o), o_padding_4) == 0);
 	BUILD_BUG_ON(offsetof(typeof(*o), o_padding_5) == 0);
 	BUILD_BUG_ON(offsetof(typeof(*o), o_padding_6) == 0);
@@ -1747,7 +1748,12 @@ void lustre_swab_mdt_body(struct mdt_body *b)
 	BUILD_BUG_ON(!offsetof(typeof(*b), mbo_unused3));
 	__swab32s(&b->mbo_uid_h);
 	__swab32s(&b->mbo_gid_h);
-	BUILD_BUG_ON(offsetof(typeof(*b), mbo_padding_5) == 0);
+	__swab32s(&b->mbo_projid);
+	BUILD_BUG_ON(offsetof(typeof(*b), mbo_padding_6) == 0);
+	BUILD_BUG_ON(offsetof(typeof(*b), mbo_padding_7) == 0);
+	BUILD_BUG_ON(offsetof(typeof(*b), mbo_padding_8) == 0);
+	BUILD_BUG_ON(offsetof(typeof(*b), mbo_padding_9) == 0);
+	BUILD_BUG_ON(offsetof(typeof(*b), mbo_padding_10) == 0);
 }
 
 void lustre_swab_mdt_ioepoch(struct mdt_ioepoch *b)
drivers/staging/lustre/lustre/ptlrpc/wiretest.c +13 -6
index 09aef9a..b4774d6 100644
@@ -1228,9 +1228,13 @@ void lustre_assert_wire_constants(void)
 		 (long long)(int)offsetof(struct obdo, o_data_version));
 	LASSERTF((int)sizeof(((struct obdo *)0)->o_data_version) == 8, "found %lld\n",
 		 (long long)(int)sizeof(((struct obdo *)0)->o_data_version));
-	LASSERTF((int)offsetof(struct obdo, o_padding_4) == 184, "found %lld\n",
+	LASSERTF((int)offsetof(struct obdo, o_projid) == 184, "found %lld\n",
+		 (long long)(int)offsetof(struct obdo, o_projid));
+	LASSERTF((int)sizeof(((struct obdo *)0)->o_projid) == 4, "found %lld\n",
+		 (long long)(int)sizeof(((struct obdo *)0)->o_projid));
+	LASSERTF((int)offsetof(struct obdo, o_padding_4) == 188, "found %lld\n",
 		 (long long)(int)offsetof(struct obdo, o_padding_4));
-	LASSERTF((int)sizeof(((struct obdo *)0)->o_padding_4) == 8, "found %lld\n",
+	LASSERTF((int)sizeof(((struct obdo *)0)->o_padding_4) == 4, "found %lld\n",
 		 (long long)(int)sizeof(((struct obdo *)0)->o_padding_4));
 	LASSERTF((int)offsetof(struct obdo, o_padding_5) == 192, "found %lld\n",
 		 (long long)(int)offsetof(struct obdo, o_padding_5));
@@ -1324,6 +1328,9 @@ void lustre_assert_wire_constants(void)
 		 OBD_MD_FLGETATTRLOCK);
 	LASSERTF(OBD_MD_FLDATAVERSION == (0x0010000000000000ULL), "found 0x%.16llxULL\n",
 		 OBD_MD_FLDATAVERSION);
+	LASSERTF(OBD_MD_FLPROJID == (0x0100000000000000ULL), "found 0x%.16llxULL\n",
+		 OBD_MD_FLPROJID);
+
 	BUILD_BUG_ON(OBD_FL_INLINEDATA != 0x00000001);
 	BUILD_BUG_ON(OBD_FL_OBDMDEXISTS != 0x00000002);
 	BUILD_BUG_ON(OBD_FL_DELORPHAN != 0x00000004);
@@ -1869,10 +1876,10 @@ void lustre_assert_wire_constants(void)
 		 (long long)(int)offsetof(struct mdt_body, mbo_gid_h));
 	LASSERTF((int)sizeof(((struct mdt_body *)0)->mbo_gid_h) == 4, "found %lld\n",
 		 (long long)(int)sizeof(((struct mdt_body *)0)->mbo_gid_h));
-	LASSERTF((int)offsetof(struct mdt_body, mbo_padding_5) == 172, "found %lld\n",
-		 (long long)(int)offsetof(struct mdt_body, mbo_padding_5));
-	LASSERTF((int)sizeof(((struct mdt_body *)0)->mbo_padding_5) == 4, "found %lld\n",
-		 (long long)(int)sizeof(((struct mdt_body *)0)->mbo_padding_5));
+	LASSERTF((int)offsetof(struct mdt_body, mbo_projid) == 172, "found %lld\n",
+		 (long long)(int)offsetof(struct mdt_body, mbo_projid));
+	LASSERTF((int)sizeof(((struct mdt_body *)0)->mbo_projid) == 4, "found %lld\n",
+		 (long long)(int)sizeof(((struct mdt_body *)0)->mbo_projid));
 	LASSERTF((int)offsetof(struct mdt_body, mbo_padding_6) == 176, "found %lld\n",
 		 (long long)(int)offsetof(struct mdt_body, mbo_padding_6));
 	LASSERTF((int)sizeof(((struct mdt_body *)0)->mbo_padding_6) == 8, "found %lld\n",
Signature · 1 line
1.8.3.1
#4 lore raw

PATCH 4/7 lustre: quota: add setting/getting project id function

In reply to James Simmons

From: Wang Shilong <[email protected]>

Extend Attr RPC to support project ID attribute, new ioctl is introduced to get/set project id, it is kept same ioctl number as VFS, you could use:

lsattr -p <file>
chattr -p <file>

WC-bug-id: https://jira.whamcloud.com/browse/LU-4017
Reviewed-on: https://review.whamcloud.com/26202
Reviewed-on: https://review.whamcloud.com/26577

---
 .../lustre/include/uapi/linux/lustre/lustre_idl.h  |  5 +-
 drivers/staging/lustre/lustre/include/cl_object.h  |  6 ++-
 drivers/staging/lustre/lustre/include/obd.h        |  3 ++
 drivers/staging/lustre/lustre/llite/dir.c          |  5 +-
 drivers/staging/lustre/lustre/llite/file.c         | 57 ++++++++++++++++++++++
 .../staging/lustre/lustre/llite/llite_internal.h   |  5 +-
 drivers/staging/lustre/lustre/llite/vvp_object.c   |  5 +-
 drivers/staging/lustre/lustre/mdc/mdc_lib.c        |  3 ++
 drivers/staging/lustre/lustre/osc/osc_cache.c      |  1 +
 drivers/staging/lustre/lustre/osc/osc_request.c    | 11 +++--
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c    | 11 +++--
 11 files changed, 97 insertions(+), 15 deletions(-)
drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h +3 -2
index a8ffde2..a7b3168 100644
@@ -1562,7 +1562,7 @@ struct mdt_rec_setattr {
 	__u32		sa_attr_flags;
 	__u32		sa_mode;
 	__u32		sa_bias;      /* some operation flags */
-	__u32		sa_padding_3;
+	__u32		sa_projid;
 	__u32		sa_padding_4;
 	__u32		sa_padding_5;
 };
@@ -1590,7 +1590,8 @@ struct mdt_rec_setattr {
 #define MDS_ATTR_FROM_OPEN	0x4000ULL /* = 16384, called from open path,
 					   * ie O_TRUNC
 					   */
-#define MDS_ATTR_BLOCKS		0x8000ULL /* = 32768 */
+#define MDS_ATTR_BLOCKS		0x8000ULL  /* = 32768 */
+#define MDS_ATTR_PROJID		0x10000ULL /* = 65536 */
 
 #define MDS_FMODE_CLOSED	00000000
 #define MDS_FMODE_EXEC		00000004
drivers/staging/lustre/lustre/include/cl_object.h +5 -1
index 9ff1ca5..a1e07f8 100644
@@ -165,6 +165,9 @@ struct cl_attr {
 
 	/* nlink of the directory */
 	__u64  cat_nlink;
+
+	/* Project identifier for quota purpose. */
+	u32	cat_projid;
 };
 
 /**
@@ -178,7 +181,8 @@ enum cl_attr_valid {
 	CAT_CTIME  = 1 << 5,
 	CAT_BLOCKS = 1 << 6,
 	CAT_UID    = 1 << 7,
-	CAT_GID    = 1 << 8
+	CAT_GID		= BIT(8),
+	CAT_PROJID	= BIT(9),
 };
 
 /**
drivers/staging/lustre/lustre/include/obd.h +3 -0
index 81b4750..d6a968c 100644
@@ -670,6 +670,7 @@ enum op_xvalid {
 	OP_XVALID_BLOCKS	= BIT(1),	/* 0x0002 */
 	OP_XVALID_OWNEROVERRIDE	= BIT(2),	/* 0x0004 */
 	OP_XVALID_FLAGS		= BIT(3),	/* 0x0008 */
+	OP_XVALID_PROJID	= BIT(4),	/* 0x0010 */
 };
 
 struct lu_context;
@@ -770,6 +771,8 @@ struct md_op_data {
 
 	/* default stripe offset */
 	__u32			op_default_stripe_offset;
+
+	u32			op_projid;
 };
 
 struct md_callback {
drivers/staging/lustre/lustre/llite/dir.c +4 -1
index 9fa0e2e..f1c1c9c 100644
@@ -1667,7 +1667,10 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 
 		return rc;
 	}
-
+	case FS_IOC_FSGETXATTR:
+		return ll_ioctl_fsgetxattr(inode, cmd, arg);
+	case FS_IOC_FSSETXATTR:
+		return ll_ioctl_fssetxattr(inode, cmd, arg);
 	default:
 		return obd_iocontrol(cmd, sbi->ll_dt_exp, 0, NULL,
 				     (void __user *)arg);
drivers/staging/lustre/lustre/llite/file.c +57 -0

69 lines not on this page · raw message

drivers/staging/lustre/lustre/llite/llite_internal.h +4 -1
index ba9ba49..34bcb4b 100644
@@ -808,7 +808,10 @@ int ll_migrate(struct inode *parent, struct file *file, int mdtidx,
 int ll_get_fid_by_name(struct inode *parent, const char *name,
 		       int namelen, struct lu_fid *fid, struct inode **inode);
 int ll_inode_permission(struct inode *inode, int mask);
-
+int ll_ioctl_fsgetxattr(struct inode *inode, unsigned int cmd,
+			unsigned long arg);
+int ll_ioctl_fssetxattr(struct inode *inode, unsigned int cmd,
+			unsigned long arg);
 int ll_lov_setstripe_ea_info(struct inode *inode, struct dentry *dentry,
 			     __u64 flags, struct lov_user_md *lum,
 			     int lum_size);
drivers/staging/lustre/lustre/llite/vvp_object.c +4 -1
index c1f8b50..e1000f6 100644
@@ -95,6 +95,7 @@ static int vvp_attr_get(const struct lu_env *env, struct cl_object *obj,
 	attr->cat_blocks = inode->i_blocks;
 	attr->cat_uid = from_kuid(&init_user_ns, inode->i_uid);
 	attr->cat_gid = from_kgid(&init_user_ns, inode->i_gid);
+	attr->cat_projid = ll_i2info(inode)->lli_projid;
 	/* KMS is not known by this layer */
 	return 0; /* layers below have to fill in the rest */
 }
@@ -116,8 +117,10 @@ static int vvp_attr_update(const struct lu_env *env, struct cl_object *obj,
 		inode->i_ctime.tv_sec = attr->cat_ctime;
 	if (0 && valid & CAT_SIZE)
 		i_size_write(inode, attr->cat_size);
+	if (valid & CAT_PROJID)
+		ll_i2info(inode)->lli_projid = attr->cat_projid;
 	/* not currently necessary */
-	if (0 && valid & (CAT_UID | CAT_GID | CAT_SIZE))
+	if (0 && valid & (CAT_UID | CAT_GID | CAT_SIZE | CAT_PROJID))
 		mark_inode_dirty(inode);
 	return 0;
 }
drivers/staging/lustre/lustre/mdc/mdc_lib.c +3 -0
index 1ab1ad2..415127f 100644
@@ -305,6 +305,8 @@ static inline u64 attr_pack(unsigned int ia_valid, enum op_xvalid ia_xvalid)
 	if (ia_xvalid & OP_XVALID_OWNEROVERRIDE)
 		/* NFSD hack (see bug 5781) */
 		sa_valid |= MDS_OPEN_OWNEROVERRIDE;
+	if (ia_xvalid & OP_XVALID_PROJID)
+		sa_valid |= MDS_ATTR_PROJID;
 	return sa_valid;
 }
 
@@ -323,6 +325,7 @@ static void mdc_setattr_pack_rec(struct mdt_rec_setattr *rec,
 	rec->sa_mode   = op_data->op_attr.ia_mode;
 	rec->sa_uid    = from_kuid(&init_user_ns, op_data->op_attr.ia_uid);
 	rec->sa_gid    = from_kgid(&init_user_ns, op_data->op_attr.ia_gid);
+	rec->sa_projid = op_data->op_projid;
 	rec->sa_size   = op_data->op_attr.ia_size;
 	rec->sa_blocks = op_data->op_attr_blocks;
 	rec->sa_atime  = op_data->op_attr.ia_atime.tv_sec;
drivers/staging/lustre/lustre/osc/osc_cache.c +1 -0
index 5d09a4f..93330cb 100644
@@ -2467,6 +2467,7 @@ int osc_queue_async_io(const struct lu_env *env, struct cl_io *io,
 
 		qid[USRQUOTA] = attr->cat_uid;
 		qid[GRPQUOTA] = attr->cat_gid;
+		qid[PRJQUOTA] = attr->cat_projid;
 		if (rc == 0)
 			rc = osc_quota_chkdq(cli, qid);
 		if (rc)
drivers/staging/lustre/lustre/osc/osc_request.c +6 -5
index 1d21159..b28fbac 100644
@@ -1474,14 +1474,15 @@ static int osc_brw_fini_request(struct ptlrpc_request *req, int rc)
 		return -EPROTO;
 	}
 
-	/* set/clear over quota flag for a uid/gid */
+	/* set/clear over quota flag for a uid/gid/projid */
 	if (lustre_msg_get_opc(req->rq_reqmsg) == OST_WRITE &&
 	    body->oa.o_valid & OBD_MD_FLALLQUOTA) {
-		unsigned int qid[MAXQUOTAS] = { body->oa.o_uid, body->oa.o_gid };
+		unsigned int qid[MAXQUOTAS] = { body->oa.o_uid, body->oa.o_gid,
+						body->oa.o_projid };
 
-		CDEBUG(D_QUOTA, "setdq for [%u %u] with valid %#llx, flags %x\n",
-		       body->oa.o_uid, body->oa.o_gid, body->oa.o_valid,
-		       body->oa.o_flags);
+		CDEBUG(D_QUOTA, "setdq for [%u %u %u] with valid %#llx, flags %x\n",
+		       body->oa.o_uid, body->oa.o_gid, body->oa.o_projid,
+		       body->oa.o_valid, body->oa.o_flags);
 		osc_quota_setdq(cli, qid, body->oa.o_valid, body->oa.o_flags);
 	}
 
drivers/staging/lustre/lustre/ptlrpc/wiretest.c +7 -4
index b4774d6..3aaaebb 100644
@@ -253,6 +253,9 @@ void lustre_assert_wire_constants(void)
 		 (long long)MDS_ATTR_FROM_OPEN);
 	LASSERTF(MDS_ATTR_BLOCKS == 0x0000000000008000ULL, "found 0x%.16llxULL\n",
 		 (long long)MDS_ATTR_BLOCKS);
+	LASSERTF(MDS_ATTR_PROJID == 0x0000000000010000ULL, "found 0x%.16llxULL\n",
+		 (long long)MDS_ATTR_PROJID);
+
 	LASSERTF(FLD_QUERY == 900, "found %lld\n",
 		 (long long)FLD_QUERY);
 	LASSERTF(FLD_FIRST_OPC == 900, "found %lld\n",
@@ -2080,10 +2083,10 @@ void lustre_assert_wire_constants(void)
 		 (long long)(int)offsetof(struct mdt_rec_setattr, sa_bias));
 	LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_bias) == 4, "found %lld\n",
 		 (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_bias));
-	LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_padding_3) == 124, "found %lld\n",
-		 (long long)(int)offsetof(struct mdt_rec_setattr, sa_padding_3));
-	LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_padding_3) == 4, "found %lld\n",
-		 (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_padding_3));
+	LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_projid) == 124, "found %lld\n",
+		 (long long)(int)offsetof(struct mdt_rec_setattr, sa_projid));
+	LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_projid) == 4, "found %lld\n",
+		 (long long)(int)sizeof(((struct mdt_rec_setattr *)0)->sa_projid));
 	LASSERTF((int)offsetof(struct mdt_rec_setattr, sa_padding_4) == 128, "found %lld\n",
 		 (long long)(int)offsetof(struct mdt_rec_setattr, sa_padding_4));
 	LASSERTF((int)sizeof(((struct mdt_rec_setattr *)0)->sa_padding_4) == 4, "found %lld\n",
Signature · 1 line
1.8.3.1
#5 lore raw

PATCH 5/7 lustre: quota: add project inherit attributes

In reply to James Simmons

From: Wang Shilong <[email protected]>

Add @LUSTRE_PROJINHERIT_FL inode flag which means creating new objects parents projid, it is disabled in default, unless setting explicitly.

It is kept same interface as Ext4/XFS, you could use following ioctl directly:

chattr +P <directory>

WC-bug-id: https://jira.whamcloud.com/browse/LU-4017
Reviewed-on: https://review.whamcloud.com/26463
WC-bug-id: https://jira.whamcloud.com/browse/LU-11154
Reviewed-on: https://review.whamcloud.com/32828

---
 .../lustre/include/uapi/linux/lustre/lustre_idl.h       | 17 +++++++++++++++++
 drivers/staging/lustre/lustre/llite/file.c              | 12 ++++++++++++
 drivers/staging/lustre/lustre/llite/llite_internal.h    |  3 +++
 drivers/staging/lustre/lustre/llite/llite_lib.c         | 15 +++++++++++++--
 4 files changed, 45 insertions(+), 2 deletions(-)
drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h +17 -0
index a7b3168..26646f9 100644
@@ -1454,6 +1454,7 @@ enum {
 #define LUSTRE_TOPDIR_FL	0x00020000 /* Top of directory hierarchies*/
 #define LUSTRE_DIRECTIO_FL	0x00100000 /* Use direct i/o */
 #define LUSTRE_INLINE_DATA_FL	0x10000000 /* Inode has inline data. */
+#define LUSTRE_PROJINHERIT_FL	0x20000000 /* Create with parents projid */
 
 /* Convert wire LUSTRE_*_FL to corresponding client local VFS S_* values
  * for the client inode i_flags.  The LUSTRE_*_FL are the Lustre wire
@@ -1480,6 +1481,22 @@ static inline int ll_inode_to_ext_flags(int iflags)
 		((iflags & S_IMMUTABLE) ? LUSTRE_IMMUTABLE_FL : 0));
 }
 
+static inline int ll_xflags_to_inode_flags(int xflags)
+{
+	return ((xflags & FS_XFLAG_SYNC) ? S_SYNC : 0) |
+	       ((xflags & FS_XFLAG_NOATIME) ? S_NOATIME : 0) |
+	       ((xflags & FS_XFLAG_APPEND) ? S_APPEND : 0) |
+	       ((xflags & FS_XFLAG_IMMUTABLE) ? S_IMMUTABLE : 0);
+}
+
+static inline int ll_inode_flags_to_xflags(int flags)
+{
+	return ((flags & S_SYNC) ? FS_XFLAG_SYNC : 0) |
+	       ((flags & S_NOATIME) ? FS_XFLAG_NOATIME : 0) |
+	       ((flags & S_APPEND) ? FS_XFLAG_APPEND : 0) |
+	       ((flags & S_IMMUTABLE) ? FS_XFLAG_IMMUTABLE : 0);
+}
+
 /* 64 possible states */
 enum md_transient_state {
 	MS_RESTORE	= (1 << 0),	/* restore is running */
drivers/staging/lustre/lustre/llite/file.c +12 -0
index 30a731f..72101bd 100644
@@ -99,6 +99,8 @@ static void ll_prepare_close(struct inode *inode, struct md_op_data *op_data,
 	op_data->op_xvalid |= OP_XVALID_CTIME_SET;
 	op_data->op_attr_blocks = inode->i_blocks;
 	op_data->op_attr_flags = ll_inode_to_ext_flags(inode->i_flags);
+	if (test_bit(LLIF_PROJECT_INHERIT, &lli->lli_flags))
+		op_data->op_attr_flags |= LUSTRE_PROJINHERIT_FL;
 	op_data->op_handle = och->och_fh;
 
 	/*
@@ -2151,6 +2153,7 @@ static int ll_ladvise(struct inode *inode, struct file *file, __u64 flags,
 int ll_ioctl_fsgetxattr(struct inode *inode, unsigned int cmd,
 			unsigned long arg)
 {
+	struct ll_inode_info *lli = ll_i2info(inode);
 	struct fsxattr fsxattr;
 
 	if (copy_from_user(&fsxattr,
@@ -2158,6 +2161,9 @@ int ll_ioctl_fsgetxattr(struct inode *inode, unsigned int cmd,
 			   sizeof(fsxattr)))
 		return -EFAULT;
 
+	fsxattr.fsx_xflags = ll_inode_flags_to_xflags(inode->i_flags);
+	if (test_bit(LLIF_PROJECT_INHERIT, &lli->lli_flags))
+		fsxattr.fsx_xflags |= FS_XFLAG_PROJINHERIT;
 	fsxattr.fsx_projid = ll_i2info(inode)->lli_projid;
 	if (copy_to_user((struct fsxattr __user *)arg,
 			  &fsxattr, sizeof(fsxattr)))
@@ -2173,6 +2179,7 @@ int ll_ioctl_fssetxattr(struct inode *inode, unsigned int cmd,
 	struct md_op_data *op_data;
 	struct fsxattr fsxattr;
 	int rc = 0;
+	int flags;
 
 	/* only root could change project ID */
 	if (!capable(CAP_SYS_ADMIN))
@@ -2190,11 +2197,16 @@ int ll_ioctl_fssetxattr(struct inode *inode, unsigned int cmd,
 		goto out_fsxattr;
 	}
 
+	flags = ll_xflags_to_inode_flags(fsxattr.fsx_xflags);
+	op_data->op_attr_flags = ll_inode_to_ext_flags(flags);
+	if (fsxattr.fsx_xflags & FS_XFLAG_PROJINHERIT)
+		op_data->op_attr_flags |= LUSTRE_PROJINHERIT_FL;
 	op_data->op_projid = fsxattr.fsx_projid;
 	op_data->op_xvalid |= OP_XVALID_PROJID;
 	rc = md_setattr(ll_i2sbi(inode)->ll_md_exp, op_data, NULL,
 			0, &req);
 	ptlrpc_req_finished(req);
+	ll_update_inode_flags(inode, op_data->op_attr_flags);
 
 out_fsxattr:
 	ll_finish_md_op_data(op_data);
drivers/staging/lustre/lustre/llite/llite_internal.h +3 -0
index 34bcb4b..aaddebf 100644
@@ -108,6 +108,8 @@ enum ll_file_flags {
 	 * local inode atime.
 	 */
 	LLIF_UPDATE_ATIME,
+	/* Project inherit */
+	LLIF_PROJECT_INHERIT	= 3,
 };
 
 struct ll_inode_info {
@@ -857,6 +859,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr,
 int ll_statfs_internal(struct ll_sb_info *sbi, struct obd_statfs *osfs,
 		       u64 max_age, u32 flags);
 int ll_update_inode(struct inode *inode, struct lustre_md *md);
+void ll_update_inode_flags(struct inode *inode, int ext_flags);
 int ll_read_inode2(struct inode *inode, void *opaque);
 void ll_delete_inode(struct inode *inode);
 int ll_iocontrol(struct inode *inode, struct file *file,
drivers/staging/lustre/lustre/llite/llite_lib.c +13 -2
index 7320dc8..fac6584 100644
@@ -1791,6 +1791,17 @@ void ll_inode_size_unlock(struct inode *inode)
 	mutex_unlock(&lli->lli_size_mutex);
 }
 
+void ll_update_inode_flags(struct inode *inode, int ext_flags)
+{
+	struct ll_inode_info *lli = ll_i2info(inode);
+
+	inode->i_flags = ll_ext_to_inode_flags(ext_flags);
+	if (ext_flags & LUSTRE_PROJINHERIT_FL)
+		set_bit(LLIF_PROJECT_INHERIT, &lli->lli_flags);
+	else
+		clear_bit(LLIF_PROJECT_INHERIT, &lli->lli_flags);
+}
+
 int ll_update_inode(struct inode *inode, struct lustre_md *md)
 {
 	struct ll_inode_info *lli = ll_i2info(inode);
@@ -1862,7 +1873,7 @@ int ll_update_inode(struct inode *inode, struct lustre_md *md)
 	if (body->mbo_valid & OBD_MD_FLPROJID)
 		lli->lli_projid = body->mbo_projid;
 	if (body->mbo_valid & OBD_MD_FLFLAGS)
-		inode->i_flags = ll_ext_to_inode_flags(body->mbo_flags);
+		ll_update_inode_flags(inode, body->mbo_flags);
 	if (body->mbo_valid & OBD_MD_FLNLINK)
 		set_nlink(inode, body->mbo_nlink);
 	if (body->mbo_valid & OBD_MD_FLRDEV)
@@ -2024,7 +2035,7 @@ int ll_iocontrol(struct inode *inode, struct file *file,
 		if (rc)
 			return rc;
 
-		inode->i_flags = ll_ext_to_inode_flags(flags);
+		ll_update_inode_flags(inode, flags);
 
 		obj = ll_i2info(inode)->lli_clob;
 		if (!obj)
Signature · 1 line
1.8.3.1
#6 lore raw

PATCH 6/7 lustre: llite: extend inode flags into GET/SETXATTR ioctl

In reply to James Simmons

From: Wang Shilong <[email protected]>

This is very useful for projet quota tools to save RPC call to change project inherit attribute together with project ID.

WC-bug-id: https://jira.whamcloud.com/browse/LU-10030
Reviewed-on: https://review.whamcloud.com/30072
WC-bug-id: https://jira.whamcloud.com/browse/LU-11165
Reviewed-on: https://review.whamcloud.com/32860

---
 drivers/staging/lustre/lustre/llite/file.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
drivers/staging/lustre/lustre/llite/file.c +17 -0
index 72101bd..f69eefc 100644
@@ -2178,6 +2178,8 @@ int ll_ioctl_fssetxattr(struct inode *inode, unsigned int cmd,
 	struct ptlrpc_request *req = NULL;
 	struct md_op_data *op_data;
 	struct fsxattr fsxattr;
+	struct cl_object *obj;
+	struct iattr *attr;
 	int rc = 0;
 	int flags;
 
@@ -2206,8 +2208,23 @@ int ll_ioctl_fssetxattr(struct inode *inode, unsigned int cmd,
 	rc = md_setattr(ll_i2sbi(inode)->ll_md_exp, op_data, NULL,
 			0, &req);
 	ptlrpc_req_finished(req);
+	if (rc)
+		goto out_fsxattr;
+
 	ll_update_inode_flags(inode, op_data->op_attr_flags);
+	obj = ll_i2info(inode)->lli_clob;
+	if (!obj)
+		goto out_fsxattr;
+
+	attr = kzalloc(sizeof(*attr), GFP_KERNEL);
+	if (!attr) {
+		rc = -ENOMEM;
+		goto out_fsxattr;
+	}
 
+	rc = cl_setattr_ost(obj, attr, OP_XVALID_FLAGS,
+			    fsxattr.fsx_xflags);
+	kfree(attr);
 out_fsxattr:
 	ll_finish_md_op_data(op_data);
 	return rc;
Signature · 1 line
1.8.3.1
#7 lore raw

PATCH 7/7 lustre: ioctl: Add BLKSSZGET ioctl support

In reply to James Simmons

From: Emoly Liu <[email protected]>

Add BLKSSZGET ioctl and return PAGE_SIZE for the minimun alignment from ll_file_ioctl() for this call.

WC-bug-id: https://jira.whamcloud.com/browse/LU-9347
Reviewed-on: https://review.whamcloud.com/28578

---
 drivers/staging/lustre/lustre/llite/file.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/staging/lustre/lustre/llite/file.c +2 -0
index f69eefc..d3ddfd2 100644
@@ -2618,6 +2618,8 @@ int ll_ioctl_fssetxattr(struct inode *inode, unsigned int cmd,
 		return ll_ioctl_fsgetxattr(inode, cmd, arg);
 	case FS_IOC_FSSETXATTR:
 		return ll_ioctl_fssetxattr(inode, cmd, arg);
+	case BLKSSZGET:
+		return put_user(PAGE_SIZE, (int __user *)arg);
 	default: {
 		int err;
 
Signature · 1 line
1.8.3.1