From Craig at craiginches.com Mon Apr 3 21:13:29 2017 From: Craig at craiginches.com (Craig Inches) Date: Mon, 3 Apr 2017 22:13:29 +0100 Subject: [lustre-devel] [PATCH] Staging: lustre cleanup macros in libcfs_private.h Message-ID: <20170403211329.20264-1-Craig@craiginches.com> This resolves a checkpatch warning that "Single statement macros should not use a do {} while (0) loop" by removing the loop and adjusting line length accordingly. Signed-off-by: Craig Inches --- .../lustre/include/linux/libcfs/libcfs_private.h | 51 +++++++--------------- 1 file changed, 15 insertions(+), 36 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h index 2dae857..150454f 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h @@ -87,12 +87,9 @@ do { \ #define LIBCFS_VMALLOC_SIZE (2 << PAGE_SHIFT) /* 2 pages */ #endif -#define LIBCFS_ALLOC_PRE(size, mask) \ -do { \ - LASSERT(!in_interrupt() || \ - ((size) <= LIBCFS_VMALLOC_SIZE && \ - !gfpflags_allow_blocking(mask))); \ -} while (0) +#define LIBCFS_ALLOC_PRE(size, mask) \ + LASSERT(!in_interrupt() || ((size) <= LIBCFS_VMALLOC_SIZE \ + && !gfpflags_allow_blocking(mask))) #define LIBCFS_ALLOC_POST(ptr, size) \ do { \ @@ -187,46 +184,28 @@ void cfs_array_free(void *vars); #if LASSERT_ATOMIC_ENABLED /** assert value of @a is equal to @v */ -#define LASSERT_ATOMIC_EQ(a, v) \ -do { \ - LASSERTF(atomic_read(a) == v, \ - "value: %d\n", atomic_read((a))); \ -} while (0) +#define LASSERT_ATOMIC_EQ(a, v) LASSERTF(atomic_read(a) == v, \ + "value: %d\n", atomic_read((a))) /** assert value of @a is unequal to @v */ -#define LASSERT_ATOMIC_NE(a, v) \ -do { \ - LASSERTF(atomic_read(a) != v, \ - "value: %d\n", atomic_read((a))); \ -} while (0) +#define LASSERT_ATOMIC_NE(a, v) LASSERTF(atomic_read(a) != v, \ + "value: %d\n", atomic_read((a))) /** assert value of @a is little than @v */ -#define LASSERT_ATOMIC_LT(a, v) \ -do { \ - LASSERTF(atomic_read(a) < v, \ - "value: %d\n", atomic_read((a))); \ -} while (0) +#define LASSERT_ATOMIC_LT(a, v) LASSERTF(atomic_read(a) < v, \ + "value: %d\n", atomic_read((a))) /** assert value of @a is little/equal to @v */ -#define LASSERT_ATOMIC_LE(a, v) \ -do { \ - LASSERTF(atomic_read(a) <= v, \ - "value: %d\n", atomic_read((a))); \ -} while (0) +#define LASSERT_ATOMIC_LE(a, v) LASSERTF(atomic_read(a) <= v, \ + "value: %d\n", atomic_read((a))) /** assert value of @a is great than @v */ -#define LASSERT_ATOMIC_GT(a, v) \ -do { \ - LASSERTF(atomic_read(a) > v, \ - "value: %d\n", atomic_read((a))); \ -} while (0) +#define LASSERT_ATOMIC_GT(a, v) LASSERTF(atomic_read(a) > v, \ + "value: %d\n", atomic_read((a))) /** assert value of @a is great/equal to @v */ -#define LASSERT_ATOMIC_GE(a, v) \ -do { \ - LASSERTF(atomic_read(a) >= v, \ - "value: %d\n", atomic_read((a))); \ -} while (0) +#define LASSERT_ATOMIC_GE(a, v) LASSERTF(atomic_read(a) >= v, \ + "value: %d\n", atomic_read((a))) /** assert value of @a is great than @v1 and little than @v2 */ #define LASSERT_ATOMIC_GT_LT(a, v1, v2) \ -- 2.10.2 From gregkh at linuxfoundation.org Tue Apr 4 05:34:55 2017 From: gregkh at linuxfoundation.org (Greg KH) Date: Tue, 4 Apr 2017 07:34:55 +0200 Subject: [lustre-devel] [PATCH v2] Remove sparse warnings in mdc_request.c In-Reply-To: <1491283537-13023-1-git-send-email-skanda.kashyap@gmail.com> References: <1592C3AC-DE8B-4A11-8053-02B82A61E1B3@intel.com> <1491283537-13023-1-git-send-email-skanda.kashyap@gmail.com> Message-ID: <20170404053455.GA9895@kroah.com> On Mon, Apr 03, 2017 at 10:25:37PM -0700, skanda.kashyap at gmail.com wrote: > From: Skanda Guruanand > > Signed-off-by: Skanda Guruanand > > I have modified struct lu_dirpage as suggested in lustre_idl.h file > > CHECK drivers/staging/lustre/lustre/mdc/mdc_request.c > drivers/staging/lustre/lustre/mdc/mdc_request.c:958:42: warning: cast > to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:959:42: warning: cast > to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:962:42: warning: cast > to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:963:42: warning: cast > to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:985:50: warning: cast > to restricted __le32 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1193:24: warning: cast > to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1328:25: warning: cast > to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1329:23: warning: cast > to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1332:25: warning: cast > to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1333:23: warning: cast > to restricted __le64 > > --- > drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) What changed from v1? Always put that here below the --- line. v3? thanks, greg k-h From dan.carpenter at oracle.com Tue Apr 4 09:38:52 2017 From: dan.carpenter at oracle.com (Dan Carpenter) Date: Tue, 4 Apr 2017 12:38:52 +0300 Subject: [lustre-devel] [PATCH] drivers/staging/lustre: Coding-guideline: Missing a blank line after declarations In-Reply-To: <1491297326-28973-1-git-send-email-pushkar.iit@gmail.com> References: <1491297326-28973-1-git-send-email-pushkar.iit@gmail.com> Message-ID: <20170404093851.GB4521@mwanda> On Tue, Apr 04, 2017 at 02:45:26PM +0530, Pushkar Jambhlekar wrote: > diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c b/drivers/staging/lustre/lustre/obdclass/cl_page.c > index cd9a40c..71fcc4c 100644 > --- a/drivers/staging/lustre/lustre/obdclass/cl_page.c > +++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c > @@ -482,6 +482,7 @@ void cl_page_disown0(const struct lu_env *env, > int cl_page_is_owned(const struct cl_page *pg, const struct cl_io *io) > { > struct cl_io *top = cl_io_top((struct cl_io *)io); > + > LINVRNT(cl_object_same(pg->cp_obj, io->ci_obj)); > return pg->cp_state == CPS_OWNED && pg->cp_owner == top; > } This is not related to the patch but I don't understand CLOBINVRNT() and LINVRNT(). # define LINVRNT(exp) LASSERT(exp) # define LINVRNT(exp) ((void)sizeof !!(exp)) Why do we do the sizeof() instead of just an empty define? The compiler calculates the size at compile time and doesn't execute the expression so it's the same as an empty define so far as I can tell. regards, dan carpenter From gregkh at linuxfoundation.org Tue Apr 4 18:29:34 2017 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Tue, 4 Apr 2017 20:29:34 +0200 Subject: [lustre-devel] [PATCH] drivers/staging/lustre: Replacing 'unsigned' with 'unsigned int' In-Reply-To: <1491299043-29224-1-git-send-email-pushkar.iit@gmail.com> References: <1491299043-29224-1-git-send-email-pushkar.iit@gmail.com> Message-ID: <20170404182934.GA3697@kroah.com> On Tue, Apr 04, 2017 at 03:14:03PM +0530, Pushkar Jambhlekar wrote: > Replacing 'unsigned' with 'unsigned int' Why? You need to explain why you do something, not just say what you did (that should be obvious if you read the patch...) thanks, greg k-h From oleg.drokin at intel.com Wed Apr 5 06:03:38 2017 From: oleg.drokin at intel.com (Oleg Drokin) Date: Wed, 5 Apr 2017 02:03:38 -0400 Subject: [lustre-devel] New tag 2.9.55 Message-ID: <724028D8-3028-47CF-9A5B-9AAAC87465E2@intel.com> Hello! I just tagged a new tag 2.9.55 in Lustre master repo. Of note in this tag: snapshot feature for zfs backends was added. Here's the changelog: Abrarahmed Momin (1): LU-5361 llite: Remove OBD_FAIL_OSC_CONNECT_CKSUM Al Viro (1): LU-4423 llite: get rid of lustre_dump_dentry() Andreas Dilger (14): LU-4825 ofd: fix OBD_FAIL_OST_ENOINO/ENOSPC behaviour LU-9161 utils: don't load bitmaps when checking features LU-8813 gss: limit the number of error messages in logs LU-9176 osd-zfs: improve statfs estimate for ZFS LU-7537 tests: clean up sanity test_133c LU-9201 libcfs: reduce libcfs checksum speed test time LU-5964 tests: open a large number of files at once LU-7092 tests: generate sanity proc_dirs on facet LU-1095 mdt: quiet mdt_mfd_set_mode() debugging LU-9153 utils: improve llog name parsing LU-5969 tests: allow "version" without "lustre:" prefix LU-137 obdclass: add dt_object_put() and use it LU-1095 obdclass: improve missing operation message LU-6051 utils: improve efficiency of lfs_migrate cmp Andriy Skulysh (1): LU-8624 osc: hung in osc_destroy() Arnd Bergmann (1): LU-4423 ptlrpc: use 64-bit time for debugfs import state output Bob Glossman (3): LU-9138 kernel: kernel update [SLES12 SP1 3.12.69-60.64.32] LU-9174 kernel: kernel update RHEL7.3 [3.10.0-514.10.2.el7] LU-9169 kernel: kernel update [SLES12 SP2 4.4.49-92.11] Bruno Faccini (2): LU-8808 mdt: avoid out of order ChangeLog during restore LU-8907 llite: handle client racy case during create Chris Horn (1): LU-8735 llite: Return -ERESTARTSYS in range_lock() Di Wang (1): LU-9197 llog: return 0 if llog destroy fails Dmitry Eremin (1): LU-9026 o2iblnd: Adapt to the removal of ib_get_dma_mr() Emoly Liu (1): LU-9085 llstat: don't use a hash as a reference Fan Yong (14): LU-8900 snapshot: operate write barrier on MDT LU-8662 osd-ldiskfs: check OI mapping update LU-8900 snapshot: check write barrier before modification LU-8900 snapshot: user interface for write barrier on MDT LU-8900 snapshot: fork/erase configuration LU-8900 snapshot: simulate readonly device LU-8900 snapshot: rename filesysetem fsname LU-9040 scrub: handle group boundary properly (2) LU-8701 tests: scrub-performance with separated MGS and MDS LU-8930 lfsck: sync failure with others no check LF_INCOMPLETE LU-9231 tests: cleanup obdecho before iokit exit LU-8900 snapshot: user space snapshot tools LU-8900 doc: Lustre snapshot man page LU-9224 fid: race between client_fid_fini and seq_client_flush Jadhav Vikram (1): LU-8952 tests: handling test specific cleanup of ost pools James Nunez (1): LU-8366 test: Remove PIOS tests James Simmons (5): LU-9019 zfs: use 64-bit timestamps for brw stats LU-9019 msg : migrate IR stats to 64 bit time LU-9019 socklnd: use 64-bit incarnation time stamp LU-6401 uapi: split lustre_disk.h into two headers LU-9019 obd: use 64-bit time for obd_recovery_* fields Jian Yu (1): LU-9213 scripts: check MGT status in lustre init script Jinshan Xiong (3): LU-7497 tests: Fix test failure in conf-sanity 32b LU-9129 llite: ignore layout for ll_writepages() LU-2435 osd-zfs: use zfs native dnode accounting John L. Hammond (6): LU-9167 hsm: use a new environment during HSM purge LU-8820 hsm: skip LL_IOC_HSM_COPY_START for HSM removes LU-8918 obdclass: hoist locking in lu_context_exit() LU-9010 obdclass: use static initializer macros where possible LU-9014 test: handle separate MGS in conf-sanity test_72() LU-8403 obd: remove unused data parameter from obd_notify() Keith (1): LU-9223: Server on Linux 4.4: XATTR_NAME_POSIX_ACL_ACCESS Lai Siyao (1): LU-8857 config: refactor sptlrpc config process Michael Kuhn (1): LU-9003 mdc: support posix_acl_valid with user namespace Mikhal Pershin (1): LU-9066 ldlm: don't evict client on umount if AST fails Minh Diep (1): LU-9222 build: workaround for sles11sp4 MOFED Nathaniel Clark (1): LU-9107 build: Update SPL/ZFS to 0.6.5.9 Nikitas Angelinas (1): LU-7131 utils: add "--erase-param" option to tunefs.lustre Niu Yawei (3): LU-8306 ldlm: send blocking ASTs after lock replay LU-9216 config: move config types into lustre_idl.h LU-8872 quota: incorrect LASSERT Oleg Drokin (1): New tag 2.9.55 Parinay Kondekar (2): LU-9182 tests: SKIP sanity/205 for older version of MDS LU-9117 tests: SKIP sanity/129 on older MDS versions Sebastien Buisson (1): LU-8880 gss: fix GSS support for DNE Wei Liu (3): LU-6707 test: load loop module to have loop devices LU-7790 test: skip test_130a and test_130b if server is less than 2.7.2 LU-9102 test: Include specific headers needed by Posix suite Yang Sheng (1): LU-9170 test: fix for hostlist_expand wangdi (1): LU-9088 osd: use od_is_ost check OST FID From andreas.dilger at intel.com Wed Apr 5 09:54:37 2017 From: andreas.dilger at intel.com (Dilger, Andreas) Date: Wed, 5 Apr 2017 09:54:37 +0000 Subject: [lustre-devel] [PATCH] drivers/staging/lustre: Coding-guideline: Missing a blank line after declarations In-Reply-To: <20170404093851.GB4521@mwanda> References: <1491297326-28973-1-git-send-email-pushkar.iit@gmail.com> <20170404093851.GB4521@mwanda> Message-ID: <83E1BF85-E9B7-44D4-96A0-2D6C41DFC6A6@intel.com> On Apr 4, 2017, at 03:38, Dan Carpenter wrote: > > On Tue, Apr 04, 2017 at 02:45:26PM +0530, Pushkar Jambhlekar wrote: >> diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c b/drivers/staging/lustre/lustre/obdclass/cl_page.c >> index cd9a40c..71fcc4c 100644 >> --- a/drivers/staging/lustre/lustre/obdclass/cl_page.c >> +++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c >> @@ -482,6 +482,7 @@ void cl_page_disown0(const struct lu_env *env, >> int cl_page_is_owned(const struct cl_page *pg, const struct cl_io *io) >> { >> struct cl_io *top = cl_io_top((struct cl_io *)io); >> + >> LINVRNT(cl_object_same(pg->cp_obj, io->ci_obj)); >> return pg->cp_state == CPS_OWNED && pg->cp_owner == top; >> } > > This is not related to the patch but I don't understand CLOBINVRNT() and > LINVRNT(). > > # define LINVRNT(exp) LASSERT(exp) > # define LINVRNT(exp) ((void)sizeof !!(exp)) > > Why do we do the sizeof() instead of just an empty define? The compiler > calculates the size at compile time and doesn't execute the expression > so it's the same as an empty define so far as I can tell. Even though sizeof() is evaluated at compile time and not runtime, it will at least evaluate the expression "exp" at compile time. This is useful to avoid "unused variable" warnings, syntax errors, etc. in that code when the more expensive LINVRNT() checking is enabled, but is disabled most of the time. With an empty expression this wouldn't happen at all, and errors may creep in. Cheers, Andreas -- Andreas Dilger Lustre Principal Architect Intel Corporation From andreas.dilger at intel.com Wed Apr 5 10:14:39 2017 From: andreas.dilger at intel.com (Dilger, Andreas) Date: Wed, 5 Apr 2017 10:14:39 +0000 Subject: [lustre-devel] [PATCH] Staging: lustre cleanup macros in libcfs_private.h In-Reply-To: <20170403211329.20264-1-Craig@craiginches.com> References: <20170403211329.20264-1-Craig@craiginches.com> Message-ID: <60C0D42C-256A-4883-A0AF-C7E2CFA904BD@intel.com> On Apr 3, 2017, at 15:13, Craig Inches wrote: > > This resolves a checkpatch warning that "Single statement macros should > not use a do {} while (0) loop" by removing the loop and adjusting line > length accordingly. > > Signed-off-by: Craig Inches > --- > .../lustre/include/linux/libcfs/libcfs_private.h | 51 +++++++--------------- > 1 file changed, 15 insertions(+), 36 deletions(-) > > diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h > index 2dae857..150454f 100644 > --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h > +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h > @@ -87,12 +87,9 @@ do { \ > #define LIBCFS_VMALLOC_SIZE (2 << PAGE_SHIFT) /* 2 pages */ > #endif > > -#define LIBCFS_ALLOC_PRE(size, mask) \ > -do { \ > - LASSERT(!in_interrupt() || \ > - ((size) <= LIBCFS_VMALLOC_SIZE && \ > - !gfpflags_allow_blocking(mask))); \ > -} while (0) > +#define LIBCFS_ALLOC_PRE(size, mask) \ > + LASSERT(!in_interrupt() || ((size) <= LIBCFS_VMALLOC_SIZE \ > + && !gfpflags_allow_blocking(mask))) (style) keep operators at the end of the previous line, rather than the start of the continued line > > #define LIBCFS_ALLOC_POST(ptr, size) \ > do { \ > @@ -187,46 +184,28 @@ void cfs_array_free(void *vars); > #if LASSERT_ATOMIC_ENABLED > > /** assert value of @a is equal to @v */ > -#define LASSERT_ATOMIC_EQ(a, v) \ > -do { \ > - LASSERTF(atomic_read(a) == v, \ > - "value: %d\n", atomic_read((a))); \ > -} while (0) > +#define LASSERT_ATOMIC_EQ(a, v) LASSERTF(atomic_read(a) == v, \ > + "value: %d\n", atomic_read((a))) Minor nit - in cases like this where you need to split the line anyway, it is cleaner (IMHO) to keep the whole statement together: #define LASSERT_ATOMIC_EQ(a, v) \ LASSERTF(atomic_read(a) == v, "value: %d\n", atomic_read((a))) Cheers, Andreas > > /** assert value of @a is unequal to @v */ > -#define LASSERT_ATOMIC_NE(a, v) \ > -do { \ > - LASSERTF(atomic_read(a) != v, \ > - "value: %d\n", atomic_read((a))); \ > -} while (0) > +#define LASSERT_ATOMIC_NE(a, v) LASSERTF(atomic_read(a) != v, \ > + "value: %d\n", atomic_read((a))) > > /** assert value of @a is little than @v */ > -#define LASSERT_ATOMIC_LT(a, v) \ > -do { \ > - LASSERTF(atomic_read(a) < v, \ > - "value: %d\n", atomic_read((a))); \ > -} while (0) > +#define LASSERT_ATOMIC_LT(a, v) LASSERTF(atomic_read(a) < v, \ > + "value: %d\n", atomic_read((a))) > > /** assert value of @a is little/equal to @v */ > -#define LASSERT_ATOMIC_LE(a, v) \ > -do { \ > - LASSERTF(atomic_read(a) <= v, \ > - "value: %d\n", atomic_read((a))); \ > -} while (0) > +#define LASSERT_ATOMIC_LE(a, v) LASSERTF(atomic_read(a) <= v, \ > + "value: %d\n", atomic_read((a))) > > /** assert value of @a is great than @v */ > -#define LASSERT_ATOMIC_GT(a, v) \ > -do { \ > - LASSERTF(atomic_read(a) > v, \ > - "value: %d\n", atomic_read((a))); \ > -} while (0) > +#define LASSERT_ATOMIC_GT(a, v) LASSERTF(atomic_read(a) > v, \ > + "value: %d\n", atomic_read((a))) > > /** assert value of @a is great/equal to @v */ > -#define LASSERT_ATOMIC_GE(a, v) \ > -do { \ > - LASSERTF(atomic_read(a) >= v, \ > - "value: %d\n", atomic_read((a))); \ > -} while (0) > +#define LASSERT_ATOMIC_GE(a, v) LASSERTF(atomic_read(a) >= v, \ > + "value: %d\n", atomic_read((a))) > > /** assert value of @a is great than @v1 and little than @v2 */ > #define LASSERT_ATOMIC_GT_LT(a, v1, v2) \ > -- > 2.10.2 > Cheers, Andreas -- Andreas Dilger Lustre Principal Architect Intel Corporation From Craig at craiginches.com Wed Apr 5 13:30:42 2017 From: Craig at craiginches.com (Craig Inches) Date: Wed, 5 Apr 2017 14:30:42 +0100 Subject: [lustre-devel] [PATCH v2] Staging: lustre cleanup macros in libcfs_private.h Message-ID: <20170405133042.4619-1-Craig@craiginches.com> This resolves a checkpatch warning that "Single statement macros should not use a do {} while (0) loop" by removing the loop and adjusting line length accordingly. Signed-off-by: Craig Inches --- Changes in v2: - Kept statements together - Kept operator on previous line .../lustre/include/linux/libcfs/libcfs_private.h | 51 +++++++--------------- 1 file changed, 15 insertions(+), 36 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h index 2dae857..e774c75 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h @@ -87,12 +87,9 @@ do { \ #define LIBCFS_VMALLOC_SIZE (2 << PAGE_SHIFT) /* 2 pages */ #endif -#define LIBCFS_ALLOC_PRE(size, mask) \ -do { \ - LASSERT(!in_interrupt() || \ - ((size) <= LIBCFS_VMALLOC_SIZE && \ - !gfpflags_allow_blocking(mask))); \ -} while (0) +#define LIBCFS_ALLOC_PRE(size, mask) \ + LASSERT(!in_interrupt() || ((size) <= LIBCFS_VMALLOC_SIZE && \ + !gfpflags_allow_blocking(mask))) #define LIBCFS_ALLOC_POST(ptr, size) \ do { \ @@ -187,46 +184,28 @@ void cfs_array_free(void *vars); #if LASSERT_ATOMIC_ENABLED /** assert value of @a is equal to @v */ -#define LASSERT_ATOMIC_EQ(a, v) \ -do { \ - LASSERTF(atomic_read(a) == v, \ - "value: %d\n", atomic_read((a))); \ -} while (0) +#define LASSERT_ATOMIC_EQ(a, v) \ + LASSERTF(atomic_read(a) == v, "value: %d\n", atomic_read((a))) /** assert value of @a is unequal to @v */ -#define LASSERT_ATOMIC_NE(a, v) \ -do { \ - LASSERTF(atomic_read(a) != v, \ - "value: %d\n", atomic_read((a))); \ -} while (0) +#define LASSERT_ATOMIC_NE(a, v) \ + LASSERTF(atomic_read(a) != v, "value: %d\n", atomic_read((a))) /** assert value of @a is little than @v */ -#define LASSERT_ATOMIC_LT(a, v) \ -do { \ - LASSERTF(atomic_read(a) < v, \ - "value: %d\n", atomic_read((a))); \ -} while (0) +#define LASSERT_ATOMIC_LT(a, v) \ + LASSERTF(atomic_read(a) < v, "value: %d\n", atomic_read((a))) /** assert value of @a is little/equal to @v */ -#define LASSERT_ATOMIC_LE(a, v) \ -do { \ - LASSERTF(atomic_read(a) <= v, \ - "value: %d\n", atomic_read((a))); \ -} while (0) +#define LASSERT_ATOMIC_LE(a, v) \ + LASSERTF(atomic_read(a) <= v, "value: %d\n", atomic_read((a))) /** assert value of @a is great than @v */ -#define LASSERT_ATOMIC_GT(a, v) \ -do { \ - LASSERTF(atomic_read(a) > v, \ - "value: %d\n", atomic_read((a))); \ -} while (0) +#define LASSERT_ATOMIC_GT(a, v) \ + LASSERTF(atomic_read(a) > v, "value: %d\n", atomic_read((a))) /** assert value of @a is great/equal to @v */ -#define LASSERT_ATOMIC_GE(a, v) \ -do { \ - LASSERTF(atomic_read(a) >= v, \ - "value: %d\n", atomic_read((a))); \ -} while (0) +#define LASSERT_ATOMIC_GE(a, v) \ + LASSERTF(atomic_read(a) >= v, "value: %d\n", atomic_read((a))) /** assert value of @a is great than @v1 and little than @v2 */ #define LASSERT_ATOMIC_GT_LT(a, v1, v2) \ -- 2.10.2 From john.hammond at intel.com Wed Apr 5 13:41:47 2017 From: john.hammond at intel.com (Hammond, John) Date: Wed, 5 Apr 2017 13:41:47 +0000 Subject: [lustre-devel] [PATCH] drivers/staging/lustre: Coding-guideline: Missing a blank line after declarations In-Reply-To: <20170404093851.GB4521@mwanda> References: <1491297326-28973-1-git-send-email-pushkar.iit@gmail.com> <20170404093851.GB4521@mwanda> Message-ID: > On Tue, Apr 04, 2017 at 02:45:26PM +0530, Pushkar Jambhlekar wrote: > > diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c > > b/drivers/staging/lustre/lustre/obdclass/cl_page.c > > index cd9a40c..71fcc4c 100644 > > --- a/drivers/staging/lustre/lustre/obdclass/cl_page.c > > +++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c > > @@ -482,6 +482,7 @@ void cl_page_disown0(const struct lu_env *env, > > int cl_page_is_owned(const struct cl_page *pg, const struct cl_io *io) > > { > > struct cl_io *top = cl_io_top((struct cl_io *)io); > > + > > LINVRNT(cl_object_same(pg->cp_obj, io->ci_obj)); > > return pg->cp_state == CPS_OWNED && pg->cp_owner == top; } > > This is not related to the patch but I don't understand CLOBINVRNT() and > LINVRNT(). > > # define LINVRNT(exp) LASSERT(exp) > # define LINVRNT(exp) ((void)sizeof !!(exp)) > > Why do we do the sizeof() instead of just an empty define? The compiler > calculates the size at compile time and doesn't execute the expression so it's the > same as an empty define so far as I can tell. This is someone's attempt to avoid the unused variable warnings which would occur in some places when LINVRNT(exp) is defined as ((void)0). From andreas.dilger at intel.com Fri Apr 7 10:08:18 2017 From: andreas.dilger at intel.com (Dilger, Andreas) Date: Fri, 7 Apr 2017 10:08:18 +0000 Subject: [lustre-devel] [PATCH 6/6] staging/lustre: Use generic range rwlock In-Reply-To: <20170406084620.22700-7-dave@stgolabs.net> References: <20170406084620.22700-1-dave@stgolabs.net> <20170406084620.22700-7-dave@stgolabs.net> Message-ID: <2BBAD983-69DA-47B4-9879-9B503CF86B6B@intel.com> On Apr 6, 2017, at 02:46, Davidlohr Bueso wrote: > > This replaces the in-house version, which is also derived > from Jan's interval tree implementation. > > Cc: oleg.drokin at intel.com > Cc: andreas.dilger at intel.com > Cc: jsimmons at infradead.org > Cc: lustre-devel at lists.lustre.org > Signed-off-by: Davidlohr Bueso This patch looks fine, but it would probably be better to also post the whole series on linux-fsdevel for further review. Cheers, Andreas > --- > drivers/staging/lustre/lustre/llite/Makefile | 2 +- > drivers/staging/lustre/lustre/llite/file.c | 21 +- > .../staging/lustre/lustre/llite/llite_internal.h | 4 +- > drivers/staging/lustre/lustre/llite/llite_lib.c | 3 +- > drivers/staging/lustre/lustre/llite/range_lock.c | 239 --------------------- > drivers/staging/lustre/lustre/llite/range_lock.h | 82 ------- > 6 files changed, 15 insertions(+), 336 deletions(-) > delete mode 100644 drivers/staging/lustre/lustre/llite/range_lock.c > delete mode 100644 drivers/staging/lustre/lustre/llite/range_lock.h > > diff --git a/drivers/staging/lustre/lustre/llite/Makefile b/drivers/staging/lustre/lustre/llite/Makefile > index 322d4fa63f5d..922a901bc62c 100644 > --- a/drivers/staging/lustre/lustre/llite/Makefile > +++ b/drivers/staging/lustre/lustre/llite/Makefile > @@ -1,6 +1,6 @@ > obj-$(CONFIG_LUSTRE_FS) += lustre.o > lustre-y := dcache.o dir.o file.o llite_lib.o llite_nfs.o \ > - rw.o rw26.o namei.o symlink.o llite_mmap.o range_lock.o \ > + rw.o rw26.o namei.o symlink.o llite_mmap.o \ > xattr.o xattr_cache.o xattr_security.o \ > super25.o statahead.o glimpse.o lcommon_cl.o lcommon_misc.o \ > vvp_dev.o vvp_page.o vvp_lock.o vvp_io.o vvp_object.o \ > diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c > index 481c0d01d4c6..1a14a79f87f8 100644 > --- a/drivers/staging/lustre/lustre/llite/file.c > +++ b/drivers/staging/lustre/lustre/llite/file.c > @@ -42,6 +42,7 @@ > #include > #include > #include > +#include > #include "../include/lustre/ll_fiemap.h" > #include "../include/lustre/lustre_ioctl.h" > #include "../include/lustre_swab.h" > @@ -1055,7 +1056,7 @@ ll_file_io_generic(const struct lu_env *env, struct vvp_io_args *args, > struct ll_inode_info *lli = ll_i2info(file_inode(file)); > struct ll_file_data *fd = LUSTRE_FPRIVATE(file); > struct vvp_io *vio = vvp_env_io(env); > - struct range_lock range; > + struct range_rwlock range; > struct cl_io *io; > ssize_t result = 0; > int rc = 0; > @@ -1072,9 +1073,9 @@ ll_file_io_generic(const struct lu_env *env, struct vvp_io_args *args, > bool range_locked = false; > > if (file->f_flags & O_APPEND) > - range_lock_init(&range, 0, LUSTRE_EOF); > + range_rwlock_init(&range, 0, LUSTRE_EOF); > else > - range_lock_init(&range, *ppos, *ppos + count - 1); > + range_rwlock_init(&range, *ppos, *ppos + count - 1); > > vio->vui_fd = LUSTRE_FPRIVATE(file); > vio->vui_iter = args->u.normal.via_iter; > @@ -1087,10 +1088,9 @@ ll_file_io_generic(const struct lu_env *env, struct vvp_io_args *args, > if (((iot == CIT_WRITE) || > (iot == CIT_READ && (file->f_flags & O_DIRECT))) && > !(vio->vui_fd->fd_flags & LL_FILE_GROUP_LOCKED)) { > - CDEBUG(D_VFSTRACE, "Range lock [%llu, %llu]\n", > - range.rl_node.in_extent.start, > - range.rl_node.in_extent.end); > - rc = range_lock(&lli->lli_write_tree, &range); > + CDEBUG(D_VFSTRACE, "Range lock [%lu, %lu]\n", > + range.node.start, range.node.last); > + rc = range_write_lock_interruptible(&lli->lli_write_tree, &range); > if (rc < 0) > goto out; > > @@ -1100,10 +1100,9 @@ ll_file_io_generic(const struct lu_env *env, struct vvp_io_args *args, > rc = cl_io_loop(env, io); > ll_cl_remove(file, env); > if (range_locked) { > - CDEBUG(D_VFSTRACE, "Range unlock [%llu, %llu]\n", > - range.rl_node.in_extent.start, > - range.rl_node.in_extent.end); > - range_unlock(&lli->lli_write_tree, &range); > + CDEBUG(D_VFSTRACE, "Range unlock [%lu, %lu]\n", > + range.node.start, range.node.last); > + range_write_unlock(&lli->lli_write_tree, &range); > } > } else { > /* cl_io_rw_init() handled IO */ > diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h > index 55f68acd85d1..aa2ae72e3e70 100644 > --- a/drivers/staging/lustre/lustre/llite/llite_internal.h > +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h > @@ -49,8 +49,8 @@ > #include > #include > #include > +#include > #include "vvp_internal.h" > -#include "range_lock.h" > > #ifndef FMODE_EXEC > #define FMODE_EXEC 0 > @@ -193,7 +193,7 @@ struct ll_inode_info { > * } > */ > struct rw_semaphore lli_trunc_sem; > - struct range_lock_tree lli_write_tree; > + struct range_rwlock_tree lli_write_tree; > > struct rw_semaphore lli_glimpse_sem; > unsigned long lli_glimpse_time; > diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c > index b229cbc7bb33..8054e916b3f5 100644 > --- a/drivers/staging/lustre/lustre/llite/llite_lib.c > +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c > @@ -40,6 +40,7 @@ > #include > #include > #include > +#include > > #include "../include/lustre/lustre_ioctl.h" > #include "../include/lustre_ha.h" > @@ -853,7 +854,7 @@ void ll_lli_init(struct ll_inode_info *lli) > mutex_init(&lli->lli_size_mutex); > lli->lli_symlink_name = NULL; > init_rwsem(&lli->lli_trunc_sem); > - range_lock_tree_init(&lli->lli_write_tree); > + range_rwlock_tree_init(&lli->lli_write_tree); > init_rwsem(&lli->lli_glimpse_sem); > lli->lli_glimpse_time = 0; > INIT_LIST_HEAD(&lli->lli_agl_list); > diff --git a/drivers/staging/lustre/lustre/llite/range_lock.c b/drivers/staging/lustre/lustre/llite/range_lock.c > deleted file mode 100644 > index 14148a097476..000000000000 > --- a/drivers/staging/lustre/lustre/llite/range_lock.c > +++ /dev/null > @@ -1,239 +0,0 @@ > -/* > - * GPL HEADER START > - * > - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > - * > - * This program is free software; you can redistribute it and/or modify > - * it under the terms of the GNU General Public License version 2 only, > - * as published by the Free Software Foundation. > - * > - * This program is distributed in the hope that it will be useful, but > - * WITHOUT ANY WARRANTY; without even the implied warranty of > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > - * General Public License version 2 for more details (a copy is included > - * in the LICENSE file that accompanied this code). > - * > - * You should have received a copy of the GNU General Public License > - * version 2 along with this program; If not, see > - * http://www.gnu.org/licenses/gpl-2.0.html > - * > - * GPL HEADER END > - */ > -/* > - * Range lock is used to allow multiple threads writing a single shared > - * file given each thread is writing to a non-overlapping portion of the > - * file. > - * > - * Refer to the possible upstream kernel version of range lock by > - * Jan Kara : https://lkml.org/lkml/2013/1/31/480 > - * > - * This file could later replaced by the upstream kernel version. > - */ > -/* > - * Author: Prakash Surya > - * Author: Bobi Jam > - */ > -#include "range_lock.h" > -#include "../include/lustre/lustre_user.h" > - > -/** > - * Initialize a range lock tree > - * > - * \param tree [in] an empty range lock tree > - * > - * Pre: Caller should have allocated the range lock tree. > - * Post: The range lock tree is ready to function. > - */ > -void range_lock_tree_init(struct range_lock_tree *tree) > -{ > - tree->rlt_root = NULL; > - tree->rlt_sequence = 0; > - spin_lock_init(&tree->rlt_lock); > -} > - > -/** > - * Initialize a range lock node > - * > - * \param lock [in] an empty range lock node > - * \param start [in] start of the covering region > - * \param end [in] end of the covering region > - * > - * Pre: Caller should have allocated the range lock node. > - * Post: The range lock node is meant to cover [start, end] region > - */ > -int range_lock_init(struct range_lock *lock, __u64 start, __u64 end) > -{ > - int rc; > - > - memset(&lock->rl_node, 0, sizeof(lock->rl_node)); > - if (end != LUSTRE_EOF) > - end >>= PAGE_SHIFT; > - rc = interval_set(&lock->rl_node, start >> PAGE_SHIFT, end); > - if (rc) > - return rc; > - > - INIT_LIST_HEAD(&lock->rl_next_lock); > - lock->rl_task = NULL; > - lock->rl_lock_count = 0; > - lock->rl_blocking_ranges = 0; > - lock->rl_sequence = 0; > - return rc; > -} > - > -static inline struct range_lock *next_lock(struct range_lock *lock) > -{ > - return list_entry(lock->rl_next_lock.next, typeof(*lock), rl_next_lock); > -} > - > -/** > - * Helper function of range_unlock() > - * > - * \param node [in] a range lock found overlapped during interval node > - * search > - * \param arg [in] the range lock to be tested > - * > - * \retval INTERVAL_ITER_CONT indicate to continue the search for next > - * overlapping range node > - * \retval INTERVAL_ITER_STOP indicate to stop the search > - */ > -static enum interval_iter range_unlock_cb(struct interval_node *node, void *arg) > -{ > - struct range_lock *lock = arg; > - struct range_lock *overlap = node2rangelock(node); > - struct range_lock *iter; > - > - list_for_each_entry(iter, &overlap->rl_next_lock, rl_next_lock) { > - if (iter->rl_sequence > lock->rl_sequence) { > - --iter->rl_blocking_ranges; > - LASSERT(iter->rl_blocking_ranges > 0); > - } > - } > - if (overlap->rl_sequence > lock->rl_sequence) { > - --overlap->rl_blocking_ranges; > - if (overlap->rl_blocking_ranges == 0) > - wake_up_process(overlap->rl_task); > - } > - return INTERVAL_ITER_CONT; > -} > - > -/** > - * Unlock a range lock, wake up locks blocked by this lock. > - * > - * \param tree [in] range lock tree > - * \param lock [in] range lock to be deleted > - * > - * If this lock has been granted, relase it; if not, just delete it from > - * the tree or the same region lock list. Wake up those locks only blocked > - * by this lock through range_unlock_cb(). > - */ > -void range_unlock(struct range_lock_tree *tree, struct range_lock *lock) > -{ > - spin_lock(&tree->rlt_lock); > - if (!list_empty(&lock->rl_next_lock)) { > - struct range_lock *next; > - > - if (interval_is_intree(&lock->rl_node)) { /* first lock */ > - /* Insert the next same range lock into the tree */ > - next = next_lock(lock); > - next->rl_lock_count = lock->rl_lock_count - 1; > - interval_erase(&lock->rl_node, &tree->rlt_root); > - interval_insert(&next->rl_node, &tree->rlt_root); > - } else { > - /* find the first lock in tree */ > - list_for_each_entry(next, &lock->rl_next_lock, > - rl_next_lock) { > - if (!interval_is_intree(&next->rl_node)) > - continue; > - > - LASSERT(next->rl_lock_count > 0); > - next->rl_lock_count--; > - break; > - } > - } > - list_del_init(&lock->rl_next_lock); > - } else { > - LASSERT(interval_is_intree(&lock->rl_node)); > - interval_erase(&lock->rl_node, &tree->rlt_root); > - } > - > - interval_search(tree->rlt_root, &lock->rl_node.in_extent, > - range_unlock_cb, lock); > - spin_unlock(&tree->rlt_lock); > -} > - > -/** > - * Helper function of range_lock() > - * > - * \param node [in] a range lock found overlapped during interval node > - * search > - * \param arg [in] the range lock to be tested > - * > - * \retval INTERVAL_ITER_CONT indicate to continue the search for next > - * overlapping range node > - * \retval INTERVAL_ITER_STOP indicate to stop the search > - */ > -static enum interval_iter range_lock_cb(struct interval_node *node, void *arg) > -{ > - struct range_lock *lock = (struct range_lock *)arg; > - struct range_lock *overlap = node2rangelock(node); > - > - lock->rl_blocking_ranges += overlap->rl_lock_count + 1; > - return INTERVAL_ITER_CONT; > -} > - > -/** > - * Lock a region > - * > - * \param tree [in] range lock tree > - * \param lock [in] range lock node containing the region span > - * > - * \retval 0 get the range lock > - * \retval <0 error code while not getting the range lock > - * > - * If there exists overlapping range lock, the new lock will wait and > - * retry, if later it find that it is not the chosen one to wake up, > - * it wait again. > - */ > -int range_lock(struct range_lock_tree *tree, struct range_lock *lock) > -{ > - struct interval_node *node; > - int rc = 0; > - > - spin_lock(&tree->rlt_lock); > - /* > - * We need to check for all conflicting intervals > - * already in the tree. > - */ > - interval_search(tree->rlt_root, &lock->rl_node.in_extent, > - range_lock_cb, lock); > - /* > - * Insert to the tree if I am unique, otherwise I've been linked to > - * the rl_next_lock of another lock which has the same range as mine > - * in range_lock_cb(). > - */ > - node = interval_insert(&lock->rl_node, &tree->rlt_root); > - if (node) { > - struct range_lock *tmp = node2rangelock(node); > - > - list_add_tail(&lock->rl_next_lock, &tmp->rl_next_lock); > - tmp->rl_lock_count++; > - } > - lock->rl_sequence = ++tree->rlt_sequence; > - > - while (lock->rl_blocking_ranges > 0) { > - lock->rl_task = current; > - __set_current_state(TASK_INTERRUPTIBLE); > - spin_unlock(&tree->rlt_lock); > - schedule(); > - > - if (signal_pending(current)) { > - range_unlock(tree, lock); > - rc = -EINTR; > - goto out; > - } > - spin_lock(&tree->rlt_lock); > - } > - spin_unlock(&tree->rlt_lock); > -out: > - return rc; > -} > diff --git a/drivers/staging/lustre/lustre/llite/range_lock.h b/drivers/staging/lustre/lustre/llite/range_lock.h > deleted file mode 100644 > index 779091ccec4e..000000000000 > --- a/drivers/staging/lustre/lustre/llite/range_lock.h > +++ /dev/null > @@ -1,82 +0,0 @@ > -/* > - * GPL HEADER START > - * > - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > - * > - * This program is free software; you can redistribute it and/or modify > - * it under the terms of the GNU General Public License version 2 only, > - * as published by the Free Software Foundation. > - * > - * This program is distributed in the hope that it will be useful, but > - * WITHOUT ANY WARRANTY; without even the implied warranty of > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > - * General Public License version 2 for more details (a copy is included > - * in the LICENSE file that accompanied this code). > - * > - * You should have received a copy of the GNU General Public License > - * version 2 along with this program; If not, see > - * http://www.gnu.org/licenses/gpl-2.0.html > - * > - * GPL HEADER END > - */ > -/* > - * Range lock is used to allow multiple threads writing a single shared > - * file given each thread is writing to a non-overlapping portion of the > - * file. > - * > - * Refer to the possible upstream kernel version of range lock by > - * Jan Kara : https://lkml.org/lkml/2013/1/31/480 > - * > - * This file could later replaced by the upstream kernel version. > - */ > -/* > - * Author: Prakash Surya > - * Author: Bobi Jam > - */ > -#ifndef _RANGE_LOCK_H > -#define _RANGE_LOCK_H > - > -#include "../../include/linux/libcfs/libcfs.h" > -#include "../include/interval_tree.h" > - > -struct range_lock { > - struct interval_node rl_node; > - /** > - * Process to enqueue this lock. > - */ > - struct task_struct *rl_task; > - /** > - * List of locks with the same range. > - */ > - struct list_head rl_next_lock; > - /** > - * Number of locks in the list rl_next_lock > - */ > - unsigned int rl_lock_count; > - /** > - * Number of ranges which are blocking acquisition of the lock > - */ > - unsigned int rl_blocking_ranges; > - /** > - * Sequence number of range lock. This number is used to get to know > - * the order the locks are queued; this is required for range_cancel(). > - */ > - __u64 rl_sequence; > -}; > - > -static inline struct range_lock *node2rangelock(const struct interval_node *n) > -{ > - return container_of(n, struct range_lock, rl_node); > -} > - > -struct range_lock_tree { > - struct interval_node *rlt_root; > - spinlock_t rlt_lock; /* protect range lock tree */ > - __u64 rlt_sequence; > -}; > - > -void range_lock_tree_init(struct range_lock_tree *tree); > -int range_lock_init(struct range_lock *lock, __u64 start, __u64 end); > -int range_lock(struct range_lock_tree *tree, struct range_lock *lock); > -void range_unlock(struct range_lock_tree *tree, struct range_lock *lock); > -#endif > -- > 2.12.0 > Cheers, Andreas -- Andreas Dilger Lustre Principal Architect Intel Corporation From deepa.kernel at gmail.com Sat Apr 8 00:56:58 2017 From: deepa.kernel at gmail.com (Deepa Dinamani) Date: Fri, 7 Apr 2017 17:56:58 -0700 Subject: [lustre-devel] [PATCH 00/12] Delete CURRENT_TIME, CURRENT_TIME_SEC and current_fs_time Message-ID: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> The series contains the last unmerged uses of CURRENT_TIME, CURRENT_TIME_SEC, and current_fs_time(). The series also deletes these apis. All the patches except [PATCH 9/12] and [PATCH 10/12] are resend patches. These patches fix new instances of CURRENT_TIME. cifs and ceph patches have been squashed so that we have one patch per filesystem. We want to get these merged onto 4.12 release so that I can post the series that changes vfs timestamps to use 64 bits for 4.13 release. I'm proposing these to be merged through Andrew's tree. Filesystem maintainers, please let Andrew know if you will be picking up the patch in your trees. Let me know if anybody has other preferences for merging. Deepa Dinamani (12): fs: f2fs: Use ktime_get_real_seconds for sit_info times trace: Make trace_hwlat timestamp y2038 safe fs: cifs: Replace CURRENT_TIME by other appropriate apis fs: ceph: CURRENT_TIME with ktime_get_real_ts() fs: ufs: Use ktime_get_real_ts64() for birthtime audit: Use timespec64 to represent audit timestamps fs: btrfs: Use ktime_get_real_ts for root ctime fs: ubifs: Replace CURRENT_TIME_SEC with current_time lustre: Replace CURRENT_TIME macro apparmorfs: Replace CURRENT_TIME with current_time() time: Delete CURRENT_TIME_SEC and CURRENT_TIME time: Delete current_fs_time() function drivers/block/rbd.c | 2 +- drivers/staging/lustre/lustre/llite/llite_lib.c | 6 +++--- drivers/staging/lustre/lustre/osc/osc_io.c | 4 ++-- fs/btrfs/root-tree.c | 3 ++- fs/ceph/mds_client.c | 4 +++- fs/cifs/cifsencrypt.c | 4 +++- fs/cifs/cifssmb.c | 10 ++++----- fs/cifs/inode.c | 28 +++++++++++++------------ fs/f2fs/segment.c | 2 +- fs/f2fs/segment.h | 5 +++-- fs/ubifs/dir.c | 12 +++++------ fs/ubifs/file.c | 12 +++++------ fs/ubifs/ioctl.c | 2 +- fs/ubifs/misc.h | 10 --------- fs/ubifs/sb.c | 14 +++++++++---- fs/ubifs/xattr.c | 6 +++--- fs/ufs/ialloc.c | 6 ++++-- include/linux/audit.h | 4 ++-- include/linux/fs.h | 1 - include/linux/time.h | 3 --- kernel/audit.c | 10 ++++----- kernel/audit.h | 2 +- kernel/auditsc.c | 6 +++--- kernel/time/time.c | 14 ------------- kernel/trace/trace_entries.h | 6 +++--- kernel/trace/trace_hwlat.c | 14 ++++++------- kernel/trace/trace_output.c | 9 ++++---- net/ceph/messenger.c | 6 ++++-- net/ceph/osd_client.c | 4 ++-- security/apparmor/apparmorfs.c | 2 +- 30 files changed, 100 insertions(+), 111 deletions(-) -- 2.7.4 From deepa.kernel at gmail.com Sat Apr 8 00:56:59 2017 From: deepa.kernel at gmail.com (Deepa Dinamani) Date: Fri, 7 Apr 2017 17:56:59 -0700 Subject: [lustre-devel] [PATCH 01/12] fs: f2fs: Use ktime_get_real_seconds for sit_info times In-Reply-To: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> Message-ID: <1491613030-11599-2-git-send-email-deepa.kernel@gmail.com> CURRENT_TIME_SEC is not y2038 safe. Replace use of CURRENT_TIME_SEC with ktime_get_real_seconds in segment timestamps used by GC algorithm including the segment mtime timestamps. Signed-off-by: Deepa Dinamani Reviewed-by: Arnd Bergmann --- fs/f2fs/segment.c | 2 +- fs/f2fs/segment.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 010324c..0531500 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -2678,7 +2678,7 @@ static int build_sit_info(struct f2fs_sb_info *sbi) sit_i->dirty_sentries = 0; sit_i->sents_per_block = SIT_ENTRY_PER_BLOCK; sit_i->elapsed_time = le64_to_cpu(sbi->ckpt->elapsed_time); - sit_i->mounted_time = CURRENT_TIME_SEC.tv_sec; + sit_i->mounted_time = ktime_get_real_seconds(); mutex_init(&sit_i->sentry_lock); return 0; } diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index 57e36c1..156afc3 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -692,8 +692,9 @@ static inline void set_to_next_sit(struct sit_info *sit_i, unsigned int start) static inline unsigned long long get_mtime(struct f2fs_sb_info *sbi) { struct sit_info *sit_i = SIT_I(sbi); - return sit_i->elapsed_time + CURRENT_TIME_SEC.tv_sec - - sit_i->mounted_time; + time64_t now = ktime_get_real_seconds(); + + return sit_i->elapsed_time + now - sit_i->mounted_time; } static inline void set_summary(struct f2fs_summary *sum, nid_t nid, -- 2.7.4 From deepa.kernel at gmail.com Sat Apr 8 00:57:00 2017 From: deepa.kernel at gmail.com (Deepa Dinamani) Date: Fri, 7 Apr 2017 17:57:00 -0700 Subject: [lustre-devel] [PATCH 02/12] trace: Make trace_hwlat timestamp y2038 safe In-Reply-To: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> Message-ID: <1491613030-11599-3-git-send-email-deepa.kernel@gmail.com> struct timespec is not y2038 safe on 32 bit machines and needs to be replaced by struct timespec64 in order to represent times beyond year 2038 on such machines. Fix all the timestamp representation in struct trace_hwlat and all the corresponding implementations. Signed-off-by: Deepa Dinamani --- kernel/trace/trace_entries.h | 6 +++--- kernel/trace/trace_hwlat.c | 14 +++++++------- kernel/trace/trace_output.c | 9 ++++----- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/kernel/trace/trace_entries.h b/kernel/trace/trace_entries.h index c203ac4..adcdbbe 100644 --- a/kernel/trace/trace_entries.h +++ b/kernel/trace/trace_entries.h @@ -348,14 +348,14 @@ FTRACE_ENTRY(hwlat, hwlat_entry, __field( u64, duration ) __field( u64, outer_duration ) __field( u64, nmi_total_ts ) - __field_struct( struct timespec, timestamp ) - __field_desc( long, timestamp, tv_sec ) + __field_struct( struct timespec64, timestamp ) + __field_desc( s64, timestamp, tv_sec ) __field_desc( long, timestamp, tv_nsec ) __field( unsigned int, nmi_count ) __field( unsigned int, seqnum ) ), - F_printk("cnt:%u\tts:%010lu.%010lu\tinner:%llu\touter:%llunmi-ts:%llu\tnmi-count:%u\n", + F_printk("cnt:%u\tts:%010llu.%010lu\tinner:%llu\touter:%llunmi-ts:%llu\tnmi-count:%u\n", __entry->seqnum, __entry->tv_sec, __entry->tv_nsec, diff --git a/kernel/trace/trace_hwlat.c b/kernel/trace/trace_hwlat.c index 21ea6ae..d7c8e4e 100644 --- a/kernel/trace/trace_hwlat.c +++ b/kernel/trace/trace_hwlat.c @@ -79,12 +79,12 @@ static u64 last_tracing_thresh = DEFAULT_LAT_THRESHOLD * NSEC_PER_USEC; /* Individual latency samples are stored here when detected. */ struct hwlat_sample { - u64 seqnum; /* unique sequence */ - u64 duration; /* delta */ - u64 outer_duration; /* delta (outer loop) */ - u64 nmi_total_ts; /* Total time spent in NMIs */ - struct timespec timestamp; /* wall time */ - int nmi_count; /* # NMIs during this sample */ + u64 seqnum; /* unique sequence */ + u64 duration; /* delta */ + u64 outer_duration; /* delta (outer loop) */ + u64 nmi_total_ts; /* Total time spent in NMIs */ + struct timespec64 timestamp; /* wall time */ + int nmi_count; /* # NMIs during this sample */ }; /* keep the global state somewhere. */ @@ -250,7 +250,7 @@ static int get_sample(void) s.seqnum = hwlat_data.count; s.duration = sample; s.outer_duration = outer_sample; - s.timestamp = CURRENT_TIME; + ktime_get_real_ts64(&s.timestamp); s.nmi_total_ts = nmi_total_ts; s.nmi_count = nmi_count; trace_hwlat_sample(&s); diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index 02a4aeb..08f9bab 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c @@ -4,7 +4,6 @@ * Copyright (C) 2008 Red Hat Inc, Steven Rostedt * */ - #include #include #include @@ -1161,11 +1160,11 @@ trace_hwlat_print(struct trace_iterator *iter, int flags, trace_assign_type(field, entry); - trace_seq_printf(s, "#%-5u inner/outer(us): %4llu/%-5llu ts:%ld.%09ld", + trace_seq_printf(s, "#%-5u inner/outer(us): %4llu/%-5llu ts:%lld.%09ld", field->seqnum, field->duration, field->outer_duration, - field->timestamp.tv_sec, + (long long)field->timestamp.tv_sec, field->timestamp.tv_nsec); if (field->nmi_count) { @@ -1195,10 +1194,10 @@ trace_hwlat_raw(struct trace_iterator *iter, int flags, trace_assign_type(field, iter->ent); - trace_seq_printf(s, "%llu %lld %ld %09ld %u\n", + trace_seq_printf(s, "%llu %lld %lld %09ld %u\n", field->duration, field->outer_duration, - field->timestamp.tv_sec, + (long long)field->timestamp.tv_sec, field->timestamp.tv_nsec, field->seqnum); -- 2.7.4 From deepa.kernel at gmail.com Sat Apr 8 00:57:01 2017 From: deepa.kernel at gmail.com (Deepa Dinamani) Date: Fri, 7 Apr 2017 17:57:01 -0700 Subject: [lustre-devel] [PATCH 03/12] fs: cifs: Replace CURRENT_TIME by other appropriate apis In-Reply-To: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> Message-ID: <1491613030-11599-4-git-send-email-deepa.kernel@gmail.com> CURRENT_TIME macro is not y2038 safe on 32 bit systems. The patch replaces all the uses of CURRENT_TIME by current_time() for filesystem times, and ktime_get_* functions for authentication timestamps and timezone calculations. This is also in preparation for the patch that transitions vfs timestamps to use 64 bit time and hence make them y2038 safe. CURRENT_TIME macro will be deleted before merging the aforementioned change. The inode timestamps read from the server are assumed to have correct granularity and range. The patch also assumes that the difference between server and client times lie in the range INT_MIN..INT_MAX. This is valid because this is the difference between current times between server and client, and the largest timezone difference is in the range of one day. All cifs timestamps currently use timespec representation internally. Authentication and timezone timestamps can also be transitioned into using timespec64 when all other timestamps for cifs is transitioned to use timespec64. Signed-off-by: Deepa Dinamani Reviewed-by: Arnd Bergmann --- fs/cifs/cifsencrypt.c | 4 +++- fs/cifs/cifssmb.c | 10 +++++----- fs/cifs/inode.c | 28 +++++++++++++++------------- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index 058ac9b..68abbb0 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c @@ -478,6 +478,7 @@ find_timestamp(struct cifs_ses *ses) unsigned char *blobptr; unsigned char *blobend; struct ntlmssp2_name *attrptr; + struct timespec ts; if (!ses->auth_key.len || !ses->auth_key.response) return 0; @@ -502,7 +503,8 @@ find_timestamp(struct cifs_ses *ses) blobptr += attrsize; /* advance attr value */ } - return cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME)); + ktime_get_real_ts(&ts); + return cpu_to_le64(cifs_UnixTimeToNT(ts)); } static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash, diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 0669506..2f279b7 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -478,14 +478,14 @@ decode_lanman_negprot_rsp(struct TCP_Server_Info *server, NEGOTIATE_RSP *pSMBr) * this requirement. */ int val, seconds, remain, result; - struct timespec ts, utc; - utc = CURRENT_TIME; + struct timespec ts; + unsigned long utc = ktime_get_real_seconds(); ts = cnvrtDosUnixTm(rsp->SrvTime.Date, rsp->SrvTime.Time, 0); cifs_dbg(FYI, "SrvTime %d sec since 1970 (utc: %d) diff: %d\n", - (int)ts.tv_sec, (int)utc.tv_sec, - (int)(utc.tv_sec - ts.tv_sec)); - val = (int)(utc.tv_sec - ts.tv_sec); + (int)ts.tv_sec, (int)utc, + (int)(utc - ts.tv_sec)); + val = (int)(utc - ts.tv_sec); seconds = abs(val); result = (seconds / MIN_TZ_ADJ) * MIN_TZ_ADJ; remain = seconds % MIN_TZ_ADJ; diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index b261db3..c3b2fa0 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -322,9 +322,9 @@ cifs_create_dfs_fattr(struct cifs_fattr *fattr, struct super_block *sb) fattr->cf_mode = S_IFDIR | S_IXUGO | S_IRWXU; fattr->cf_uid = cifs_sb->mnt_uid; fattr->cf_gid = cifs_sb->mnt_gid; - fattr->cf_atime = CURRENT_TIME; - fattr->cf_ctime = CURRENT_TIME; - fattr->cf_mtime = CURRENT_TIME; + ktime_get_real_ts(&fattr->cf_mtime); + fattr->cf_mtime = timespec_trunc(fattr->cf_mtime, sb->s_time_gran); + fattr->cf_atime = fattr->cf_ctime = fattr->cf_mtime; fattr->cf_nlink = 2; fattr->cf_flags |= CIFS_FATTR_DFS_REFERRAL; } @@ -586,9 +586,10 @@ static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path, /* Fill a cifs_fattr struct with info from FILE_ALL_INFO */ static void cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info, - struct cifs_sb_info *cifs_sb, bool adjust_tz, + struct super_block *sb, bool adjust_tz, bool symlink) { + struct cifs_sb_info *cifs_sb = CIFS_SB(sb); struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb); memset(fattr, 0, sizeof(*fattr)); @@ -598,8 +599,10 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info, if (info->LastAccessTime) fattr->cf_atime = cifs_NTtimeToUnix(info->LastAccessTime); - else - fattr->cf_atime = CURRENT_TIME; + else { + ktime_get_real_ts(&fattr->cf_atime); + fattr->cf_atime = timespec_trunc(fattr->cf_atime, sb->s_time_gran); + } fattr->cf_ctime = cifs_NTtimeToUnix(info->ChangeTime); fattr->cf_mtime = cifs_NTtimeToUnix(info->LastWriteTime); @@ -659,7 +662,6 @@ cifs_get_file_info(struct file *filp) FILE_ALL_INFO find_data; struct cifs_fattr fattr; struct inode *inode = file_inode(filp); - struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); struct cifsFileInfo *cfile = filp->private_data; struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); struct TCP_Server_Info *server = tcon->ses->server; @@ -671,7 +673,7 @@ cifs_get_file_info(struct file *filp) rc = server->ops->query_file_info(xid, tcon, &cfile->fid, &find_data); switch (rc) { case 0: - cifs_all_info_to_fattr(&fattr, &find_data, cifs_sb, false, + cifs_all_info_to_fattr(&fattr, &find_data, inode->i_sb, false, false); break; case -EREMOTE: @@ -753,7 +755,7 @@ cifs_get_inode_info(struct inode **inode, const char *full_path, } if (!rc) { - cifs_all_info_to_fattr(&fattr, data, cifs_sb, adjust_tz, + cifs_all_info_to_fattr(&fattr, data, sb, adjust_tz, symlink); } else if (rc == -EREMOTE) { cifs_create_dfs_fattr(&fattr, sb); @@ -1363,9 +1365,9 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry) cifs_inode = CIFS_I(inode); cifs_inode->time = 0; /* will force revalidate to get info when needed */ - inode->i_ctime = current_fs_time(sb); + inode->i_ctime = current_time(inode); } - dir->i_ctime = dir->i_mtime = current_fs_time(sb); + dir->i_ctime = dir->i_mtime = current_time(dir); cifs_inode = CIFS_I(dir); CIFS_I(dir)->time = 0; /* force revalidate of dir as well */ unlink_out: @@ -1633,7 +1635,7 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry) cifsInode->time = 0; d_inode(direntry)->i_ctime = inode->i_ctime = inode->i_mtime = - current_fs_time(inode->i_sb); + current_time(inode); rmdir_exit: kfree(full_path); @@ -1806,7 +1808,7 @@ cifs_rename2(struct inode *source_dir, struct dentry *source_dentry, CIFS_I(source_dir)->time = CIFS_I(target_dir)->time = 0; source_dir->i_ctime = source_dir->i_mtime = target_dir->i_ctime = - target_dir->i_mtime = current_fs_time(source_dir->i_sb); + target_dir->i_mtime = current_time(source_dir); cifs_rename_exit: kfree(info_buf_source); -- 2.7.4 From deepa.kernel at gmail.com Sat Apr 8 00:57:03 2017 From: deepa.kernel at gmail.com (Deepa Dinamani) Date: Fri, 7 Apr 2017 17:57:03 -0700 Subject: [lustre-devel] [PATCH 05/12] fs: ufs: Use ktime_get_real_ts64() for birthtime In-Reply-To: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> Message-ID: <1491613030-11599-6-git-send-email-deepa.kernel@gmail.com> CURRENT_TIME is not y2038 safe. Replace it with ktime_get_real_ts64(). Inode time formats are already 64 bit long and accommodates time64_t. Signed-off-by: Deepa Dinamani --- fs/ufs/ialloc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/ufs/ialloc.c b/fs/ufs/ialloc.c index 9774555..d1dd8cc 100644 --- a/fs/ufs/ialloc.c +++ b/fs/ufs/ialloc.c @@ -176,6 +176,7 @@ struct inode *ufs_new_inode(struct inode *dir, umode_t mode) struct ufs_cg_private_info * ucpi; struct ufs_cylinder_group * ucg; struct inode * inode; + struct timespec64 ts; unsigned cg, bit, i, j, start; struct ufs_inode_info *ufsi; int err = -ENOSPC; @@ -323,8 +324,9 @@ struct inode *ufs_new_inode(struct inode *dir, umode_t mode) lock_buffer(bh); ufs2_inode = (struct ufs2_inode *)bh->b_data; ufs2_inode += ufs_inotofsbo(inode->i_ino); - ufs2_inode->ui_birthtime = cpu_to_fs64(sb, CURRENT_TIME.tv_sec); - ufs2_inode->ui_birthnsec = cpu_to_fs32(sb, CURRENT_TIME.tv_nsec); + ktime_get_real_ts64(&ts); + ufs2_inode->ui_birthtime = cpu_to_fs64(sb, ts.tv_sec); + ufs2_inode->ui_birthnsec = cpu_to_fs32(sb, ts.tv_nsec); mark_buffer_dirty(bh); unlock_buffer(bh); if (sb->s_flags & MS_SYNCHRONOUS) -- 2.7.4 From deepa.kernel at gmail.com Sat Apr 8 00:57:04 2017 From: deepa.kernel at gmail.com (Deepa Dinamani) Date: Fri, 7 Apr 2017 17:57:04 -0700 Subject: [lustre-devel] [PATCH 06/12] audit: Use timespec64 to represent audit timestamps In-Reply-To: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> Message-ID: <1491613030-11599-7-git-send-email-deepa.kernel@gmail.com> struct timespec is not y2038 safe. Audit timestamps are recorded in string format into an audit buffer for a given context. These mark the entry timestamps for the syscalls. Use y2038 safe struct timespec64 to represent the times. The log strings can handle this transition as strings can hold upto 1024 characters. Signed-off-by: Deepa Dinamani Reviewed-by: Arnd Bergmann Acked-by: Paul Moore Acked-by: Richard Guy Briggs --- include/linux/audit.h | 4 ++-- kernel/audit.c | 10 +++++----- kernel/audit.h | 2 +- kernel/auditsc.c | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/linux/audit.h b/include/linux/audit.h index 6fdfefc..f830508 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h @@ -332,7 +332,7 @@ static inline void audit_ptrace(struct task_struct *t) /* Private API (for audit.c only) */ extern unsigned int audit_serial(void); extern int auditsc_get_stamp(struct audit_context *ctx, - struct timespec *t, unsigned int *serial); + struct timespec64 *t, unsigned int *serial); extern int audit_set_loginuid(kuid_t loginuid); static inline kuid_t audit_get_loginuid(struct task_struct *tsk) @@ -511,7 +511,7 @@ static inline void __audit_seccomp(unsigned long syscall, long signr, int code) static inline void audit_seccomp(unsigned long syscall, long signr, int code) { } static inline int auditsc_get_stamp(struct audit_context *ctx, - struct timespec *t, unsigned int *serial) + struct timespec64 *t, unsigned int *serial) { return 0; } diff --git a/kernel/audit.c b/kernel/audit.c index 2f4964c..fcbf377 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -1625,10 +1625,10 @@ unsigned int audit_serial(void) } static inline void audit_get_stamp(struct audit_context *ctx, - struct timespec *t, unsigned int *serial) + struct timespec64 *t, unsigned int *serial) { if (!ctx || !auditsc_get_stamp(ctx, t, serial)) { - *t = CURRENT_TIME; + ktime_get_real_ts64(t); *serial = audit_serial(); } } @@ -1652,7 +1652,7 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type) { struct audit_buffer *ab; - struct timespec t; + struct timespec64 t; unsigned int uninitialized_var(serial); if (audit_initialized != AUDIT_INITIALIZED) @@ -1705,8 +1705,8 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, } audit_get_stamp(ab->ctx, &t, &serial); - audit_log_format(ab, "audit(%lu.%03lu:%u): ", - t.tv_sec, t.tv_nsec/1000000, serial); + audit_log_format(ab, "audit(%llu.%03lu:%u): ", + (unsigned long long)t.tv_sec, t.tv_nsec/1000000, serial); return ab; } diff --git a/kernel/audit.h b/kernel/audit.h index 0f1cf6d..cdf96f4 100644 --- a/kernel/audit.h +++ b/kernel/audit.h @@ -112,7 +112,7 @@ struct audit_context { enum audit_state state, current_state; unsigned int serial; /* serial number for record */ int major; /* syscall number */ - struct timespec ctime; /* time of syscall entry */ + struct timespec64 ctime; /* time of syscall entry */ unsigned long argv[4]; /* syscall arguments */ long return_code;/* syscall return code */ u64 prio; diff --git a/kernel/auditsc.c b/kernel/auditsc.c index e59ffc7..a2d9217 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -1532,7 +1532,7 @@ void __audit_syscall_entry(int major, unsigned long a1, unsigned long a2, return; context->serial = 0; - context->ctime = CURRENT_TIME; + ktime_get_real_ts64(&context->ctime); context->in_syscall = 1; context->current_state = state; context->ppid = 0; @@ -1941,13 +1941,13 @@ EXPORT_SYMBOL_GPL(__audit_inode_child); /** * auditsc_get_stamp - get local copies of audit_context values * @ctx: audit_context for the task - * @t: timespec to store time recorded in the audit_context + * @t: timespec64 to store time recorded in the audit_context * @serial: serial value that is recorded in the audit_context * * Also sets the context as auditable. */ int auditsc_get_stamp(struct audit_context *ctx, - struct timespec *t, unsigned int *serial) + struct timespec64 *t, unsigned int *serial) { if (!ctx->in_syscall) return 0; -- 2.7.4 From deepa.kernel at gmail.com Sat Apr 8 00:57:02 2017 From: deepa.kernel at gmail.com (Deepa Dinamani) Date: Fri, 7 Apr 2017 17:57:02 -0700 Subject: [lustre-devel] [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() In-Reply-To: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> Message-ID: <1491613030-11599-5-git-send-email-deepa.kernel@gmail.com> CURRENT_TIME is not y2038 safe. The macro will be deleted and all the references to it will be replaced by ktime_get_* apis. struct timespec is also not y2038 safe. Retain timespec for timestamp representation here as ceph uses it internally everywhere. These references will be changed to use struct timespec64 in a separate patch. The current_fs_time() api is being changed to use vfs struct inode* as an argument instead of struct super_block*. Set the new mds client request r_stamp field using ktime_get_real_ts() instead of using current_fs_time(). Also, since r_stamp is used as mtime on the server, use timespec_trunc() to truncate the timestamp, using the right granularity from the superblock. This api will be transitioned to be y2038 safe along with vfs. Signed-off-by: Deepa Dinamani Reviewed-by: Arnd Bergmann --- drivers/block/rbd.c | 2 +- fs/ceph/mds_client.c | 4 +++- net/ceph/messenger.c | 6 ++++-- net/ceph/osd_client.c | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 517838b..77204da 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -1922,7 +1922,7 @@ static void rbd_osd_req_format_write(struct rbd_obj_request *obj_request) { struct ceph_osd_request *osd_req = obj_request->osd_req; - osd_req->r_mtime = CURRENT_TIME; + ktime_get_real_ts(&osd_req->r_mtime); osd_req->r_data_offset = obj_request->offset; } diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index c681762..1d3fa90 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -1666,6 +1666,7 @@ struct ceph_mds_request * ceph_mdsc_create_request(struct ceph_mds_client *mdsc, int op, int mode) { struct ceph_mds_request *req = kzalloc(sizeof(*req), GFP_NOFS); + struct timespec ts; if (!req) return ERR_PTR(-ENOMEM); @@ -1684,7 +1685,8 @@ ceph_mdsc_create_request(struct ceph_mds_client *mdsc, int op, int mode) init_completion(&req->r_safe_completion); INIT_LIST_HEAD(&req->r_unsafe_item); - req->r_stamp = current_fs_time(mdsc->fsc->sb); + ktime_get_real_ts(&ts); + req->r_stamp = timespec_trunc(ts, mdsc->fsc->sb->s_time_gran); req->r_op = op; req->r_direct_mode = mode; diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index f76bb33..5766a6c 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -1386,8 +1386,9 @@ static void prepare_write_keepalive(struct ceph_connection *con) dout("prepare_write_keepalive %p\n", con); con_out_kvec_reset(con); if (con->peer_features & CEPH_FEATURE_MSGR_KEEPALIVE2) { - struct timespec now = CURRENT_TIME; + struct timespec now; + ktime_get_real_ts(&now); con_out_kvec_add(con, sizeof(tag_keepalive2), &tag_keepalive2); ceph_encode_timespec(&con->out_temp_keepalive2, &now); con_out_kvec_add(con, sizeof(con->out_temp_keepalive2), @@ -3176,8 +3177,9 @@ bool ceph_con_keepalive_expired(struct ceph_connection *con, { if (interval > 0 && (con->peer_features & CEPH_FEATURE_MSGR_KEEPALIVE2)) { - struct timespec now = CURRENT_TIME; + struct timespec now; struct timespec ts; + ktime_get_real_ts(&now); jiffies_to_timespec(interval, &ts); ts = timespec_add(con->last_keepalive_ack, ts); return timespec_compare(&now, &ts) >= 0; diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index e15ea9e..242d7c0 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -3574,7 +3574,7 @@ ceph_osdc_watch(struct ceph_osd_client *osdc, ceph_oid_copy(&lreq->t.base_oid, oid); ceph_oloc_copy(&lreq->t.base_oloc, oloc); lreq->t.flags = CEPH_OSD_FLAG_WRITE; - lreq->mtime = CURRENT_TIME; + ktime_get_real_ts(&lreq->mtime); lreq->reg_req = alloc_linger_request(lreq); if (!lreq->reg_req) { @@ -3632,7 +3632,7 @@ int ceph_osdc_unwatch(struct ceph_osd_client *osdc, ceph_oid_copy(&req->r_base_oid, &lreq->t.base_oid); ceph_oloc_copy(&req->r_base_oloc, &lreq->t.base_oloc); req->r_flags = CEPH_OSD_FLAG_WRITE; - req->r_mtime = CURRENT_TIME; + ktime_get_real_ts(&req->r_mtime); osd_req_op_watch_init(req, 0, lreq->linger_id, CEPH_OSD_WATCH_OP_UNWATCH); -- 2.7.4 From deepa.kernel at gmail.com Sat Apr 8 00:57:05 2017 From: deepa.kernel at gmail.com (Deepa Dinamani) Date: Fri, 7 Apr 2017 17:57:05 -0700 Subject: [lustre-devel] [PATCH 07/12] fs: btrfs: Use ktime_get_real_ts for root ctime In-Reply-To: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> Message-ID: <1491613030-11599-8-git-send-email-deepa.kernel@gmail.com> btrfs_root_item maintains the ctime for root updates. This is not part of vfs_inode. Since current_time() uses struct inode* as an argument as Linus suggested, this cannot be used to update root times unless, we modify the signature to use inode. Since btrfs uses nanosecond time granularity, it can also use ktime_get_real_ts directly to obtain timestamp for the root. It is necessary to use the timespec time api here because the same btrfs_set_stack_timespec_*() apis are used for vfs inode times as well. These can be transitioned to using timespec64 when btrfs internally changes to use timespec64 as well. Signed-off-by: Deepa Dinamani Acked-by: David Sterba Reviewed-by: Arnd Bergmann --- fs/btrfs/root-tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c index a08224e..7d6bc30 100644 --- a/fs/btrfs/root-tree.c +++ b/fs/btrfs/root-tree.c @@ -501,8 +501,9 @@ void btrfs_update_root_times(struct btrfs_trans_handle *trans, struct btrfs_root *root) { struct btrfs_root_item *item = &root->root_item; - struct timespec ct = current_fs_time(root->fs_info->sb); + struct timespec ct; + ktime_get_real_ts(&ct); spin_lock(&root->root_item_lock); btrfs_set_root_ctransid(item, trans->transid); btrfs_set_stack_timespec_sec(&item->ctime, ct.tv_sec); -- 2.7.4 From deepa.kernel at gmail.com Sat Apr 8 00:57:06 2017 From: deepa.kernel at gmail.com (Deepa Dinamani) Date: Fri, 7 Apr 2017 17:57:06 -0700 Subject: [lustre-devel] [PATCH 08/12] fs: ubifs: Replace CURRENT_TIME_SEC with current_time In-Reply-To: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> Message-ID: <1491613030-11599-9-git-send-email-deepa.kernel@gmail.com> CURRENT_TIME_SEC is not y2038 safe. current_time() will be transitioned to use 64 bit time along with vfs in a separate patch. There is no plan to transition CURRENT_TIME_SEC to use y2038 safe time interfaces. current_time() returns timestamps according to the granularities set in the inode's super_block. The granularity check to call current_fs_time() or CURRENT_TIME_SEC is not required. Use current_time() directly to update inode timestamp. Use timespec_trunc during file system creation, before the first inode is created. Signed-off-by: Deepa Dinamani Reviewed-by: Arnd Bergmann --- fs/ubifs/dir.c | 12 ++++++------ fs/ubifs/file.c | 12 ++++++------ fs/ubifs/ioctl.c | 2 +- fs/ubifs/misc.h | 10 ---------- fs/ubifs/sb.c | 14 ++++++++++---- fs/ubifs/xattr.c | 6 +++--- 6 files changed, 26 insertions(+), 30 deletions(-) diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 30825d88..8510d79 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -121,7 +121,7 @@ struct inode *ubifs_new_inode(struct ubifs_info *c, struct inode *dir, inode_init_owner(inode, dir, mode); inode->i_mtime = inode->i_atime = inode->i_ctime = - ubifs_current_time(inode); + current_time(inode); inode->i_mapping->nrpages = 0; switch (mode & S_IFMT) { @@ -750,7 +750,7 @@ static int ubifs_link(struct dentry *old_dentry, struct inode *dir, lock_2_inodes(dir, inode); inc_nlink(inode); ihold(inode); - inode->i_ctime = ubifs_current_time(inode); + inode->i_ctime = current_time(inode); dir->i_size += sz_change; dir_ui->ui_size = dir->i_size; dir->i_mtime = dir->i_ctime = inode->i_ctime; @@ -823,7 +823,7 @@ static int ubifs_unlink(struct inode *dir, struct dentry *dentry) } lock_2_inodes(dir, inode); - inode->i_ctime = ubifs_current_time(dir); + inode->i_ctime = current_time(dir); drop_nlink(inode); dir->i_size -= sz_change; dir_ui->ui_size = dir->i_size; @@ -927,7 +927,7 @@ static int ubifs_rmdir(struct inode *dir, struct dentry *dentry) } lock_2_inodes(dir, inode); - inode->i_ctime = ubifs_current_time(dir); + inode->i_ctime = current_time(dir); clear_nlink(inode); drop_nlink(dir); dir->i_size -= sz_change; @@ -1405,7 +1405,7 @@ static int do_rename(struct inode *old_dir, struct dentry *old_dentry, * Like most other Unix systems, set the @i_ctime for inodes on a * rename. */ - time = ubifs_current_time(old_dir); + time = current_time(old_dir); old_inode->i_ctime = time; /* We must adjust parent link count when renaming directories */ @@ -1578,7 +1578,7 @@ static int ubifs_xrename(struct inode *old_dir, struct dentry *old_dentry, lock_4_inodes(old_dir, new_dir, NULL, NULL); - time = ubifs_current_time(old_dir); + time = current_time(old_dir); fst_inode->i_ctime = time; snd_inode->i_ctime = time; old_dir->i_mtime = old_dir->i_ctime = time; diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index d9ae86f..2cda3d6 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c @@ -1196,7 +1196,7 @@ static int do_truncation(struct ubifs_info *c, struct inode *inode, mutex_lock(&ui->ui_mutex); ui->ui_size = inode->i_size; /* Truncation changes inode [mc]time */ - inode->i_mtime = inode->i_ctime = ubifs_current_time(inode); + inode->i_mtime = inode->i_ctime = current_time(inode); /* Other attributes may be changed at the same time as well */ do_attr_changes(inode, attr); err = ubifs_jnl_truncate(c, inode, old_size, new_size); @@ -1243,7 +1243,7 @@ static int do_setattr(struct ubifs_info *c, struct inode *inode, mutex_lock(&ui->ui_mutex); if (attr->ia_valid & ATTR_SIZE) { /* Truncation changes inode [mc]time */ - inode->i_mtime = inode->i_ctime = ubifs_current_time(inode); + inode->i_mtime = inode->i_ctime = current_time(inode); /* 'truncate_setsize()' changed @i_size, update @ui_size */ ui->ui_size = inode->i_size; } @@ -1420,7 +1420,7 @@ int ubifs_update_time(struct inode *inode, struct timespec *time, */ static int update_mctime(struct inode *inode) { - struct timespec now = ubifs_current_time(inode); + struct timespec now = current_time(inode); struct ubifs_inode *ui = ubifs_inode(inode); struct ubifs_info *c = inode->i_sb->s_fs_info; @@ -1434,7 +1434,7 @@ static int update_mctime(struct inode *inode) return err; mutex_lock(&ui->ui_mutex); - inode->i_mtime = inode->i_ctime = ubifs_current_time(inode); + inode->i_mtime = inode->i_ctime = current_time(inode); release = ui->dirty; mark_inode_dirty_sync(inode); mutex_unlock(&ui->ui_mutex); @@ -1511,7 +1511,7 @@ static int ubifs_vm_page_mkwrite(struct vm_fault *vmf) struct page *page = vmf->page; struct inode *inode = file_inode(vmf->vma->vm_file); struct ubifs_info *c = inode->i_sb->s_fs_info; - struct timespec now = ubifs_current_time(inode); + struct timespec now = current_time(inode); struct ubifs_budget_req req = { .new_page = 1 }; int err, update_time; @@ -1579,7 +1579,7 @@ static int ubifs_vm_page_mkwrite(struct vm_fault *vmf) struct ubifs_inode *ui = ubifs_inode(inode); mutex_lock(&ui->ui_mutex); - inode->i_mtime = inode->i_ctime = ubifs_current_time(inode); + inode->i_mtime = inode->i_ctime = current_time(inode); release = ui->dirty; mark_inode_dirty_sync(inode); mutex_unlock(&ui->ui_mutex); diff --git a/fs/ubifs/ioctl.c b/fs/ubifs/ioctl.c index da519ba..12b9eb50 100644 --- a/fs/ubifs/ioctl.c +++ b/fs/ubifs/ioctl.c @@ -126,7 +126,7 @@ static int setflags(struct inode *inode, int flags) ui->flags = ioctl2ubifs(flags); ubifs_set_inode_flags(inode); - inode->i_ctime = ubifs_current_time(inode); + inode->i_ctime = current_time(inode); release = ui->dirty; mark_inode_dirty_sync(inode); mutex_unlock(&ui->ui_mutex); diff --git a/fs/ubifs/misc.h b/fs/ubifs/misc.h index 8ece6ca..caf83d6 100644 --- a/fs/ubifs/misc.h +++ b/fs/ubifs/misc.h @@ -225,16 +225,6 @@ static inline void *ubifs_idx_key(const struct ubifs_info *c, } /** - * ubifs_current_time - round current time to time granularity. - * @inode: inode - */ -static inline struct timespec ubifs_current_time(struct inode *inode) -{ - return (inode->i_sb->s_time_gran < NSEC_PER_SEC) ? - current_fs_time(inode->i_sb) : CURRENT_TIME_SEC; -} - -/** * ubifs_tnc_lookup - look up a file-system node. * @c: UBIFS file-system description object * @key: node key to lookup diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c index 7f1ead2..8c25081 100644 --- a/fs/ubifs/sb.c +++ b/fs/ubifs/sb.c @@ -84,6 +84,8 @@ static int create_default_filesystem(struct ubifs_info *c) int min_leb_cnt = UBIFS_MIN_LEB_CNT; long long tmp64, main_bytes; __le64 tmp_le64; + __le32 tmp_le32; + struct timespec ts; /* Some functions called from here depend on the @c->key_len filed */ c->key_len = UBIFS_SK_LEN; @@ -298,13 +300,17 @@ static int create_default_filesystem(struct ubifs_info *c) ino->ch.node_type = UBIFS_INO_NODE; ino->creat_sqnum = cpu_to_le64(++c->max_sqnum); ino->nlink = cpu_to_le32(2); - tmp_le64 = cpu_to_le64(CURRENT_TIME_SEC.tv_sec); + + ktime_get_real_ts(&ts); + ts = timespec_trunc(ts, DEFAULT_TIME_GRAN); + tmp_le64 = cpu_to_le64(ts.tv_sec); ino->atime_sec = tmp_le64; ino->ctime_sec = tmp_le64; ino->mtime_sec = tmp_le64; - ino->atime_nsec = 0; - ino->ctime_nsec = 0; - ino->mtime_nsec = 0; + tmp_le32 = cpu_to_le32(ts.tv_nsec); + ino->atime_nsec = tmp_le32; + ino->ctime_nsec = tmp_le32; + ino->mtime_nsec = tmp_le32; ino->mode = cpu_to_le32(S_IFDIR | S_IRUGO | S_IWUSR | S_IXUGO); ino->size = cpu_to_le64(UBIFS_INO_NODE_SZ); diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c index efe00fc..3e53fdb 100644 --- a/fs/ubifs/xattr.c +++ b/fs/ubifs/xattr.c @@ -152,7 +152,7 @@ static int create_xattr(struct ubifs_info *c, struct inode *host, ui->data_len = size; mutex_lock(&host_ui->ui_mutex); - host->i_ctime = ubifs_current_time(host); + host->i_ctime = current_time(host); host_ui->xattr_cnt += 1; host_ui->xattr_size += CALC_DENT_SIZE(fname_len(nm)); host_ui->xattr_size += CALC_XATTR_BYTES(size); @@ -234,7 +234,7 @@ static int change_xattr(struct ubifs_info *c, struct inode *host, mutex_unlock(&ui->ui_mutex); mutex_lock(&host_ui->ui_mutex); - host->i_ctime = ubifs_current_time(host); + host->i_ctime = current_time(host); host_ui->xattr_size -= CALC_XATTR_BYTES(old_size); host_ui->xattr_size += CALC_XATTR_BYTES(size); @@ -488,7 +488,7 @@ static int remove_xattr(struct ubifs_info *c, struct inode *host, return err; mutex_lock(&host_ui->ui_mutex); - host->i_ctime = ubifs_current_time(host); + host->i_ctime = current_time(host); host_ui->xattr_cnt -= 1; host_ui->xattr_size -= CALC_DENT_SIZE(fname_len(nm)); host_ui->xattr_size -= CALC_XATTR_BYTES(ui->data_len); -- 2.7.4 From deepa.kernel at gmail.com Sat Apr 8 00:57:07 2017 From: deepa.kernel at gmail.com (Deepa Dinamani) Date: Fri, 7 Apr 2017 17:57:07 -0700 Subject: [lustre-devel] [PATCH 09/12] lustre: Replace CURRENT_TIME macro In-Reply-To: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> Message-ID: <1491613030-11599-10-git-send-email-deepa.kernel@gmail.com> CURRENT_TIME macro is not y2038 safe on 32 bit systems. The patch replaces all the uses of CURRENT_TIME by current_time() for filesystem times, and ktime_get_* functions for others. struct timespec is also not y2038 safe. Retain timespec for timestamp representation here as lustre uses it internally everywhere. These references will be changed to use struct timespec64 in a separate patch. This is also in preparation for the patch that transitions vfs timestamps to use 64 bit time and hence make them y2038 safe. current_time() is also planned to be transitioned to y2038 safe behavior along with this change. CURRENT_TIME macro will be deleted before merging the aforementioned change. Signed-off-by: Deepa Dinamani --- drivers/staging/lustre/lustre/llite/llite_lib.c | 6 +++--- drivers/staging/lustre/lustre/osc/osc_io.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index 7b80040..2b4b6b9 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -1472,17 +1472,17 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import) /* We mark all of the fields "set" so MDS/OST does not re-set them */ if (attr->ia_valid & ATTR_CTIME) { - attr->ia_ctime = CURRENT_TIME; + attr->ia_ctime = current_time(inode); attr->ia_valid |= ATTR_CTIME_SET; } if (!(attr->ia_valid & ATTR_ATIME_SET) && (attr->ia_valid & ATTR_ATIME)) { - attr->ia_atime = CURRENT_TIME; + attr->ia_atime = current_time(inode); attr->ia_valid |= ATTR_ATIME_SET; } if (!(attr->ia_valid & ATTR_MTIME_SET) && (attr->ia_valid & ATTR_MTIME)) { - attr->ia_mtime = CURRENT_TIME; + attr->ia_mtime = current_time(inode); attr->ia_valid |= ATTR_MTIME_SET; } diff --git a/drivers/staging/lustre/lustre/osc/osc_io.c b/drivers/staging/lustre/lustre/osc/osc_io.c index f991bee..cbab800 100644 --- a/drivers/staging/lustre/lustre/osc/osc_io.c +++ b/drivers/staging/lustre/lustre/osc/osc_io.c @@ -216,7 +216,7 @@ static int osc_io_submit(const struct lu_env *env, struct cl_object *obj = ios->cis_obj; cl_object_attr_lock(obj); - attr->cat_mtime = LTIME_S(CURRENT_TIME); + attr->cat_mtime = ktime_get_real_seconds(); attr->cat_ctime = attr->cat_mtime; cl_object_attr_update(env, obj, attr, CAT_MTIME | CAT_CTIME); cl_object_attr_unlock(obj); @@ -256,7 +256,7 @@ static void osc_page_touch_at(const struct lu_env *env, kms > loi->loi_kms ? "" : "not ", loi->loi_kms, kms, loi->loi_lvb.lvb_size); - attr->cat_ctime = LTIME_S(CURRENT_TIME); + attr->cat_ctime = ktime_get_real_seconds(); attr->cat_mtime = attr->cat_ctime; valid = CAT_MTIME | CAT_CTIME; if (kms > loi->loi_kms) { -- 2.7.4 From deepa.kernel at gmail.com Sat Apr 8 00:57:08 2017 From: deepa.kernel at gmail.com (Deepa Dinamani) Date: Fri, 7 Apr 2017 17:57:08 -0700 Subject: [lustre-devel] [PATCH 10/12] apparmorfs: Replace CURRENT_TIME with current_time() In-Reply-To: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> Message-ID: <1491613030-11599-11-git-send-email-deepa.kernel@gmail.com> CURRENT_TIME macro is not y2038 safe on 32 bit systems. The patch replaces all the uses of CURRENT_TIME by current_time(). This is also in preparation for the patch that transitions vfs timestamps to use 64 bit time and hence make them y2038 safe. current_time() is also planned to be transitioned to y2038 safe behavior along with this change. CURRENT_TIME macro will be deleted before merging the aforementioned change. Signed-off-by: Deepa Dinamani --- security/apparmor/apparmorfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index be0b498..4f6ac9d 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -1357,7 +1357,7 @@ static int aa_mk_null_file(struct dentry *parent) inode->i_ino = get_next_ino(); inode->i_mode = S_IFCHR | S_IRUGO | S_IWUGO; - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); init_special_inode(inode, S_IFCHR | S_IRUGO | S_IWUGO, MKDEV(MEM_MAJOR, 3)); d_instantiate(dentry, inode); -- 2.7.4 From deepa.kernel at gmail.com Sat Apr 8 00:57:09 2017 From: deepa.kernel at gmail.com (Deepa Dinamani) Date: Fri, 7 Apr 2017 17:57:09 -0700 Subject: [lustre-devel] [PATCH 11/12] time: Delete CURRENT_TIME_SEC and CURRENT_TIME In-Reply-To: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> Message-ID: <1491613030-11599-12-git-send-email-deepa.kernel@gmail.com> All uses of CURRENT_TIME_SEC and CURRENT_TIME macros have been replaced by other time functions. These macros are also not y2038 safe. And, all their use cases can be fulfilled by y2038 safe ktime_get_* variants. Signed-off-by: Deepa Dinamani Acked-by: John Stultz Reviewed-by: Arnd Bergmann --- include/linux/time.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/linux/time.h b/include/linux/time.h index 23f0f5c..c0543f5 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -151,9 +151,6 @@ static inline bool timespec_inject_offset_valid(const struct timespec *ts) return true; } -#define CURRENT_TIME (current_kernel_time()) -#define CURRENT_TIME_SEC ((struct timespec) { get_seconds(), 0 }) - /* Some architectures do not supply their own clocksource. * This is mainly the case in architectures that get their * inter-tick times by reading the counter on their interval -- 2.7.4 From deepa.kernel at gmail.com Sat Apr 8 00:57:10 2017 From: deepa.kernel at gmail.com (Deepa Dinamani) Date: Fri, 7 Apr 2017 17:57:10 -0700 Subject: [lustre-devel] [PATCH 12/12] time: Delete current_fs_time() function In-Reply-To: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> Message-ID: <1491613030-11599-13-git-send-email-deepa.kernel@gmail.com> All uses of the current_fs_time() function have been replaced by other time interfaces. And, its use cases can be fulfilled by current_time() or ktime_get_* variants. Signed-off-by: Deepa Dinamani Reviewed-by: Arnd Bergmann --- include/linux/fs.h | 1 - kernel/time/time.c | 14 -------------- 2 files changed, 15 deletions(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index f1d7347..cce6c57 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1430,7 +1430,6 @@ static inline void i_gid_write(struct inode *inode, gid_t gid) inode->i_gid = make_kgid(inode->i_sb->s_user_ns, gid); } -extern struct timespec current_fs_time(struct super_block *sb); extern struct timespec current_time(struct inode *inode); /* diff --git a/kernel/time/time.c b/kernel/time/time.c index 25bdd25..cf69cca 100644 --- a/kernel/time/time.c +++ b/kernel/time/time.c @@ -230,20 +230,6 @@ SYSCALL_DEFINE1(adjtimex, struct timex __user *, txc_p) return copy_to_user(txc_p, &txc, sizeof(struct timex)) ? -EFAULT : ret; } -/** - * current_fs_time - Return FS time - * @sb: Superblock. - * - * Return the current time truncated to the time granularity supported by - * the fs. - */ -struct timespec current_fs_time(struct super_block *sb) -{ - struct timespec now = current_kernel_time(); - return timespec_trunc(now, sb->s_time_gran); -} -EXPORT_SYMBOL(current_fs_time); - /* * Convert jiffies to milliseconds and back. * -- 2.7.4 From deepa.kernel at gmail.com Sat Apr 8 02:16:54 2017 From: deepa.kernel at gmail.com (Deepa Dinamani) Date: Fri, 7 Apr 2017 19:16:54 -0700 Subject: [lustre-devel] [PATCH 02/12] trace: Make trace_hwlat timestamp y2038 safe In-Reply-To: <20170407213011.36e29f42@gandalf.local.home> References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> <1491613030-11599-3-git-send-email-deepa.kernel@gmail.com> <20170407213011.36e29f42@gandalf.local.home> Message-ID: >> - trace_seq_printf(s, "#%-5u inner/outer(us): %4llu/%-5llu ts:%ld.%09ld", >> + trace_seq_printf(s, "#%-5u inner/outer(us): %4llu/%-5llu ts:%lld.%09ld", >> field->seqnum, >> field->duration, >> field->outer_duration, >> - field->timestamp.tv_sec, >> + (long long)field->timestamp.tv_sec, > > Refresh my memory. We need the cast because on 64 bit boxes > timestamp.tv_sec is just a long? This is only required until we change the definition of timespec64. Right now it is defined as #if __BITS_PER_LONG == 64 # define timespec64 timespec #else struct timespec64 { time64_t tv_sec; long tv_nsec; }; #endif And timespec.tv_sec is just long int on 64 bit machines. This is why we need the cast now. We will probably change this and only define __kernel_timespec instead of timespec, leaving only one definition of timespec64. At that time, we will not need this. -Deepa From gregkh at linuxfoundation.org Sat Apr 8 10:45:22 2017 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Sat, 8 Apr 2017 12:45:22 +0200 Subject: [lustre-devel] [PATCH] drivers/staging: lustre: Avoiding multiple line dereference In-Reply-To: <1491298170-29104-1-git-send-email-pushkar.iit@gmail.com> References: <1491298170-29104-1-git-send-email-pushkar.iit@gmail.com> Message-ID: <20170408104522.GA5245@kroah.com> On Tue, Apr 04, 2017 at 02:59:30PM +0530, Pushkar Jambhlekar wrote: > Making references in single line Why? Now the line is too long :( Will this be a constant stream of patches, one making this change, and the other the original? sorry, greg k-h From gregkh at linuxfoundation.org Sat Apr 8 11:02:37 2017 From: gregkh at linuxfoundation.org (Greg KH) Date: Sat, 8 Apr 2017 13:02:37 +0200 Subject: [lustre-devel] [PATCH v2] Remove sparse warnings in mdc_request.c In-Reply-To: <1491283537-13023-1-git-send-email-skanda.kashyap@gmail.com> References: <1592C3AC-DE8B-4A11-8053-02B82A61E1B3@intel.com> <1491283537-13023-1-git-send-email-skanda.kashyap@gmail.com> Message-ID: <20170408110237.GA6877@kroah.com> On Mon, Apr 03, 2017 at 10:25:37PM -0700, skanda.kashyap at gmail.com wrote: > From: Skanda Guruanand > > Signed-off-by: Skanda Guruanand Changelog text goes between those two lines, right? > > I have modified struct lu_dirpage as suggested in lustre_idl.h file Why the extra ' '? > > CHECK drivers/staging/lustre/lustre/mdc/mdc_request.c > drivers/staging/lustre/lustre/mdc/mdc_request.c:958:42: warning: cast > to restricted __le64 Why is this all wrapped? > drivers/staging/lustre/lustre/mdc/mdc_request.c:959:42: warning: cast > to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:962:42: warning: cast > to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:963:42: warning: cast > to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:985:50: warning: cast > to restricted __le32 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1193:24: warning: cast > to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1328:25: warning: cast > to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1329:23: warning: cast > to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1332:25: warning: cast > to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1333:23: warning: cast > to restricted __le64 > > --- > drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h > index 60b827e..df48b8d 100644 > --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h > +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h > @@ -846,10 +846,10 @@ struct luda_type { > #endif > > struct lu_dirpage { > - __u64 ldp_hash_start; > - __u64 ldp_hash_end; > - __u32 ldp_flags; > - __u32 ldp_pad0; > + __le64 ldp_hash_start; > + __le64 ldp_hash_end; > + __le32 ldp_flags; > + __le32 ldp_pad0; Are you sure this is correct? How was it tested? Also, please fix your subject to properly match those already made for this driver... thanks, greg k-h From deepa.kernel at gmail.com Sat Apr 8 17:58:05 2017 From: deepa.kernel at gmail.com (Deepa Dinamani) Date: Sat, 8 Apr 2017 10:58:05 -0700 Subject: [lustre-devel] [PATCH 06/12] audit: Use timespec64 to represent audit timestamps In-Reply-To: References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> <1491613030-11599-7-git-send-email-deepa.kernel@gmail.com> Message-ID: > I have no problem merging this patch into audit/next for v4.12, would > you prefer me to do that so at least this patch is merged? This would be fine. But, I think whoever takes the last 2 deletion patches should also take them. I'm not sure how that part works out. > It would probably make life a small bit easier for us in the audit > world too as it would reduce the potential merge conflict. However, > that's a relatively small thing to worry about. -Deepa From gregkh at linuxfoundation.org Tue Apr 11 05:15:01 2017 From: gregkh at linuxfoundation.org (Greg KH) Date: Tue, 11 Apr 2017 07:15:01 +0200 Subject: [lustre-devel] [PATCH v2] Fix endianness issues in mdc_request.c In-Reply-To: <1491887125-20397-1-git-send-email-skanda.kashyap@gmail.com> References: <20170408110237.GA6877@kroah.com> <1491887125-20397-1-git-send-email-skanda.kashyap@gmail.com> Message-ID: <20170411051501.GA21419@kroah.com> On Mon, Apr 10, 2017 at 10:05:25PM -0700, skanda.kashyap at gmail.com wrote: > From: Skanda Guruanand > > Signed-off-by: Skanda Guruanand I can't take patches with no changelog text at all, sorry. Please fix up and resend. greg k-h From gregkh at linuxfoundation.org Wed Apr 12 06:15:49 2017 From: gregkh at linuxfoundation.org (Greg KH) Date: Wed, 12 Apr 2017 08:15:49 +0200 Subject: [lustre-devel] [PATCH v2] Fix endianness issues in mdc_request.c In-Reply-To: <1491970957-26525-1-git-send-email-skanda.kashyap@gmail.com> References: <20170411051501.GA21419@kroah.com> <1491970957-26525-1-git-send-email-skanda.kashyap@gmail.com> Message-ID: <20170412061549.GB32351@kroah.com> On Tue, Apr 11, 2017 at 09:22:37PM -0700, skanda.kashyap at gmail.com wrote: > From: Skanda Guruanand Your subject is odd, please match other commits made for this driver when you resend it. > Sparse generates warnings where cast to restricted types are made. > This commit changes types of struct fields to match endianness. Why do you have info below --- that should be up here? > > Signed-off-by: Skanda Guruanand > --- > I have modified struct lu_dirpage in lustre_idl.h file to remove the sparse warnings > where cast to restricted types are made. > > Following warnings were removed by this fix. > > drivers/staging/lustre/lustre/mdc/mdc_request.c:958:42: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:959:42: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:962:42: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:963:42: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:985:50: warning: cast to restricted __le32 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1193:24: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1328:25: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1329:23: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1332:25: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1333:23: warning: cast to restricted __le64 > > I have not got a chance to test it as I don't have a big endian system. I feel the change > is reasonably correct as the elements of the structure lu_dirpage are always converted from > little-endian format to processor's native format. > > drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h > index 60b827e..df48b8d 100644 > --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h > +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h > @@ -846,10 +846,10 @@ struct luda_type { > #endif > > struct lu_dirpage { > - __u64 ldp_hash_start; > - __u64 ldp_hash_end; > - __u32 ldp_flags; > - __u32 ldp_pad0; > + __le64 ldp_hash_start; > + __le64 ldp_hash_end; > + __le32 ldp_flags; > + __le32 ldp_pad0; I need a bit more confidence that this is the correct change before I can take it. What can you do to provide that? thanks, greg k-h From hch at infradead.org Wed Apr 12 08:09:28 2017 From: hch at infradead.org (Christoph Hellwig) Date: Wed, 12 Apr 2017 01:09:28 -0700 Subject: [lustre-devel] [PATCH 04/25] fs: Provide infrastructure for dynamic BDIs in filesystems In-Reply-To: <20170329105623.18241-5-jack@suse.cz> References: <20170329105623.18241-1-jack@suse.cz> <20170329105623.18241-5-jack@suse.cz> Message-ID: <20170412080928.GD9830@infradead.org> > + if (sb->s_iflags & SB_I_DYNBDI) { > + bdi_put(sb->s_bdi); > + sb->s_bdi = &noop_backing_dev_info; At some point I'd really like to get rid of noop_backing_dev_info and have a NULL here.. Otherwise this looks fine.. Reviewed-by: Christoph Hellwig From hch at infradead.org Wed Apr 12 08:10:05 2017 From: hch at infradead.org (Christoph Hellwig) Date: Wed, 12 Apr 2017 01:10:05 -0700 Subject: [lustre-devel] [PATCH 06/25] lustre: Convert to separately allocated bdi In-Reply-To: <20170329105623.18241-7-jack@suse.cz> References: <20170329105623.18241-1-jack@suse.cz> <20170329105623.18241-7-jack@suse.cz> Message-ID: <20170412081005.GF9830@infradead.org> Looks fine, Reviewed-by: Christoph Hellwig From dan.carpenter at oracle.com Wed Apr 12 08:31:53 2017 From: dan.carpenter at oracle.com (Dan Carpenter) Date: Wed, 12 Apr 2017 11:31:53 +0300 Subject: [lustre-devel] [PATCH] staging: lustre: checking for NULL instead if IS_ERR Message-ID: <20170412083153.GA3250@mwanda> lustre_cfg_new() returns error pointers and never NULL. Signed-off-by: Dan Carpenter diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index 8fce88f69039..6a7e7a7d2af1 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -1427,8 +1427,8 @@ int class_manual_cleanup(struct obd_device *obd) lustre_cfg_bufs_reset(&bufs, obd->obd_name); lustre_cfg_bufs_set_string(&bufs, 1, flags); lcfg = lustre_cfg_new(LCFG_CLEANUP, &bufs); - if (!lcfg) - return -ENOMEM; + if (IS_ERR(lcfg)) + return PTR_ERR(lcfg); rc = class_process_config(lcfg); if (rc) { From jack at suse.cz Wed Apr 12 10:24:30 2017 From: jack at suse.cz (Jan Kara) Date: Wed, 12 Apr 2017 12:24:30 +0200 Subject: [lustre-devel] [PATCH 06/25] lustre: Convert to separately allocated bdi In-Reply-To: <20170412102449.16901-1-jack@suse.cz> References: <20170412102449.16901-1-jack@suse.cz> Message-ID: <20170412102449.16901-7-jack@suse.cz> Allocate struct backing_dev_info separately instead of embedding it inside superblock. This unifies handling of bdi among users. CC: Oleg Drokin CC: Andreas Dilger CC: James Simmons CC: lustre-devel at lists.lustre.org Reviewed-by: Andreas Dilger Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara --- .../staging/lustre/lustre/include/lustre_disk.h | 4 ---- drivers/staging/lustre/lustre/llite/llite_lib.c | 24 +++------------------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_disk.h b/drivers/staging/lustre/lustre/include/lustre_disk.h index 8886458748c1..a676bccabd43 100644 --- a/drivers/staging/lustre/lustre/include/lustre_disk.h +++ b/drivers/staging/lustre/lustre/include/lustre_disk.h @@ -133,13 +133,9 @@ struct lustre_sb_info { struct obd_export *lsi_osd_exp; char lsi_osd_type[16]; char lsi_fstype[16]; - struct backing_dev_info lsi_bdi; /* each client mountpoint needs - * own backing_dev_info - */ }; #define LSI_UMOUNT_FAILOVER 0x00200000 -#define LSI_BDI_INITIALIZED 0x00400000 #define s2lsi(sb) ((struct lustre_sb_info *)((sb)->s_fs_info)) #define s2lsi_nocast(sb) ((sb)->s_fs_info) diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index b229cbc7bb33..d483c44aafe5 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -863,15 +863,6 @@ void ll_lli_init(struct ll_inode_info *lli) mutex_init(&lli->lli_layout_mutex); } -static inline int ll_bdi_register(struct backing_dev_info *bdi) -{ - static atomic_t ll_bdi_num = ATOMIC_INIT(0); - - bdi->name = "lustre"; - return bdi_register(bdi, NULL, "lustre-%d", - atomic_inc_return(&ll_bdi_num)); -} - int ll_fill_super(struct super_block *sb, struct vfsmount *mnt) { struct lustre_profile *lprof = NULL; @@ -881,6 +872,7 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt) char *profilenm = get_profile_name(sb); struct config_llog_instance *cfg; int err; + static atomic_t ll_bdi_num = ATOMIC_INIT(0); CDEBUG(D_VFSTRACE, "VFS Op: sb %p\n", sb); @@ -903,16 +895,11 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt) if (err) goto out_free; - err = bdi_init(&lsi->lsi_bdi); - if (err) - goto out_free; - lsi->lsi_flags |= LSI_BDI_INITIALIZED; - lsi->lsi_bdi.capabilities = 0; - err = ll_bdi_register(&lsi->lsi_bdi); + err = super_setup_bdi_name(sb, "lustre-%d", + atomic_inc_return(&ll_bdi_num)); if (err) goto out_free; - sb->s_bdi = &lsi->lsi_bdi; /* kernel >= 2.6.38 store dentry operations in sb->s_d_op. */ sb->s_d_op = &ll_d_ops; @@ -1033,11 +1020,6 @@ void ll_put_super(struct super_block *sb) if (profilenm) class_del_profile(profilenm); - if (lsi->lsi_flags & LSI_BDI_INITIALIZED) { - bdi_destroy(&lsi->lsi_bdi); - lsi->lsi_flags &= ~LSI_BDI_INITIALIZED; - } - ll_free_sbi(sb); lsi->lsi_llsbi = NULL; -- 2.12.0 From jack at suse.cz Wed Apr 12 10:24:24 2017 From: jack at suse.cz (Jan Kara) Date: Wed, 12 Apr 2017 12:24:24 +0200 Subject: [lustre-devel] [PATCH 0/25 v3] fs: Convert all embedded bdis into separate ones Message-ID: <20170412102449.16901-1-jack@suse.cz> Hello, this is the third revision of the patch series which converts all embedded occurences of struct backing_dev_info to use standalone dynamically allocated structures. This makes bdi handling unified across all bdi users and generally removes some boilerplate code from filesystems setting up their own bdi. It also allows us to remove some code from generic bdi implementation. The patches were only compile-tested for most filesystems (I've tested mounting only for NFS & btrfs) so fs maintainers please have a look whether the changes look sound to you. This series is based on top of bdi fixes that were merged into linux-block git tree into for-next branch. I have pushed out the result as a branch to git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git bdi Since all patches got reviewed by Christoph, can you please pick them up Jens? Thanks! Changes since v2: * Added Reviewed-by tags from Christoph Changes since v1: * Added some acks * Added further FUSE cleanup patch * Added removal of unused argument to bdi_register() * Fixed up some compilation failures spotted by 0-day testing Honza From jack at suse.cz Wed Apr 12 10:24:28 2017 From: jack at suse.cz (Jan Kara) Date: Wed, 12 Apr 2017 12:24:28 +0200 Subject: [lustre-devel] [PATCH 04/25] fs: Provide infrastructure for dynamic BDIs in filesystems In-Reply-To: <20170412102449.16901-1-jack@suse.cz> References: <20170412102449.16901-1-jack@suse.cz> Message-ID: <20170412102449.16901-5-jack@suse.cz> Provide helper functions for setting up dynamically allocated backing_dev_info structures for filesystems and cleaning them up on superblock destruction. CC: linux-mtd at lists.infradead.org CC: linux-nfs at vger.kernel.org CC: Petr Vandrovec CC: linux-nilfs at vger.kernel.org CC: cluster-devel at redhat.com CC: osd-dev at open-osd.org CC: codalist at coda.cs.cmu.edu CC: linux-afs at lists.infradead.org CC: ecryptfs at vger.kernel.org CC: linux-cifs at vger.kernel.org CC: ceph-devel at vger.kernel.org CC: linux-btrfs at vger.kernel.org CC: v9fs-developer at lists.sourceforge.net CC: lustre-devel at lists.lustre.org Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara --- fs/super.c | 49 ++++++++++++++++++++++++++++++++++++++++ include/linux/backing-dev-defs.h | 2 +- include/linux/fs.h | 6 +++++ 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/fs/super.c b/fs/super.c index b8b6a086c03b..0f51a437c269 100644 --- a/fs/super.c +++ b/fs/super.c @@ -446,6 +446,11 @@ void generic_shutdown_super(struct super_block *sb) hlist_del_init(&sb->s_instances); spin_unlock(&sb_lock); up_write(&sb->s_umount); + if (sb->s_iflags & SB_I_DYNBDI) { + bdi_put(sb->s_bdi); + sb->s_bdi = &noop_backing_dev_info; + sb->s_iflags &= ~SB_I_DYNBDI; + } } EXPORT_SYMBOL(generic_shutdown_super); @@ -1256,6 +1261,50 @@ mount_fs(struct file_system_type *type, int flags, const char *name, void *data) } /* + * Setup private BDI for given superblock. It gets automatically cleaned up + * in generic_shutdown_super(). + */ +int super_setup_bdi_name(struct super_block *sb, char *fmt, ...) +{ + struct backing_dev_info *bdi; + int err; + va_list args; + + bdi = bdi_alloc(GFP_KERNEL); + if (!bdi) + return -ENOMEM; + + bdi->name = sb->s_type->name; + + va_start(args, fmt); + err = bdi_register_va(bdi, NULL, fmt, args); + va_end(args); + if (err) { + bdi_put(bdi); + return err; + } + WARN_ON(sb->s_bdi != &noop_backing_dev_info); + sb->s_bdi = bdi; + sb->s_iflags |= SB_I_DYNBDI; + + return 0; +} +EXPORT_SYMBOL(super_setup_bdi_name); + +/* + * Setup private BDI for given superblock. I gets automatically cleaned up + * in generic_shutdown_super(). + */ +int super_setup_bdi(struct super_block *sb) +{ + static atomic_long_t bdi_seq = ATOMIC_LONG_INIT(0); + + return super_setup_bdi_name(sb, "%.28s-%ld", sb->s_type->name, + atomic_long_inc_return(&bdi_seq)); +} +EXPORT_SYMBOL(super_setup_bdi); + +/* * This is an internal function, please use sb_end_{write,pagefault,intwrite} * instead. */ diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h index e66d4722db8e..866c433e7d32 100644 --- a/include/linux/backing-dev-defs.h +++ b/include/linux/backing-dev-defs.h @@ -146,7 +146,7 @@ struct backing_dev_info { congested_fn *congested_fn; /* Function pointer if device is md/dm */ void *congested_data; /* Pointer to aux data for congested func */ - char *name; + const char *name; struct kref refcnt; /* Reference counter for the structure */ unsigned int capabilities; /* Device capabilities */ diff --git a/include/linux/fs.h b/include/linux/fs.h index 7251f7bb45e8..98cf14ea78c0 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1272,6 +1272,9 @@ struct mm_struct; /* sb->s_iflags to limit user namespace mounts */ #define SB_I_USERNS_VISIBLE 0x00000010 /* fstype already mounted */ +/* Temporary flag until all filesystems are converted to dynamic bdis */ +#define SB_I_DYNBDI 0x00000100 + /* Possible states of 'frozen' field */ enum { SB_UNFROZEN = 0, /* FS is unfrozen */ @@ -2121,6 +2124,9 @@ extern int vfs_ustat(dev_t, struct kstatfs *); extern int freeze_super(struct super_block *super); extern int thaw_super(struct super_block *super); extern bool our_mnt(struct vfsmount *mnt); +extern __printf(2, 3) +int super_setup_bdi_name(struct super_block *sb, char *fmt, ...); +extern int super_setup_bdi(struct super_block *sb); extern int current_umask(void); -- 2.12.0 From dsterba at suse.cz Wed Apr 12 13:42:45 2017 From: dsterba at suse.cz (David Sterba) Date: Wed, 12 Apr 2017 15:42:45 +0200 Subject: [lustre-devel] [PATCH 07/12] fs: btrfs: Use ktime_get_real_ts for root ctime In-Reply-To: <1491613030-11599-8-git-send-email-deepa.kernel@gmail.com> References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> <1491613030-11599-8-git-send-email-deepa.kernel@gmail.com> Message-ID: <20170412134245.GK4781@twin.jikos.cz> On Fri, Apr 07, 2017 at 05:57:05PM -0700, Deepa Dinamani wrote: > btrfs_root_item maintains the ctime for root updates. > This is not part of vfs_inode. > > Since current_time() uses struct inode* as an argument > as Linus suggested, this cannot be used to update root > times unless, we modify the signature to use inode. > > Since btrfs uses nanosecond time granularity, it can also > use ktime_get_real_ts directly to obtain timestamp for > the root. It is necessary to use the timespec time api > here because the same btrfs_set_stack_timespec_*() apis > are used for vfs inode times as well. These can be > transitioned to using timespec64 when btrfs internally > changes to use timespec64 as well. > > Signed-off-by: Deepa Dinamani > Acked-by: David Sterba > Reviewed-by: Arnd Bergmann I'm going to add the patch to my 4.12 queue and will let Andrew know. From Craig at craiginches.com Thu Apr 13 09:24:41 2017 From: Craig at craiginches.com (Craig Inches) Date: Thu, 13 Apr 2017 10:24:41 +0100 Subject: [lustre-devel] [PATCH RESEND v2] Staging: lustre cleanup macros in libcfs_private.h Message-ID: <20170413092441.GA22444@starbase.xayto.local> This resolves a checkpatch warning that "Single statement macros should not use a do {} while (0) loop" by removing the loop and adjusting line length accordingly. Signed-off-by: Craig Inches --- Changes in v2: - Kept statements together - Kept operator on previous line .../lustre/include/linux/libcfs/libcfs_private.h | 51 +++++++--------------- 1 file changed, 15 insertions(+), 36 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h index 2dae857..e774c75 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h @@ -87,12 +87,9 @@ do { \ #define LIBCFS_VMALLOC_SIZE (2 << PAGE_SHIFT) /* 2 pages */ #endif -#define LIBCFS_ALLOC_PRE(size, mask) \ -do { \ - LASSERT(!in_interrupt() || \ - ((size) <= LIBCFS_VMALLOC_SIZE && \ - !gfpflags_allow_blocking(mask))); \ -} while (0) +#define LIBCFS_ALLOC_PRE(size, mask) \ + LASSERT(!in_interrupt() || ((size) <= LIBCFS_VMALLOC_SIZE && \ + !gfpflags_allow_blocking(mask))) #define LIBCFS_ALLOC_POST(ptr, size) \ do { \ @@ -187,46 +184,28 @@ void cfs_array_free(void *vars); #if LASSERT_ATOMIC_ENABLED /** assert value of @a is equal to @v */ -#define LASSERT_ATOMIC_EQ(a, v) \ -do { \ - LASSERTF(atomic_read(a) == v, \ - "value: %d\n", atomic_read((a))); \ -} while (0) +#define LASSERT_ATOMIC_EQ(a, v) \ + LASSERTF(atomic_read(a) == v, "value: %d\n", atomic_read((a))) /** assert value of @a is unequal to @v */ -#define LASSERT_ATOMIC_NE(a, v) \ -do { \ - LASSERTF(atomic_read(a) != v, \ - "value: %d\n", atomic_read((a))); \ -} while (0) +#define LASSERT_ATOMIC_NE(a, v) \ + LASSERTF(atomic_read(a) != v, "value: %d\n", atomic_read((a))) /** assert value of @a is little than @v */ -#define LASSERT_ATOMIC_LT(a, v) \ -do { \ - LASSERTF(atomic_read(a) < v, \ - "value: %d\n", atomic_read((a))); \ -} while (0) +#define LASSERT_ATOMIC_LT(a, v) \ + LASSERTF(atomic_read(a) < v, "value: %d\n", atomic_read((a))) /** assert value of @a is little/equal to @v */ -#define LASSERT_ATOMIC_LE(a, v) \ -do { \ - LASSERTF(atomic_read(a) <= v, \ - "value: %d\n", atomic_read((a))); \ -} while (0) +#define LASSERT_ATOMIC_LE(a, v) \ + LASSERTF(atomic_read(a) <= v, "value: %d\n", atomic_read((a))) /** assert value of @a is great than @v */ -#define LASSERT_ATOMIC_GT(a, v) \ -do { \ - LASSERTF(atomic_read(a) > v, \ - "value: %d\n", atomic_read((a))); \ -} while (0) +#define LASSERT_ATOMIC_GT(a, v) \ + LASSERTF(atomic_read(a) > v, "value: %d\n", atomic_read((a))) /** assert value of @a is great/equal to @v */ -#define LASSERT_ATOMIC_GE(a, v) \ -do { \ - LASSERTF(atomic_read(a) >= v, \ - "value: %d\n", atomic_read((a))); \ -} while (0) +#define LASSERT_ATOMIC_GE(a, v) \ + LASSERTF(atomic_read(a) >= v, "value: %d\n", atomic_read((a))) /** assert value of @a is great than @v1 and little than @v2 */ #define LASSERT_ATOMIC_GT_LT(a, v1, v2) \ -- 2.10.2 From yanli at ascar.io Fri Apr 14 02:55:15 2017 From: yanli at ascar.io (Yan Li) Date: Thu, 13 Apr 2017 19:55:15 -0700 Subject: [lustre-devel] [PATCH 1/6] Autoconf option for rate-limiting Quality of Service (RLQOS) In-Reply-To: <3BE4A898-D944-41F9-84C8-FE8DA80D0D65@datadirectnet.com> References: <99fe8fdaaaa5b6fd36c0782269bc45a580079696.1490122510.git.yanli@ascar.io> <3FFFCE73-97FE-4A10-8AC6-47D835CC6B3C@intel.com> <3BE4A898-D944-41F9-84C8-FE8DA80D0D65@datadirectnet.com> Message-ID: <949ca9f8-c4a5-1413-abbb-4777189ba425@ascar.io> On 03/24/2017 08:36 PM, Li Xi wrote: > > As you already know, we (DDN and also Prof. André and Lingfang from Mainz University) > are working together on QoS, not only server side TBF policy of NRS, but also client > side QoS (https://jira.hpdd.intel.com/browse/LU-7982). And also, global QoS of Lustre > is under development. After a glance on the paper, I think your work looks different from > our approach. That is good, because these mechanisms could work together to improve > the service quality of Lustre in different ways for different requirements. > > I have a few questions about LRQOS. I haven’t read all the details in the paper, so please > correct me if I am wrong. > > 1) In my understanding, ASCAR/RLQOS is aimed at preventing congestion in the Lustre > client. Am I correct? Is ASCAR/RLQOS able to provide any bandwidth/IOPS guarantees > to each applications, or to each user, or job? There is an common use case of client side > QoS. For example, multiple users are sharing the same Lustre client. But one of the users > starts a very aggressive application which uses all the available bandwidth/IOPS and thus > cause very bad performance/latency to other users. So, what we (DDN) are currently working > on is to trying to isolate/balance performance between users/jobs. I am wondering whether > ASCAR/RLQOS is able to be combined with our patches (https://review.whamcloud.com/#/c/19896/, > https://review.whamcloud.com/#/c/19700/) to provide an even better solution. ASCAR/RLQOS can't do bandwidth allocation for jobs accessing the same OSC yet. It is theoretically possible to do that for jobs accessing different OSCs, by using different rulesets for different OSC, but we don't know what is the best way to design these rulesets for bandwidth allocation yet. I agree it would be beneficial if our development effort can be combined. The core idea of ASCAR/RLQOS is to use a predefined ruleset to manage existing parameters, and this idea can be applied to any parameters in addition to those used in QoS. > 2) It is mentioned in the paper that ASCAR/RLQOS is controlling max flight RPC of OSC to > prevent congestion. However, for cached I/O, we found that page cache limitation on client is > also affecting the throughputs of applications. Especially, when multiple different applications > are sharing limited page caches. One of big concern is, when max flight RPC is limited, > the page cache will be exhausted (for example, when multiple applications keep on writing > data), and this is a new type of congestion. I am not sure, do you think this kind of congestion > will cause any performance decline/problem to the application? Yes. If that's the concern we should also tune the page cache limitation in addition to mrif. But the effectiveness of this needs to be carefully evaluated. > 3) Have you considered implementing ASCAR/RLQOS on Lustre server side? As already > mentioned in the paper, sometimes, clients of Lustre could connect to the servers and send > requests without any self-restraint which is unfair to other clients which follows the control > of ASCAR/RLQOS. And unfortunately, it is hard to get all the clients under control since > Lustre clients could change a lot from time to time. However, if a similar mechanism is > implemented on server side, things becomes much easier. And that is part of the reason > why TBF was implemented on server side rather than client side. Maybe something > similar to ASCAR/RLQOS could be implemented on MDTs/OSTs too. What do you think? This is definitely an interesting idea. As I said earlier, the core idea of ASCAR/RLQOS is actually tuning parameters dynamically, and we can apply this rule-based control to any parameters on both the server and client side. > 4) In your paper, I/O patterns detection or work load classifier are mentioned. So do you know > is there any any good way to detect/describe the I/O pattern of a application? Understanding > the I/O patterns of applications are really important and helpful for QoS. But I guess it is > really difficult, comparing to the pattern detection on other systems, like network. However, > do you have any idea or direction that looks like the right way? Maybe something like > machine learning? Yes. We are experimenting deep reinforcement learning-based methods and have seen some good results. The best part of using deep learning is that we don't have to worry about feature selection. As to whether deep learning works in real world, it has to be evaluated thoroughly. Yan From gregkh at linuxfoundation.org Fri Apr 14 08:15:05 2017 From: gregkh at linuxfoundation.org (Greg KH) Date: Fri, 14 Apr 2017 10:15:05 +0200 Subject: [lustre-devel] [PATCH RESEND v2] Staging: lustre cleanup macros in libcfs_private.h In-Reply-To: <20170413092441.GA22444@starbase.xayto.local> References: <20170413092441.GA22444@starbase.xayto.local> Message-ID: <20170414081505.GA16598@kroah.com> On Thu, Apr 13, 2017 at 10:24:41AM +0100, Craig Inches wrote: > This resolves a checkpatch warning that "Single statement macros should > not use a do {} while (0) loop" by removing the loop and adjusting line > length accordingly. > > Signed-off-by: Craig Inches > --- > Changes in v2: > - Kept statements together > - Kept operator on previous line Why RESEND? > > .../lustre/include/linux/libcfs/libcfs_private.h | 51 +++++++--------------- > 1 file changed, 15 insertions(+), 36 deletions(-) > > diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h > index 2dae857..e774c75 100644 > --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h > +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h > @@ -87,12 +87,9 @@ do { \ > #define LIBCFS_VMALLOC_SIZE (2 << PAGE_SHIFT) /* 2 pages */ > #endif > > -#define LIBCFS_ALLOC_PRE(size, mask) \ > -do { \ > - LASSERT(!in_interrupt() || \ > - ((size) <= LIBCFS_VMALLOC_SIZE && \ > - !gfpflags_allow_blocking(mask))); \ > -} while (0) > +#define LIBCFS_ALLOC_PRE(size, mask) \ > + LASSERT(!in_interrupt() || ((size) <= LIBCFS_VMALLOC_SIZE && \ > + !gfpflags_allow_blocking(mask))) > > #define LIBCFS_ALLOC_POST(ptr, size) \ > do { \ > @@ -187,46 +184,28 @@ void cfs_array_free(void *vars); > #if LASSERT_ATOMIC_ENABLED > > /** assert value of @a is equal to @v */ > -#define LASSERT_ATOMIC_EQ(a, v) \ > -do { \ > - LASSERTF(atomic_read(a) == v, \ > - "value: %d\n", atomic_read((a))); \ > -} while (0) > +#define LASSERT_ATOMIC_EQ(a, v) \ > + LASSERTF(atomic_read(a) == v, "value: %d\n", atomic_read((a))) > > /** assert value of @a is unequal to @v */ > -#define LASSERT_ATOMIC_NE(a, v) \ > -do { \ > - LASSERTF(atomic_read(a) != v, \ > - "value: %d\n", atomic_read((a))); \ > -} while (0) > +#define LASSERT_ATOMIC_NE(a, v) \ > + LASSERTF(atomic_read(a) != v, "value: %d\n", atomic_read((a))) > > /** assert value of @a is little than @v */ > -#define LASSERT_ATOMIC_LT(a, v) \ > -do { \ > - LASSERTF(atomic_read(a) < v, \ > - "value: %d\n", atomic_read((a))); \ > -} while (0) > +#define LASSERT_ATOMIC_LT(a, v) \ > + LASSERTF(atomic_read(a) < v, "value: %d\n", atomic_read((a))) > > /** assert value of @a is little/equal to @v */ > -#define LASSERT_ATOMIC_LE(a, v) \ > -do { \ > - LASSERTF(atomic_read(a) <= v, \ > - "value: %d\n", atomic_read((a))); \ > -} while (0) > +#define LASSERT_ATOMIC_LE(a, v) \ > + LASSERTF(atomic_read(a) <= v, "value: %d\n", atomic_read((a))) > > /** assert value of @a is great than @v */ > -#define LASSERT_ATOMIC_GT(a, v) \ > -do { \ > - LASSERTF(atomic_read(a) > v, \ > - "value: %d\n", atomic_read((a))); \ > -} while (0) > +#define LASSERT_ATOMIC_GT(a, v) \ > + LASSERTF(atomic_read(a) > v, "value: %d\n", atomic_read((a))) > > /** assert value of @a is great/equal to @v */ > -#define LASSERT_ATOMIC_GE(a, v) \ > -do { \ > - LASSERTF(atomic_read(a) >= v, \ > - "value: %d\n", atomic_read((a))); \ > -} while (0) > +#define LASSERT_ATOMIC_GE(a, v) \ > + LASSERTF(atomic_read(a) >= v, "value: %d\n", atomic_read((a))) > > /** assert value of @a is great than @v1 and little than @v2 */ > #define LASSERT_ATOMIC_GT_LT(a, v1, v2) \ I need a lustre maintainer to ack this one before I can take it. Perhaps there was a good reasaon do { } while is used here... thanks, greg k-h From gregkh at linuxfoundation.org Fri Apr 14 08:15:34 2017 From: gregkh at linuxfoundation.org (Greg KH) Date: Fri, 14 Apr 2017 10:15:34 +0200 Subject: [lustre-devel] [PATCH v2] staging: lustre: Fix sparse endianness warnings cast to restricted __le64 and __le32 In-Reply-To: <1492067363-31101-1-git-send-email-skanda.kashyap@gmail.com> References: <20170412061549.GB32351@kroah.com> <1492067363-31101-1-git-send-email-skanda.kashyap@gmail.com> Message-ID: <20170414081534.GB16598@kroah.com> On Thu, Apr 13, 2017 at 12:09:23AM -0700, skanda.kashyap at gmail.com wrote: > From: Skanda Guruanand > > Modified struct lu_dirpage in lustre_idl.h file to remove the sparse > warnings where cast to restricted types are made. > > Following warnings are removed by this fix. > > drivers/staging/lustre/lustre/mdc/mdc_request.c:958:42: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:959:42: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:962:42: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:963:42: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:985:50: warning: cast to restricted __le32 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1193:24: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1328:25: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1329:23: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1332:25: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1333:23: warning: cast to restricted __le64 > > Signed-off-by: Skanda Guruanand > --- > Isn't the below reason good enough? > Since the structure elements are always converted from little endian to processor native format > in mdc_request.c, struct lu_dirpage element types is modified. Why isn't this above in the changelog text? And I need an ack from a lustre maintainer before I can take this... thanks, greg k-h From gregkh at linuxfoundation.org Fri Apr 14 08:16:31 2017 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Fri, 14 Apr 2017 10:16:31 +0200 Subject: [lustre-devel] [PATCH v2] staging: lustre: replace simple_strtoul with kstrtoint In-Reply-To: <20170321124609.GA3896@gentoo> References: <20170321124609.GA3896@gentoo> Message-ID: <20170414081631.GC16598@kroah.com> On Tue, Mar 21, 2017 at 01:46:09PM +0100, Marcin Ciupak wrote: > Replace simple_strtoul with kstrtoint. > simple_strtoul is marked for obsoletion as reported by checkpatch.pl > > Signed-off-by: Marcin Ciupak > --- > v2: > -improving kstrtoint error handling > -updating commit message > > drivers/staging/lustre/lustre/obdclass/obd_mount.c | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c > index 8e0d4b1d86dc..42858ee5b444 100644 > --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c > +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c > @@ -924,12 +924,20 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd) > lmd->lmd_flags |= LMD_FLG_ABORT_RECOV; > clear++; > } else if (strncmp(s1, "recovery_time_soft=", 19) == 0) { > - lmd->lmd_recovery_time_soft = max_t(int, > - simple_strtoul(s1 + 19, NULL, 10), time_min); > + int res; > + > + rc = kstrtoint(s1 + 19, 10, &res); > + if (rc) > + goto invalid; > + lmd->lmd_recovery_time_soft = max_t(int, res, time_min); Are you sure max_t is still needed here? And have you tested this change? thanks, greg k-h From arnd at arndb.de Sat Apr 15 10:29:00 2017 From: arnd at arndb.de (Arnd Bergmann) Date: Sat, 15 Apr 2017 10:29:00 +0000 Subject: [lustre-devel] [PATCH 06/12] audit: Use timespec64 to represent audit timestamps In-Reply-To: References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> <1491613030-11599-7-git-send-email-deepa.kernel@gmail.com> Message-ID: On Sat, Apr 8, 2017 at 5:58 PM, Deepa Dinamani wrote: >> I have no problem merging this patch into audit/next for v4.12, would >> you prefer me to do that so at least this patch is merged? > > This would be fine. > But, I think whoever takes the last 2 deletion patches should also take them. > I'm not sure how that part works out. > >> It would probably make life a small bit easier for us in the audit >> world too as it would reduce the potential merge conflict. However, >> that's a relatively small thing to worry about. As Andrew has picked the remaining patches up into -mm, this will work out fine: any patches picked up by the respective maintainers for v4.12 should arrive as git pull requests before the -mm patches get applied at a later stage of the merge window. Arnd From greg at kroah.com Sat Apr 15 11:48:51 2017 From: greg at kroah.com (greg at kroah.com) Date: Sat, 15 Apr 2017 13:48:51 +0200 Subject: [lustre-devel] [Patch v2 1/2] lustre: Parantheses added for Macro argument to avoid precedence issues In-Reply-To: References: Message-ID: <20170415114851.GA24035@kroah.com> On Sat, Apr 15, 2017 at 11:25:00AM +0000, Rishiraj Manwatkar wrote: > From: RishirajAM > > Parantheses are added for Macro argument, to avoid precedence issues. > > Signed-off-by: Rishiraj Manwatkar > --- > drivers/staging/lustre/lustre/obdclass/cl_io.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) What changed from v1? Always put that below the --- line. And your From: line doesn't match your signed-off-by name, that's not ok. > > diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c b/drivers/staging/lustre/lustre/obdclass/cl_io.c > index ee7d677..0997254 100755 > --- a/drivers/staging/lustre/lustre/obdclass/cl_io.c > +++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c > @@ -52,9 +52,9 @@ > */ > > #define cl_io_for_each(slice, io) \ > - list_for_each_entry((slice), &io->ci_layers, cis_linkage) > + list_for_each_entry((slice), &(io)->ci_layers, cis_linkage) What 'precidence' issue is this fixing? How could that ever be incorrect? Really, this macro just needs to go away and be used "as is" anyway... thanks, greg k-h From greg at kroah.com Sat Apr 15 11:49:23 2017 From: greg at kroah.com (greg at kroah.com) Date: Sat, 15 Apr 2017 13:49:23 +0200 Subject: [lustre-devel] [Patch v2 2/2] lustre: fix coding style issue In-Reply-To: References: <677c0d437ce8d9f27213e408751a1058b5c9e482.1492255075.git.manwatkar@outlook.com> Message-ID: <20170415114923.GB24035@kroah.com> On Sat, Apr 15, 2017 at 11:25:11AM +0000, Rishiraj Manwatkar wrote: > Comparison should have the CONSTANT on the right side of the test Your subject needs to be better :( thanks, greg k-h From brinkman at uni-mainz.de Mon Apr 17 12:32:58 2017 From: brinkman at uni-mainz.de (=?utf-8?B?QnJpbmttYW5uLCBQcm9mLiBEci4gQW5kcsOp?=) Date: Mon, 17 Apr 2017 12:32:58 +0000 Subject: [lustre-devel] [PATCH 1/6] Autoconf option for rate-limiting Quality of Service (RLQOS) In-Reply-To: <949ca9f8-c4a5-1413-abbb-4777189ba425@ascar.io> References: <99fe8fdaaaa5b6fd36c0782269bc45a580079696.1490122510.git.yanli@ascar.io> <3FFFCE73-97FE-4A10-8AC6-47D835CC6B3C@intel.com> <3BE4A898-D944-41F9-84C8-FE8DA80D0D65@datadirectnet.com> <949ca9f8-c4a5-1413-abbb-4777189ba425@ascar.io> Message-ID: Dear Yan Li, I fully agree that your approach to learn a small rule-set is very interesting to optimize overall Lustre bandwidth. What I have not been able to fully understand from your paper is the cost of adaptation. What is happening in a cluster running many jobs at the same time applying very different access patterns (in very different combinations to different OSSes)? We have just started to collect these patterns. Might be interesting to apply different (machine learning) algorithms on top of these patters going into different directions: - Optimize overall bandwidth (like ASCAR is doing) - Optimize bandwidth while supporting QoS rules for certain applications Will you be at LUG? At least Tim from our team will participate and it might be a good opportunity to discuss a joint approach. Best Regards, André Am 14.04.17, 04:55 schrieb "Yan Li" : On 03/24/2017 08:36 PM, Li Xi wrote: > > As you already know, we (DDN and also Prof. André and Lingfang from Mainz University) > are working together on QoS, not only server side TBF policy of NRS, but also client > side QoS (https://jira.hpdd.intel.com/browse/LU-7982). And also, global QoS of Lustre > is under development. After a glance on the paper, I think your work looks different from > our approach. That is good, because these mechanisms could work together to improve > the service quality of Lustre in different ways for different requirements. > > I have a few questions about LRQOS. I haven’t read all the details in the paper, so please > correct me if I am wrong. > > 1) In my understanding, ASCAR/RLQOS is aimed at preventing congestion in the Lustre > client. Am I correct? Is ASCAR/RLQOS able to provide any bandwidth/IOPS guarantees > to each applications, or to each user, or job? There is an common use case of client side > QoS. For example, multiple users are sharing the same Lustre client. But one of the users > starts a very aggressive application which uses all the available bandwidth/IOPS and thus > cause very bad performance/latency to other users. So, what we (DDN) are currently working > on is to trying to isolate/balance performance between users/jobs. I am wondering whether > ASCAR/RLQOS is able to be combined with our patches (https://review.whamcloud.com/#/c/19896/, > https://review.whamcloud.com/#/c/19700/) to provide an even better solution. ASCAR/RLQOS can't do bandwidth allocation for jobs accessing the same OSC yet. It is theoretically possible to do that for jobs accessing different OSCs, by using different rulesets for different OSC, but we don't know what is the best way to design these rulesets for bandwidth allocation yet. I agree it would be beneficial if our development effort can be combined. The core idea of ASCAR/RLQOS is to use a predefined ruleset to manage existing parameters, and this idea can be applied to any parameters in addition to those used in QoS. > 2) It is mentioned in the paper that ASCAR/RLQOS is controlling max flight RPC of OSC to > prevent congestion. However, for cached I/O, we found that page cache limitation on client is > also affecting the throughputs of applications. Especially, when multiple different applications > are sharing limited page caches. One of big concern is, when max flight RPC is limited, > the page cache will be exhausted (for example, when multiple applications keep on writing > data), and this is a new type of congestion. I am not sure, do you think this kind of congestion > will cause any performance decline/problem to the application? Yes. If that's the concern we should also tune the page cache limitation in addition to mrif. But the effectiveness of this needs to be carefully evaluated. > 3) Have you considered implementing ASCAR/RLQOS on Lustre server side? As already > mentioned in the paper, sometimes, clients of Lustre could connect to the servers and send > requests without any self-restraint which is unfair to other clients which follows the control > of ASCAR/RLQOS. And unfortunately, it is hard to get all the clients under control since > Lustre clients could change a lot from time to time. However, if a similar mechanism is > implemented on server side, things becomes much easier. And that is part of the reason > why TBF was implemented on server side rather than client side. Maybe something > similar to ASCAR/RLQOS could be implemented on MDTs/OSTs too. What do you think? This is definitely an interesting idea. As I said earlier, the core idea of ASCAR/RLQOS is actually tuning parameters dynamically, and we can apply this rule-based control to any parameters on both the server and client side. > 4) In your paper, I/O patterns detection or work load classifier are mentioned. So do you know > is there any any good way to detect/describe the I/O pattern of a application? Understanding > the I/O patterns of applications are really important and helpful for QoS. But I guess it is > really difficult, comparing to the pattern detection on other systems, like network. However, > do you have any idea or direction that looks like the right way? Maybe something like > machine learning? Yes. We are experimenting deep reinforcement learning-based methods and have seen some good results. The best part of using deep learning is that we don't have to worry about feature selection. As to whether deep learning works in real world, it has to be evaluated thoroughly. Yan From yanli at ascar.io Mon Apr 17 16:46:03 2017 From: yanli at ascar.io (Yan Li) Date: Mon, 17 Apr 2017 09:46:03 -0700 Subject: [lustre-devel] [PATCH 1/6] Autoconf option for rate-limiting Quality of Service (RLQOS) In-Reply-To: References: <99fe8fdaaaa5b6fd36c0782269bc45a580079696.1490122510.git.yanli@ascar.io> <3FFFCE73-97FE-4A10-8AC6-47D835CC6B3C@intel.com> <3BE4A898-D944-41F9-84C8-FE8DA80D0D65@datadirectnet.com> <949ca9f8-c4a5-1413-abbb-4777189ba425@ascar.io> Message-ID: <7ca175f0-85b1-e80d-d67b-b5d49eeacd17@ascar.io> On 04/17/2017 05:32 AM, Brinkmann, Prof. Dr. André wrote: > I fully agree that your approach to learn a small rule-set is very interesting to optimize overall > Lustre bandwidth. What I have not been able to fully understand from your paper is the cost of > adaptation. What is happening in a cluster running many jobs at the same time applying very different > access patterns (in very different combinations to different OSSes)? When there are many jobs, their aggregated I/O pattern can usually be treated as a mixed random read/write workload. The more jobs you have, the more uniformly random the I/O pattern is. My experience is that they are not that hard to optimize. The hardest to optimize are when only one or two I/O job is running and they have a very special I/O pattern. > We have just started to collect these patterns. Might be interesting to apply different (machine learning) > algorithms on top of these patters going into different directions: > > - Optimize overall bandwidth (like ASCAR is doing) This is similar to what I'm working on. I've been systematically testing many machine learning algorithms on bandwidth optimization, and some of them have pretty good results. My problem is that all my workloads so far are synthetic. > - Optimize bandwidth while supporting QoS rules for certain > applications This is on my radar. I'll look into your design and implementation to see how we can do something interesting together. > Will you be at LUG? At least Tim from our team will participate and it might be a good opportunity to discuss > a joint approach. I'm not sure yet. Now I've graduated I need to find my own funding source for travel. -- Yan From andreas.dilger at intel.com Tue Apr 18 09:47:46 2017 From: andreas.dilger at intel.com (Dilger, Andreas) Date: Tue, 18 Apr 2017 09:47:46 +0000 Subject: [lustre-devel] [PATCH RESEND v2] Staging: lustre cleanup macros in libcfs_private.h In-Reply-To: <20170413092441.GA22444@starbase.xayto.local> References: <20170413092441.GA22444@starbase.xayto.local> Message-ID: <85E9E90F-59AA-4755-8CAE-F294B83DD0E9@intel.com> On Apr 13, 2017, at 03:24, Craig Inches wrote: > > This resolves a checkpatch warning that "Single statement macros should > not use a do {} while (0) loop" by removing the loop and adjusting line > length accordingly. > > Signed-off-by: Craig Inches I don't think there was any particular reason for "do { } while(0)" here except force of habit. Reviewed-by: Andreas Dilger > --- > Changes in v2: > - Kept statements together > - Kept operator on previous line > > .../lustre/include/linux/libcfs/libcfs_private.h | 51 +++++++--------------- > 1 file changed, 15 insertions(+), 36 deletions(-) > > diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h > index 2dae857..e774c75 100644 > --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h > +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h > @@ -87,12 +87,9 @@ do { \ > #define LIBCFS_VMALLOC_SIZE (2 << PAGE_SHIFT) /* 2 pages */ > #endif > > -#define LIBCFS_ALLOC_PRE(size, mask) \ > -do { \ > - LASSERT(!in_interrupt() || \ > - ((size) <= LIBCFS_VMALLOC_SIZE && \ > - !gfpflags_allow_blocking(mask))); \ > -} while (0) > +#define LIBCFS_ALLOC_PRE(size, mask) \ > + LASSERT(!in_interrupt() || ((size) <= LIBCFS_VMALLOC_SIZE && \ > + !gfpflags_allow_blocking(mask))) > > #define LIBCFS_ALLOC_POST(ptr, size) \ > do { \ > @@ -187,46 +184,28 @@ void cfs_array_free(void *vars); > #if LASSERT_ATOMIC_ENABLED > > /** assert value of @a is equal to @v */ > -#define LASSERT_ATOMIC_EQ(a, v) \ > -do { \ > - LASSERTF(atomic_read(a) == v, \ > - "value: %d\n", atomic_read((a))); \ > -} while (0) > +#define LASSERT_ATOMIC_EQ(a, v) \ > + LASSERTF(atomic_read(a) == v, "value: %d\n", atomic_read((a))) > > /** assert value of @a is unequal to @v */ > -#define LASSERT_ATOMIC_NE(a, v) \ > -do { \ > - LASSERTF(atomic_read(a) != v, \ > - "value: %d\n", atomic_read((a))); \ > -} while (0) > +#define LASSERT_ATOMIC_NE(a, v) \ > + LASSERTF(atomic_read(a) != v, "value: %d\n", atomic_read((a))) > > /** assert value of @a is little than @v */ > -#define LASSERT_ATOMIC_LT(a, v) \ > -do { \ > - LASSERTF(atomic_read(a) < v, \ > - "value: %d\n", atomic_read((a))); \ > -} while (0) > +#define LASSERT_ATOMIC_LT(a, v) \ > + LASSERTF(atomic_read(a) < v, "value: %d\n", atomic_read((a))) > > /** assert value of @a is little/equal to @v */ > -#define LASSERT_ATOMIC_LE(a, v) \ > -do { \ > - LASSERTF(atomic_read(a) <= v, \ > - "value: %d\n", atomic_read((a))); \ > -} while (0) > +#define LASSERT_ATOMIC_LE(a, v) \ > + LASSERTF(atomic_read(a) <= v, "value: %d\n", atomic_read((a))) > > /** assert value of @a is great than @v */ > -#define LASSERT_ATOMIC_GT(a, v) \ > -do { \ > - LASSERTF(atomic_read(a) > v, \ > - "value: %d\n", atomic_read((a))); \ > -} while (0) > +#define LASSERT_ATOMIC_GT(a, v) \ > + LASSERTF(atomic_read(a) > v, "value: %d\n", atomic_read((a))) > > /** assert value of @a is great/equal to @v */ > -#define LASSERT_ATOMIC_GE(a, v) \ > -do { \ > - LASSERTF(atomic_read(a) >= v, \ > - "value: %d\n", atomic_read((a))); \ > -} while (0) > +#define LASSERT_ATOMIC_GE(a, v) \ > + LASSERTF(atomic_read(a) >= v, "value: %d\n", atomic_read((a))) > > /** assert value of @a is great than @v1 and little than @v2 */ > #define LASSERT_ATOMIC_GT_LT(a, v1, v2) \ > -- > 2.10.2 > > _______________________________________________ > lustre-devel mailing list > lustre-devel at lists.lustre.org > http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org Cheers, Andreas -- Andreas Dilger Lustre Principal Architect Intel Corporation From andreas.dilger at intel.com Tue Apr 18 09:54:05 2017 From: andreas.dilger at intel.com (Dilger, Andreas) Date: Tue, 18 Apr 2017 09:54:05 +0000 Subject: [lustre-devel] [PATCH v2] staging: lustre: Fix sparse endianness warnings cast to restricted __le64 and __le32 In-Reply-To: <1492303739-32762-1-git-send-email-skanda.kashyap@gmail.com> References: <20170414081534.GB16598@kroah.com> <1492303739-32762-1-git-send-email-skanda.kashyap@gmail.com> Message-ID: On Apr 15, 2017, at 18:48, skanda.kashyap at gmail.com wrote: > > From: Skanda Guruanand > > The struct lu_dirpage elements in lustre_idl.h file are modified to > __le64 and __le32 types since the elements are always converted from > litte endian to processor native format in mdc_request.c file. > > Following warnings are removed by this fix. > > drivers/staging/lustre/lustre/mdc/mdc_request.c:958:42: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:959:42: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:962:42: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:963:42: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:985:50: warning: cast to restricted __le32 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1193:24: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1328:25: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1329:23: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1332:25: warning: cast to restricted __le64 > drivers/staging/lustre/lustre/mdc/mdc_request.c:1333:23: warning: cast to restricted __le64 > > Signed-off-by: Skanda Guruanand Thanks for the patch. The resend of this patch should really have been marked "[PATCH v3]", but hopefully Greg will still notice this one. Reviewed-by: Andreas Dilger > --- > drivers/staging/lustre/lustre/include/lustre/lustre_idl.h | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h > index 60b827e..df48b8d 100644 > --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h > +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h > @@ -846,10 +846,10 @@ struct luda_type { > #endif > > struct lu_dirpage { > - __u64 ldp_hash_start; > - __u64 ldp_hash_end; > - __u32 ldp_flags; > - __u32 ldp_pad0; > + __le64 ldp_hash_start; > + __le64 ldp_hash_end; > + __le32 ldp_flags; > + __le32 ldp_pad0; > struct lu_dirent ldp_entries[0]; > }; > > -- > 1.9.1 > Cheers, Andreas -- Andreas Dilger Lustre Principal Architect Intel Corporation From greg at kroah.com Tue Apr 18 15:50:19 2017 From: greg at kroah.com (greg at kroah.com) Date: Tue, 18 Apr 2017 17:50:19 +0200 Subject: [lustre-devel] [Patch v3 1/2] lustre: Parantheses added for Macro argument to avoid precedence issues In-Reply-To: References: Message-ID: <20170418155019.GA7263@kroah.com> On Sat, Apr 15, 2017 at 01:50:42PM +0000, Rishiraj Manwatkar wrote: > Parantheses are added for Macro argument, to avoid precedence issues. > > Signed-off-by: Rishiraj Manwatkar > --- > v1 -> v2: Added mailing list in cc. > v2 -> v3: Changed From: to be same as Signed-off-by:. > drivers/staging/lustre/lustre/obdclass/cl_io.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c b/drivers/staging/lustre/lustre/obdclass/cl_io.c > index ee7d677..0997254 100755 > --- a/drivers/staging/lustre/lustre/obdclass/cl_io.c > +++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c > @@ -52,9 +52,9 @@ > */ > > #define cl_io_for_each(slice, io) \ > - list_for_each_entry((slice), &io->ci_layers, cis_linkage) > + list_for_each_entry((slice), &(io)->ci_layers, cis_linkage) Really? There is no precedence issues that I can see here, sorry. thanks, greg k-h From andreas.dilger at intel.com Wed Apr 19 01:04:52 2017 From: andreas.dilger at intel.com (Dilger, Andreas) Date: Wed, 19 Apr 2017 01:04:52 +0000 Subject: [lustre-devel] [Patch v3 2/2] lustre: CONSTANTS put on right side of comparison test In-Reply-To: References: <677c0d437ce8d9f27213e408751a1058b5c9e482.1492263580.git.manwatkar@outlook.com> Message-ID: On Apr 15, 2017, at 07:50, Rishiraj Manwatkar wrote: > > Comparison should have the CONSTANT on the right side of the test I don't think this change really improves things. For standalone comparisons I agree that having the constant on the RHS is best, but here it is like a normal mathematical expression "X <= type < Y" which I think is reasonable to keep even if checkpatch.pl complains a bit. That said, I don't have strong feelings about this and Greg can apply it or not as he sees fit. I guess the benefit of applying it is that it stops anyone else from sending the same patch in the future... Cheers, Andreas > Signed-off-by: Rishiraj Manwatkar > --- > v1 -> v2: Added mailing list in cc. > v2 -> v3: Improved Subject line. > drivers/staging/lustre/lustre/obdclass/cl_io.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c b/drivers/staging/lustre/lustre/obdclass/cl_io.c > index 0997254..bec112f 100755 > --- a/drivers/staging/lustre/lustre/obdclass/cl_io.c > +++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c > @@ -58,7 +58,7 @@ > > static inline int cl_io_type_is_valid(enum cl_io_type type) > { > - return CIT_READ <= type && type < CIT_OP_NR; > + return type >= CIT_READ && type < CIT_OP_NR; > } > > static inline int cl_io_is_loopable(const struct cl_io *io) > @@ -389,7 +389,7 @@ void cl_io_unlock(const struct lu_env *env, struct cl_io *io) > const struct cl_io_slice *scan; > > LASSERT(cl_io_is_loopable(io)); > - LASSERT(CIS_IT_STARTED <= io->ci_state && io->ci_state < CIS_UNLOCKED); > + LASSERT(io->ci_state >= CIS_IT_STARTED && io->ci_state < CIS_UNLOCKED); > LINVRNT(cl_io_invariant(io)); > > set = &io->ci_lockset; > -- > 2.1.4 > Cheers, Andreas -- Andreas Dilger Lustre Principal Architect Intel Corporation From andreas.dilger at intel.com Wed Apr 19 01:21:04 2017 From: andreas.dilger at intel.com (Dilger, Andreas) Date: Wed, 19 Apr 2017 01:21:04 +0000 Subject: [lustre-devel] [Patch v3 1/2] lustre: Parantheses added for Macro argument to avoid precedence issues In-Reply-To: <20170418155019.GA7263@kroah.com> References: <20170418155019.GA7263@kroah.com> Message-ID: <288867FC-FBC8-4E2B-B018-409822B24232@intel.com> On Apr 18, 2017, at 09:50, greg at kroah.com wrote: > > On Sat, Apr 15, 2017 at 01:50:42PM +0000, Rishiraj Manwatkar wrote: >> Subject: [Patch v3 1/2] lustre: Parantheses added for Macro argument to avoid precedence issues (typo) s/Parantheses/parenthesis/ s/Macro/macro/ The Subject line (excluding [PATCH] part) should be under 60 >> Parantheses are added for Macro argument, to avoid precedence issues. Should be something like: Subject: [PATCH v4 1/2] staging/lustre: add parenthesis to macro arguments Add parenthesis to cl_io_for_each() macro to avoid potential issues with unexpected argument expansion in CPP. >> Signed-off-by: Rishiraj Manwatkar >> --- >> v1 -> v2: Added mailing list in cc. >> v2 -> v3: Changed From: to be same as Signed-off-by:. >> drivers/staging/lustre/lustre/obdclass/cl_io.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c b/drivers/staging/lustre/lustre/obdclass/cl_io.c >> index ee7d677..0997254 100755 >> --- a/drivers/staging/lustre/lustre/obdclass/cl_io.c >> +++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c >> @@ -52,9 +52,9 @@ >> */ >> >> #define cl_io_for_each(slice, io) \ >> - list_for_each_entry((slice), &io->ci_layers, cis_linkage) >> + list_for_each_entry((slice), &(io)->ci_layers, cis_linkage) > > Really? There is no precedence issues that I can see here, sorry. Cheers, Andreas -- Andreas Dilger Lustre Principal Architect Intel Corporation From brinkman at uni-mainz.de Fri Apr 21 12:50:11 2017 From: brinkman at uni-mainz.de (=?utf-8?B?QnJpbmttYW5uLCBQcm9mLiBEci4gQW5kcsOp?=) Date: Fri, 21 Apr 2017 12:50:11 +0000 Subject: [lustre-devel] [PATCH 1/6] Autoconf option for rate-limiting Quality of Service (RLQOS) In-Reply-To: <7ca175f0-85b1-e80d-d67b-b5d49eeacd17@ascar.io> References: <99fe8fdaaaa5b6fd36c0782269bc45a580079696.1490122510.git.yanli@ascar.io> <3FFFCE73-97FE-4A10-8AC6-47D835CC6B3C@intel.com> <3BE4A898-D944-41F9-84C8-FE8DA80D0D65@datadirectnet.com> <949ca9f8-c4a5-1413-abbb-4777189ba425@ascar.io> <7ca175f0-85b1-e80d-d67b-b5d49eeacd17@ascar.io> Message-ID: On 04/17/2017 05:32 AM, Brinkmann, Prof. Dr. André wrote: > I fully agree that your approach to learn a small rule-set is very interesting to optimize overall > Lustre bandwidth. What I have not been able to fully understand from your paper is the cost of > adaptation. What is happening in a cluster running many jobs at the same time applying very different > access patterns (in very different combinations to different OSSes)? When there are many jobs, their aggregated I/O pattern can usually be treated as a mixed random read/write workload. The more jobs you have, the more uniformly random the I/O pattern is. My experience is that they are not that hard to optimize. The hardest to optimize are when only one or two I/O job is running and they have a very special I/O pattern. > We have just started to collect these patterns. Might be interesting to apply different (machine learning) > algorithms on top of these patters going into different directions: > > - Optimize overall bandwidth (like ASCAR is doing) This is similar to what I'm working on. I've been systematically testing many machine learning algorithms on bandwidth optimization, and some of them have pretty good results. My problem is that all my workloads so far are synthetic. > - Optimize bandwidth while supporting QoS rules for certain > applications This is on my radar. I'll look into your design and implementation to see how we can do something interesting together. > Will you be at LUG? At least Tim from our team will participate and it might be a good opportunity to discuss > a joint approach. I'm not sure yet. Now I've graduated I need to find my own funding source for travel. We should try to setup a conf-call after LUG if you are unable to attend to streamline our development. Cheers, André -- Yan From oleg.drokin at intel.com Sat Apr 22 01:41:18 2017 From: oleg.drokin at intel.com (Oleg Drokin) Date: Fri, 21 Apr 2017 21:41:18 -0400 Subject: [lustre-devel] New tag 2.9.56 Message-ID: <197B26FB-5F69-4A89-B9D9-8EAD32B61A3C@intel.com> Hello! I just tagged new tag 2.9.56 - with this Feature Freeze is now in effect and no new features are going to be accepted for the 2.10 release. Here's the changelog (notable features - Progressive File Layout to allow flexible layouts depending on file size; Project quota - to allow additional limiting on quotas based on "project id" in addition to user and group ids): Alex Zhuravlev (1): LU-9314 osd: cleaup qsd once commit callbacks are done Alexander Boyko (2): LU-9065 osc: fix for cl_env_get in low memory LU-9286 ptlrpc: fix wrong error handlers Andreas Dilger (8): LU-1538 tests: improve sanityn test_51 error messages LU-8823 ptlrpc: remove obsolete OST/MDT thread parameters LU-8998 docs: add llapi_ man pages to Makefile.am LU-9140 tests: disable sanityn test_77j and test_77k LU-8998 misc: minor clean ups LU-3434 scripts: check for mdsfilesystemtype= option LU-9186 tests: fix sanityn test_76 and related code LU-930 doc: update LFSCK documentation Andriy Skulysh (1): LU-9171 osc: GPF while doing ELC with no_wait_policy Arnd Bergmann (1): LU-4423 osc: use 64-bit timestamps in debugfs output Ashish Purkar (1): LU-7819 tests: fix checkfiemap for stripecount > 1 Bob Glossman (4): LU-9236 kernel: new kernel RHEL 6.9 [2.6.32-696.el6] LU-9281 test: stop using invalid ps option LU-9275 kernel: kernel update [SLES12 SP2 4.4.49-92.14] LU-9287 kernel: kernel update [SLES11 SP4 3.0.101-97] Bobi Jam (8): LU-8998 lod: accomodate to composite layout LU-8998 lov: add composite layout unpacking LU-8998 clio: Client side implementation for PFL LU-8998 tests: test scripts for PFL LU-9008 pfl: dynamic layout modification with write/truncate LU-9165 pfl: MDS handling of write intent IT_LAYOUT RPC LU-9300 test: need copytool setup for sanity-hsm 1b LU-9307 lov: NULL pointer deref in lov_delete_composite Chris Hanna (1): LU-9245 utils: fix string copy handling within lgss_sk Dmitry Eremin (2): LU-8703 libcfs: use int type for CPT identification. LU-9183 libcfs: handle dump_trace() and related callbacks removal Fan Yong (9): LU-8900 tests: add snapshot in racer tests LU-8050 osp: not use obdo::o_lcookie for non-onwire RPC data LU-8054 lfsck: enhance lfsck notify API LU-8998 pfl: enhance PFID EA for PFL LU-8998 pfl: layout LFSCK handles PFL file LU-8998 pfl: test cases for lfsck on PFL LU-9187 lfsck: handle parameters properly LU-9259 tests: set fail_loc on the right MDT LU-9271 tests: remove unnecessary sanity-scrub test delay Gabriele Paciucci (1): LU-8458 pacemaker: Script to monitor Server status Henri Doreau (1): LU-7659 mdc: expose changelog through char devices James Nunez (1): LU-8603 test: Separate tests in metadata_updates James Simmons (4): LU-8843 build: fix all remaining less than 0 comparison for unsigned values LU-8066 obd: make version_show sysfs compliant LU-9019 obd: remove s2dhms time function LU-9019 quota : migrate to 64 bit time Jian Yu (1): LU-8152 utils: improve “lfs df” to show device status Jim Casper (1): LU-8333 test: Add replay-dual 21b to ALWAYS_EXCEPT Jinshan Xiong (2): LU-8998 docs: add lfs-setripe manpage to dist LU-8998 pfl: PFL feature implementation John L. Hammond (1): LU-9383 test: use a subdir in sanityn test_71b() Li Xi (3): LU-4017 quota: add project quota support to system header LU-4017 quota: add project quota support for Lustre LU-4017 quota: enable project quota limits Mikhal Pershin (2): LU-8119 osd: remove dcb entry from the list prior processing. LU-9184 grants: move grant code to the target Niu Yawei (7): LU-8998 pfl: Basic data structures for composite layout LU-8998 clio: getstripe support comp layout LU-8998 lustreapi: composite llapi_layout LU-8998 lfs: user space tools for PFL LU-8998 docs: man pages for tools of PFL LU-8998 utils: enlarge default inode size LU-8998 docs: man pages for composite layout APIs Oleg Drokin (5): LU-4017 quota: cleanup codes of quota for new type LU-4017 quota: add project id support LU-9339 quota: Replace MAXQUOTAS usage with LL_MAXQUOTAS LU-9339 ldiskfs: Make ldiskfs buildable on kernels with no project quota New tag 2.9.56 Qian Yingjin (2): LU-7470 nrs: extend TBF with NID/JobID/OPCode expression LU-8236 nrs: Add wildcard support for JOBID TBF rule Saurabh Tandan (2): LU-9318 test: sanity-lsnapshot skipped for all non-zfs configs LU-9320 test: Skip sanity test_80[12]* Steve Guminski (2): LU-9076 ptlrpc: Prevent possible dereference of NULL pointers LU-9166 mdt: Add trailing newlines to proc files Wang Shilong (5): LU-4017 ldiskfs: add project quota support LU-4017 ldiskfs: export __ext4_ioctl_setproject for lustre LU-9278 quota: avoid crash when access failed quota proc file LU-4017 quota: add setting/getting project id function LU-4017 quota: add project quota support to lfs quota/setquota Wei Liu (1): LU-9207 test: Add new disk image for 2.9.0 Yang Sheng (1): LU-7502 utils: add --mdt-count & --mdt-hash options teddy (1): LU-7529 test: fix tiny problems of tests in conf-sanity.sh From gregkh at linuxfoundation.org Fri Apr 28 07:30:31 2017 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Fri, 28 Apr 2017 09:30:31 +0200 Subject: [lustre-devel] [PATCH] drivers: staging: lustre: lustre: llite: file.c - fixed sparse warning about different fmode_t type In-Reply-To: <20170424065311.GA32527@gmail.com> References: <20170424065311.GA32527@gmail.com> Message-ID: <20170428073031.GB29107@kroah.com> On Mon, Apr 24, 2017 at 07:53:11AM +0100, Andrea della Porta wrote: > fixed a couple of sparse warning complaining about type mismatch. That's really vague, please be specific. > > Signed-off-by: Andrea della Porta > --- > drivers/staging/lustre/lustre/include/lustre_intent.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/lustre/lustre/include/lustre_intent.h b/drivers/staging/lustre/lustre/include/lustre_intent.h > index ed2b6c6..c036633 100644 > --- a/drivers/staging/lustre/lustre/include/lustre_intent.h > +++ b/drivers/staging/lustre/lustre/include/lustre_intent.h > @@ -38,7 +38,7 @@ > struct lookup_intent { > int it_op; > int it_create_mode; > - __u64 it_flags; > + fmode_t it_flags; Are you sure? Why? What exact warning did this "fix"? thanks, greg k-h From greg at kroah.com Fri Apr 28 09:42:27 2017 From: greg at kroah.com (greg at kroah.com) Date: Fri, 28 Apr 2017 11:42:27 +0200 Subject: [lustre-devel] [Patch v4 1/2] staging/lustre: add parenthesis to macro argument In-Reply-To: References: Message-ID: <20170428094227.GA7739@kroah.com> On Wed, Apr 19, 2017 at 03:50:05PM +0000, Rishiraj Manwatkar wrote: > Add parenthesis to cl_io_for_each() macro to avoid potential issues with > unexpected argument expansion in CPP. > > Signed-off-by: Rishiraj Manwatkar > --- > v1 -> v2: Added mailing list in cc. > v2 -> v3: Changed From: to be same as Signed-off-by:. > v3 -> v4: Changed Subject line and patch description as suggested by andreas.dilger at intel.com > drivers/staging/lustre/lustre/obdclass/cl_io.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c b/drivers/staging/lustre/lustre/obdclass/cl_io.c > index ee7d677..0997254 100755 > --- a/drivers/staging/lustre/lustre/obdclass/cl_io.c > +++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c > @@ -52,9 +52,9 @@ > */ > > #define cl_io_for_each(slice, io) \ > - list_for_each_entry((slice), &io->ci_layers, cis_linkage) > + list_for_each_entry((slice), &(io)->ci_layers, cis_linkage) > #define cl_io_for_each_reverse(slice, io) \ > - list_for_each_entry_reverse((slice), &io->ci_layers, cis_linkage) > + list_for_each_entry_reverse((slice), &(io)->ci_layers, cis_linkage) No, the original code is correct, that's going to be a variable only, not any type of "complex argument". thanks, greg k-h