Whamcloud - gitweb
LU-2097 quota: missing ll_vfs_dq_init()
authorNiu Yawei <niu@whamcloud.com>
Mon, 8 Oct 2012 09:55:36 +0000 (05:55 -0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 9 Oct 2012 02:51:45 +0000 (22:51 -0400)
ll_vfs_dq_init() should be called before operating on the system
objects (like llog, oi, last_rcvd, etc.), otherwise, block accounting
will be missed if object is already existing.

Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: I922c9ca8caebf52ae07fd130c41286dad68c1b8f
Reviewed-on: http://review.whamcloud.com/4220
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osd-ldiskfs/osd_io.c
lustre/osd-ldiskfs/osd_oi.c

index ef045a5..84aabbe 100644 (file)
@@ -1123,6 +1123,8 @@ static ssize_t osd_write(const struct lu_env *env, struct dt_object *dt,
                 return -EACCES;
 
         LASSERT(handle != NULL);
                 return -EACCES;
 
         LASSERT(handle != NULL);
+       LASSERT(inode != NULL);
+       ll_vfs_dq_init(inode);
 
         /* XXX: don't check: one declared chunk can be used many times */
         /* OSD_EXEC_OP(handle, write); */
 
         /* XXX: don't check: one declared chunk can be used many times */
         /* OSD_EXEC_OP(handle, write); */
@@ -1193,6 +1195,8 @@ static int osd_punch(const struct lu_env *env, struct dt_object *dt,
         LASSERT(end == OBD_OBJECT_EOF);
         LASSERT(dt_object_exists(dt));
         LASSERT(osd_invariant(obj));
         LASSERT(end == OBD_OBJECT_EOF);
         LASSERT(dt_object_exists(dt));
         LASSERT(osd_invariant(obj));
+       LASSERT(inode != NULL);
+       ll_vfs_dq_init(inode);
 
         LASSERT(th);
         oh = container_of(th, struct osd_thandle, ot_super);
 
         LASSERT(th);
         oh = container_of(th, struct osd_thandle, ot_super);
index 4319f47..d24ec33 100644 (file)
@@ -532,6 +532,7 @@ static int osd_oi_iam_insert(struct osd_thread_info *oti, struct osd_oi *oi,
 
         LASSERT(oi);
         LASSERT(oi->oi_inode);
 
         LASSERT(oi);
         LASSERT(oi->oi_inode);
+       ll_vfs_dq_init(oi->oi_inode);
 
         bag = &oi->oi_dir.od_container;
         ipd = osd_idx_ipd_get(oti->oti_env, bag);
 
         bag = &oi->oi_dir.od_container;
         ipd = osd_idx_ipd_get(oti->oti_env, bag);
@@ -587,6 +588,8 @@ static int osd_oi_iam_delete(struct osd_thread_info *oti, struct osd_oi *oi,
         ENTRY;
 
         LASSERT(oi);
         ENTRY;
 
         LASSERT(oi);
+       LASSERT(oi->oi_inode);
+       ll_vfs_dq_init(oi->oi_inode);
 
         bag = &oi->oi_dir.od_container;
         ipd = osd_idx_ipd_get(oti->oti_env, bag);
 
         bag = &oi->oi_dir.od_container;
         ipd = osd_idx_ipd_get(oti->oti_env, bag);