From arnd at arndb.de Thu Jun 1 10:22:47 2017 From: arnd at arndb.de (Arnd Bergmann) Date: Thu, 1 Jun 2017 12:22:47 +0200 Subject: [lustre-devel] [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() In-Reply-To: References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> <1491613030-11599-5-git-send-email-deepa.kernel@gmail.com> Message-ID: On Thu, Jun 1, 2017 at 11:56 AM, Yan, Zheng wrote: > On Sat, Apr 8, 2017 at 8:57 AM, Deepa Dinamani wrote: >> 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); > > This change causes our kernel_untar_tar test case to fail (inode's > ctime goes back). The reason is that there is time drift between the > time stamps got by ktime_get_real_ts() and current_time(). We need to > revert this change until current_time() uses ktime_get_real_ts() > internally. Hmm, the change was not supposed to have a user-visible effect, so something has gone wrong, but I don't immediately see how it relates to what you observe. ktime_get_real_ts() and current_time() use the same time base, there is no drift, but there is a difference in resolution, as the latter uses the time stamp of the last jiffies update, which may be up to one jiffy (10ms) behind the exact time we put in the request stamps here. Do you still see problems if you use current_kernel_time() instead of ktime_get_real_ts()? Arnd From kedrot at gmail.com Thu Jun 1 18:56:44 2017 From: kedrot at gmail.com (Tordek) Date: Thu, 1 Jun 2017 15:56:44 -0300 Subject: [lustre-devel] [PATCH] drivers: staging/lustre: conrpc.c - fix sparse error: incompatible types in comparison expression (different address spaces) In-Reply-To: References: <20170505135129.14757-1-kedrot@gmail.com> Message-ID: This is fairly minor but it reveals a few hidden warnings, could I get some feedback on it? Thanks -- Guillermo On 5 May 2017 10:53, "Tordek" wrote: > This patch makes a lot of new warnings pop up, because the error is > blocking the rest of the file from being processed. > > On 5 May 2017 at 10:51, Guillermo O. Freschi wrote: > > Signed-off-by: Guillermo O. Freschi > > --- > > drivers/staging/lustre/lnet/selftest/conrpc.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c > b/drivers/staging/lustre/lnet/selftest/conrpc.c > > index da36c55b86d3..f4578200994f 100644 > > --- a/drivers/staging/lustre/lnet/selftest/conrpc.c > > +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c > > @@ -487,7 +487,7 @@ lstcon_rpc_trans_interpreter(struct > lstcon_rpc_trans *trans, > > sizeof(struct list_head))) > > return -EFAULT; > > > > - if (tmp.next == head_up) > > + if ((struct list_head __user *)tmp.next == head_up) > > return 0; > > > > next = tmp.next; > > -- > > 2.11.0 > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kedrot at gmail.com Thu Jun 1 21:42:57 2017 From: kedrot at gmail.com (Tordek) Date: Thu, 1 Jun 2017 18:42:57 -0300 Subject: [lustre-devel] [PATCH] drivers: staging/lustre: conrpc.c - fix sparse error: incompatible types in comparison expression (different address spaces) In-Reply-To: References: <20170505135129.14757-1-kedrot@gmail.com> Message-ID: This is fairly minor but it reveals a few hidden warnings, could I get some feedback on it? Thanks -- Guillermo On 5 May 2017 at 10:53, Tordek wrote: > This patch makes a lot of new warnings pop up, because the error is > blocking the rest of the file from being processed. > > On 5 May 2017 at 10:51, Guillermo O. Freschi wrote: >> Signed-off-by: Guillermo O. Freschi >> --- >> drivers/staging/lustre/lnet/selftest/conrpc.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c >> index da36c55b86d3..f4578200994f 100644 >> --- a/drivers/staging/lustre/lnet/selftest/conrpc.c >> +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c >> @@ -487,7 +487,7 @@ lstcon_rpc_trans_interpreter(struct lstcon_rpc_trans *trans, >> sizeof(struct list_head))) >> return -EFAULT; >> >> - if (tmp.next == head_up) >> + if ((struct list_head __user *)tmp.next == head_up) >> return 0; >> >> next = tmp.next; >> -- >> 2.11.0 >> From deepa.kernel at gmail.com Fri Jun 2 00:57:02 2017 From: deepa.kernel at gmail.com (Deepa Dinamani) Date: Thu, 1 Jun 2017 17:57:02 -0700 Subject: [lustre-devel] [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() In-Reply-To: References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> <1491613030-11599-5-git-send-email-deepa.kernel@gmail.com> Message-ID: On Thu, Jun 1, 2017 at 5:36 PM, John Stultz wrote: > On Thu, Jun 1, 2017 at 5:26 PM, Yan, Zheng wrote: >> On Thu, Jun 1, 2017 at 6:22 PM, Arnd Bergmann wrote: >>> On Thu, Jun 1, 2017 at 11:56 AM, Yan, Zheng wrote: >>>> On Sat, Apr 8, 2017 at 8:57 AM, Deepa Dinamani wrote: >>> >>>>> 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); >>>> >>>> This change causes our kernel_untar_tar test case to fail (inode's >>>> ctime goes back). The reason is that there is time drift between the >>>> time stamps got by ktime_get_real_ts() and current_time(). We need to >>>> revert this change until current_time() uses ktime_get_real_ts() >>>> internally. >>> >>> Hmm, the change was not supposed to have a user-visible effect, so >>> something has gone wrong, but I don't immediately see how it >>> relates to what you observe. >>> >>> ktime_get_real_ts() and current_time() use the same time base, there >>> is no drift, but there is a difference in resolution, as the latter uses >>> the time stamp of the last jiffies update, which may be up to one jiffy >>> (10ms) behind the exact time we put in the request stamps here. >>> >>> Do you still see problems if you use current_kernel_time() instead of >>> ktime_get_real_ts()? >> >> The problem disappears after using current_kernel_time(). >> >> https://github.com/ceph/ceph-client/commit/2e0f648da23167034a3cf1500bc90ec60aef2417 > > From the commit above: > "It seems there is time drift between ktime_get_real_ts() and > current_kernel_time()" > > Its more of a granularity difference. current_kernel_time() returns > the cached time at the last tick, where as ktime_get_real_ts() reads > the clocksource hardware and returns the immediate time. > > Filesystems usually use the cached time (similar to > CLOCK_REALTIME_COARSE), for performance reasons, as touching the > clocksource takes time. Alternatively, it would be best for this code also to use current_time(). I had suggested this in one of the previous versions of the patch. The implementation of current_time() will change when we switch vfs to use 64 bit time. This will prevent such errors from happening again. But, this also means there is more code reordering for these modules to get a reference to inode. -Deepa From andreas.dilger at intel.com Fri Jun 2 04:08:11 2017 From: andreas.dilger at intel.com (Dilger, Andreas) Date: Fri, 2 Jun 2017 04:08:11 +0000 Subject: [lustre-devel] [PATCH] drivers: staging/lustre: conrpc.c - fix sparse error: incompatible types in comparison expression (different address spaces) In-Reply-To: References: <20170505135129.14757-1-kedrot@gmail.com> Message-ID: <8FAAC9A9-A33E-40FA-B073-C4E0EAA7725A@intel.com> On Jun 1, 2017, at 14:56, Tordek wrote: > This is fairly minor but it reveals a few hidden warnings, could I get some feedback on it? This is a known problem, but can't immediately be fixed because it affects the interface with userspace tools. The correct solution is to not use struct list_head in the user interface at all, and we are looking into that. In the meantime, feel free to look at the warnings that are now visible after this patch is applied (locally on your system). Thanks, Andreas > > On 5 May 2017 10:53, "Tordek" wrote: > This patch makes a lot of new warnings pop up, because the error is > blocking the rest of the file from being processed. > > On 5 May 2017 at 10:51, Guillermo O. Freschi wrote: >> Signed-off-by: Guillermo O. Freschi >> --- >> drivers/staging/lustre/lnet/selftest/conrpc.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c >> index da36c55b86d3..f4578200994f 100644 >> --- a/drivers/staging/lustre/lnet/selftest/conrpc.c >> +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c >> @@ -487,7 +487,7 @@ lstcon_rpc_trans_interpreter(struct lstcon_rpc_trans *trans, >> sizeof(struct list_head))) >> return -EFAULT; >> >> - if (tmp.next == head_up) >> + if ((struct list_head __user *)tmp.next == head_up) >> return 0; >> >> next = tmp.next; >> -- >> 2.11.0 >> > _______________________________________________ > 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 kedrot at gmail.com Fri Jun 2 05:15:39 2017 From: kedrot at gmail.com (Tordek) Date: Fri, 2 Jun 2017 02:15:39 -0300 Subject: [lustre-devel] [PATCH] drivers: staging/lustre: conrpc.c - fix sparse error: incompatible types in comparison expression (different address spaces) In-Reply-To: <8FAAC9A9-A33E-40FA-B073-C4E0EAA7725A@intel.com> References: <20170505135129.14757-1-kedrot@gmail.com> <8FAAC9A9-A33E-40FA-B073-C4E0EAA7725A@intel.com> Message-ID: On 02/06/17 01:08, Dilger, Andreas wrote: > On Jun 1, 2017, at 14:56, Tordek wrote: >> This is fairly minor but it reveals a few hidden warnings, could I get some feedback on it? > > This is a known problem, but can't immediately be fixed because it affects the interface with > userspace tools. The correct solution is to not use struct list_head in the user interface > at all, and we are looking into that. > > In the meantime, feel free to look at the warnings that are now visible after this patch is > applied (locally on your system). Well, changing struct lstcon_rpc_ent *ent; to struct lstcon_rpc_ent __user *ent; makes most of the post-patch warnings disappear (and it... makes sense? we're calling `copy_to_user(&ent...` a lot, so I assume ent would be pointing to userspace memory). But if this is meant to change, maybe it's a moot point to look at it at all. Thanks! > > Thanks, Andreas > >> >> On 5 May 2017 10:53, "Tordek" wrote: >> This patch makes a lot of new warnings pop up, because the error is >> blocking the rest of the file from being processed. >> >> On 5 May 2017 at 10:51, Guillermo O. Freschi wrote: >>> Signed-off-by: Guillermo O. Freschi >>> --- >>> drivers/staging/lustre/lnet/selftest/conrpc.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c >>> index da36c55b86d3..f4578200994f 100644 >>> --- a/drivers/staging/lustre/lnet/selftest/conrpc.c >>> +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c >>> @@ -487,7 +487,7 @@ lstcon_rpc_trans_interpreter(struct lstcon_rpc_trans *trans, >>> sizeof(struct list_head))) >>> return -EFAULT; >>> >>> - if (tmp.next == head_up) >>> + if ((struct list_head __user *)tmp.next == head_up) >>> return 0; >>> >>> next = tmp.next; >>> -- >>> 2.11.0 >>> >> _______________________________________________ >> 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 > > > > > > > -- Tordek From arnd at arndb.de Fri Jun 2 09:45:47 2017 From: arnd at arndb.de (Arnd Bergmann) Date: Fri, 2 Jun 2017 11:45:47 +0200 Subject: [lustre-devel] [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() In-Reply-To: References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> <1491613030-11599-5-git-send-email-deepa.kernel@gmail.com> Message-ID: On Fri, Jun 2, 2017 at 4:09 AM, Yan, Zheng wrote: > On Fri, Jun 2, 2017 at 8:57 AM, Deepa Dinamani wrote: >> On Thu, Jun 1, 2017 at 5:36 PM, John Stultz wrote: >>> On Thu, Jun 1, 2017 at 5:26 PM, Yan, Zheng wrote: >>>> On Thu, Jun 1, 2017 at 6:22 PM, Arnd Bergmann wrote: >>>>> On Thu, Jun 1, 2017 at 11:56 AM, Yan, Zheng wrote: >>>>>> On Sat, Apr 8, 2017 at 8:57 AM, Deepa Dinamani wrote: >>>>> >>>>>>> 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); >>>>>> >>>>>> This change causes our kernel_untar_tar test case to fail (inode's >>>>>> ctime goes back). The reason is that there is time drift between the >>>>>> time stamps got by ktime_get_real_ts() and current_time(). We need to >>>>>> revert this change until current_time() uses ktime_get_real_ts() >>>>>> internally. >>>>> >>>>> Hmm, the change was not supposed to have a user-visible effect, so >>>>> something has gone wrong, but I don't immediately see how it >>>>> relates to what you observe. >>>>> >>>>> ktime_get_real_ts() and current_time() use the same time base, there >>>>> is no drift, but there is a difference in resolution, as the latter uses >>>>> the time stamp of the last jiffies update, which may be up to one jiffy >>>>> (10ms) behind the exact time we put in the request stamps here. >>>>> >>>>> Do you still see problems if you use current_kernel_time() instead of >>>>> ktime_get_real_ts()? >>>> >>>> The problem disappears after using current_kernel_time(). >>>> >>>> https://github.com/ceph/ceph-client/commit/2e0f648da23167034a3cf1500bc90ec60aef2417 >>> >>> From the commit above: >>> "It seems there is time drift between ktime_get_real_ts() and >>> current_kernel_time()" >>> >>> Its more of a granularity difference. current_kernel_time() returns >>> the cached time at the last tick, where as ktime_get_real_ts() reads >>> the clocksource hardware and returns the immediate time. >>> >>> Filesystems usually use the cached time (similar to >>> CLOCK_REALTIME_COARSE), for performance reasons, as touching the >>> clocksource takes time. >> >> Alternatively, it would be best for this code also to use current_time(). >> I had suggested this in one of the previous versions of the patch. >> The implementation of current_time() will change when we switch vfs to >> use 64 bit time. This will prevent such errors from happening again. >> But, this also means there is more code reordering for these modules >> to get a reference to inode. >> > > I took a look. it's quite inconvenience to use current_time(). I > prefer to temporarily use current_kernel_time(). I've looked at the code some more and I think there is another angle to it: In your test case, 'tar' calls into the utimes syscall (or a member of its family), which sets the i_ctime field in the inode to the curren time (using current_time()), then calls __ceph_setattr(), which creates a mds client request, and ceph_mdsc_create_request() takes another time stamp and stores it in r_stamp. We then store the first timestamp (only) in the in-memory inode, and the second time stamp in the request. Depending on the state of the inode, we may also set the ctime to a third timestamp we again take using current_time(). The mtime and atime from user space get passed correctly through union ceph_mds_request_args->setattr and are kept in sync between the in-memory inode and the persistent inode data, but the ctime in the inode never makes it to the lower protocol levels and instead we use the r_stamp field that got set a little earlier or a little later. I believe the bug you see is the result of the two timestamps currently being almost guaranteed to be different in the latest kernels. Changing r_stamp to use current_kernel_time() will make it the same value most of the time (as it was before Deepa's patch), but when the timer interrupt happens between the timestamps, the two are still different, it's just much harder to hit. I think the proper solution should be to change __ceph_setattr() in a way that has req->r_stamp always synchronized with i_ctime. If we copy i_ctime to r_stamp, that will also take care of the future issues with the planned changes to current_time(). The part I don't understand is what else r_stamp (i.e. the time stamp in ceph_msg_data with type== CEPH_MSG_CLIENT_REQUEST) is used for, other than setting ctime in CEPH_MDS_OP_SETATTR. Will this be used to update the stored i_ctime for other operations too? If so, we would need to synchronize it with the in-memory i_ctime for all operations that do this. Semi-related side note: I see that the granularity for ceph_timespec is 1000 nanoseconds, so the value is always a multiple of 1000. If the full 32-bit data gets stored, we could use this it to store the epoch number in the future: static inline void ceph_decode_timespec(struct timespec64 *ts, const struct ceph_timespec *tv) { u32 ns_epoch = le32_to_cpu(tv->tv_nsec); u32 epoch = ns_epoch % 1000; /* tv_sec is traditionally interpreted as unsigned * with time ranges 1970-2106, we extend * it to 1970-138069 */ ts->tv_sec = (u64)le32_to_cpu(tv->tv_sec) + (u64)epoch << 32; ts->tv_nsec = ns_epoch - epoch; } Arnd From arnd at arndb.de Fri Jun 2 10:51:16 2017 From: arnd at arndb.de (Arnd Bergmann) Date: Fri, 2 Jun 2017 12:51:16 +0200 Subject: [lustre-devel] [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() In-Reply-To: References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> <1491613030-11599-5-git-send-email-deepa.kernel@gmail.com> Message-ID: On Fri, Jun 2, 2017 at 12:10 PM, Yan, Zheng wrote: > On Fri, Jun 2, 2017 at 5:45 PM, Arnd Bergmann wrote: >> On Fri, Jun 2, 2017 at 4:09 AM, Yan, Zheng wrote: >>> On Fri, Jun 2, 2017 at 8:57 AM, Deepa Dinamani wrote: >>>> On Thu, Jun 1, 2017 at 5:36 PM, John Stultz wrote: >>>>> On Thu, Jun 1, 2017 at 5:26 PM, Yan, Zheng wrote: >> >> I believe the bug you see is the result of the two timestamps >> currently being almost guaranteed to be different in the latest >> kernels. >> Changing r_stamp to use current_kernel_time() will make it the >> same value most of the time (as it was before Deepa's patch), >> but when the timer interrupt happens between the timestamps, >> the two are still different, it's just much harder to hit. >> >> I think the proper solution should be to change __ceph_setattr() >> in a way that has req->r_stamp always synchronized with i_ctime. >> If we copy i_ctime to r_stamp, that will also take care of the >> future issues with the planned changes to current_time(). >> > I already have a patch > https://github.com/ceph/ceph-client/commit/24f54cd18e195a002ee3d2ab50dbc952fd9f82af Looks good to me. In case anyone cares: Acked-by: Arnd Bergmann >> The part I don't understand is what else r_stamp (i.e. the time >> stamp in ceph_msg_data with type== >> CEPH_MSG_CLIENT_REQUEST) is used for, other than setting >> ctime in CEPH_MDS_OP_SETATTR. >> >> Will this be used to update the stored i_ctime for other operations >> too? If so, we would need to synchronize it with the in-memory >> i_ctime for all operations that do this. >> > > yes, mds uses it to update ctime of modified inodes. For example, > when handling mkdir, mds set ctime of both parent inode and new inode > to r_stamp. I see, so we may have a variation of that problem there as well: From my reading of the code, the child inode is not in memory yet, so that seems fine, but I could not find where the parent in-memory inode i_ctime is updated in ceph, but it is most likely not the same as req->r_stamp (assuming it gets updated at all). Would it make sense require all callers of ceph_mdsc_do_request() to update r_stamp at the same time as i_ctime to keep them in sync? Arnd From arnd at arndb.de Fri Jun 2 11:33:32 2017 From: arnd at arndb.de (Arnd Bergmann) Date: Fri, 2 Jun 2017 13:33:32 +0200 Subject: [lustre-devel] [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() In-Reply-To: References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> <1491613030-11599-5-git-send-email-deepa.kernel@gmail.com> Message-ID: On Fri, Jun 2, 2017 at 1:18 PM, Yan, Zheng wrote: > On Fri, Jun 2, 2017 at 6:51 PM, Arnd Bergmann wrote: >> On Fri, Jun 2, 2017 at 12:10 PM, Yan, Zheng wrote: >>> On Fri, Jun 2, 2017 at 5:45 PM, Arnd Bergmann wrote: >>>> On Fri, Jun 2, 2017 at 4:09 AM, Yan, Zheng wrote: >>>>> On Fri, Jun 2, 2017 at 8:57 AM, Deepa Dinamani wrote: >>>>>> On Thu, Jun 1, 2017 at 5:36 PM, John Stultz wrote: >>>>>>> On Thu, Jun 1, 2017 at 5:26 PM, Yan, Zheng wrote: >>>> >>>> I believe the bug you see is the result of the two timestamps >>>> currently being almost guaranteed to be different in the latest >>>> kernels. >>>> Changing r_stamp to use current_kernel_time() will make it the >>>> same value most of the time (as it was before Deepa's patch), >>>> but when the timer interrupt happens between the timestamps, >>>> the two are still different, it's just much harder to hit. >>>> >>>> I think the proper solution should be to change __ceph_setattr() >>>> in a way that has req->r_stamp always synchronized with i_ctime. >>>> If we copy i_ctime to r_stamp, that will also take care of the >>>> future issues with the planned changes to current_time(). >>>> >>> I already have a patch >>> https://github.com/ceph/ceph-client/commit/24f54cd18e195a002ee3d2ab50dbc952fd9f82af >> >> Looks good to me. In case anyone cares: >> Acked-by: Arnd Bergmann >> >>>> The part I don't understand is what else r_stamp (i.e. the time >>>> stamp in ceph_msg_data with type== >>>> CEPH_MSG_CLIENT_REQUEST) is used for, other than setting >>>> ctime in CEPH_MDS_OP_SETATTR. >>>> >>>> Will this be used to update the stored i_ctime for other operations >>>> too? If so, we would need to synchronize it with the in-memory >>>> i_ctime for all operations that do this. >>>> >>> >>> yes, mds uses it to update ctime of modified inodes. For example, >>> when handling mkdir, mds set ctime of both parent inode and new inode >>> to r_stamp. >> >> I see, so we may have a variation of that problem there as well: From >> my reading of the code, the child inode is not in memory yet, so >> that seems fine, but I could not find where the parent in-memory inode >> i_ctime is updated in ceph, but it is most likely not the same as >> req->r_stamp (assuming it gets updated at all). > > i_ctime is updated when handling request reply, by ceph_fill_file_time(). > __ceph_setattr() can update the in-memory inode's ctime after request > reply is received. The difference between ktime_get_real_ts() and > current_time() can be larger than round-trip time of request. So it's > still possible that __ceph_setattr() make ctime go back. But the __ceph_setattr() problem should be fixed by your patch, right? What I meant is another related problem in ceph_mkdir() where the i_ctime field of the parent inode is different between the persistent representation in the mds and the in-memory representation. Arnd >> Would it make sense require all callers of ceph_mdsc_do_request() >> to update r_stamp at the same time as i_ctime to keep them in sync? From arnd at arndb.de Fri Jun 2 14:18:26 2017 From: arnd at arndb.de (Arnd Bergmann) Date: Fri, 2 Jun 2017 16:18:26 +0200 Subject: [lustre-devel] [PATCH 04/12] fs: ceph: CURRENT_TIME with ktime_get_real_ts() In-Reply-To: References: <1491613030-11599-1-git-send-email-deepa.kernel@gmail.com> <1491613030-11599-5-git-send-email-deepa.kernel@gmail.com> Message-ID: On Fri, Jun 2, 2017 at 2:18 PM, Yan, Zheng wrote: > On Fri, Jun 2, 2017 at 7:33 PM, Arnd Bergmann wrote: >> On Fri, Jun 2, 2017 at 1:18 PM, Yan, Zheng wrote: >> What I meant is another related problem in ceph_mkdir() where the >> i_ctime field of the parent inode is different between the persistent >> representation in the mds and the in-memory representation. >> > > I don't see any problem in mkdir case. Parent inode's i_ctime in mds is set to > r_stamp. When client receives request reply, it set its in-memory inode's ctime > to the same time stamp. Ok, I see it now, thanks for the clarification. Most other file systems do this the other way round and update all fields in the in-memory inode structure first and then write that to persistent storage, so I was getting confused about the order of events here. If I understand it all right, we have three different behaviors in ceph now, though the differences are very minor and probably don't ever matter: - in setattr(), we update ctime in the in-memory inode first and then send the same time to the mds, and expect to set it again when the reply comes. - in ceph_write_iter write() and mmap/page_mkwrite(), we call file_update_time() to set i_mtime and i_ctime to the same timestamp first once a write is observed by the fs and then take two other timestamps that we send to the mds, and update the in-memory inode a second time when the reply comes. ctime is never older than mtime here, as far as I can tell, but it may be newer when the timer interrupt happens between taking the two stamps. - in all other calls, we only update the inode (and/or parent inode) after the reply arrives. Arnd From gregkh at linuxfoundation.org Sat Jun 3 08:31:22 2017 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Sat, 3 Jun 2017 17:31:22 +0900 Subject: [lustre-devel] [PATCH] drivers: staging: lustre: lustre: llite: file.c - fixed sparse warning about different fmode_t type In-Reply-To: <20170424102858.GA1471@gmail.com> References: <20170424102858.GA1471@gmail.com> Message-ID: <20170603083122.GA14332@kroah.com> On Mon, Apr 24, 2017 at 11:28:58AM +0100, Andrea della Porta wrote: > Fixed the following sparse warning: > > CHECK drivers/staging/lustre/lustre/llite//file.c > drivers/staging/lustre/lustre/llite//file.c:441:24: warning: incorrect > type in assignment (different base types) > drivers/staging/lustre/lustre/llite//file.c:441:24: expected > restricted fmode_t [usertype] och_flags > drivers/staging/lustre/lustre/llite//file.c:441:24: got unsigned > long long [unsigned] [usertype] it_flags > drivers/staging/lustre/lustre/llite//file.c:465:65: warning: > restricted fmode_t degrades to integer > drivers/staging/lustre/lustre/llite//file.c:465:22: warning: incorrect > type in assignment (different base types) > drivers/staging/lustre/lustre/llite//file.c:465:22: expected > restricted fmode_t [usertype] fd_omode > drivers/staging/lustre/lustre/llite//file.c:465:22: got unsigned > long long > drivers/staging/lustre/lustre/llite//file.c:526:38: warning: invalid > assignment: |= > drivers/staging/lustre/lustre/llite//file.c:526:38: left side has > type unsigned long long > drivers/staging/lustre/lustre/llite//file.c:526:38: right side has > type restricted fmode_t > drivers/staging/lustre/lustre/llite//file.c:533:49: warning: > restricted fmode_t degrades to integer > drivers/staging/lustre/lustre/llite//file.c:553:28: warning: > restricted fmode_t degrades to integer > drivers/staging/lustre/lustre/llite//file.c:556:35: warning: > restricted fmode_t degrades to integer > drivers/staging/lustre/lustre/llite//file.c:778:23: warning: > restricted fmode_t degrades to integer > drivers/staging/lustre/lustre/llite//file.c:1309:62: warning: > restricted fmode_t degrades to integer > drivers/staging/lustre/lustre/llite//file.c:1357:23: warning: > incorrect type in initializer (different base types) > drivers/staging/lustre/lustre/llite//file.c:1357:23: expected > unsigned long long [unsigned] [usertype] flags > drivers/staging/lustre/lustre/llite//file.c:1357:23: got restricted > fmode_t [usertype] Please don't line-wrap messages like this so that we can see them easier. > 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; This adds a bunch of new build warnings when appied, are you sure you test-built your code? Always do so, I can't take this patch as-is :( thanks, greg k-h From gregkh at linuxfoundation.org Sat Jun 3 08:50:35 2017 From: gregkh at linuxfoundation.org (Greg KH) Date: Sat, 3 Jun 2017 17:50:35 +0900 Subject: [lustre-devel] [PATCH V2] libcfs: Fix a sleep-in-atomic bug in cfs_wi_exit In-Reply-To: <1496217641-17002-1-git-send-email-baijiaju1990@163.com> References: <1496217641-17002-1-git-send-email-baijiaju1990@163.com> Message-ID: <20170603085035.GB23970@kroah.com> On Wed, May 31, 2017 at 04:00:41PM +0800, Jia-Ju Bai wrote: > The driver may sleep under a spin lock, and the function call path is: > cfs_wi_exit (acquire the lock by spin_lock) > LASSERT > lbug_with_loc > libcfs_debug_dumplog > schedule and kthread_run --> may sleep > > To fix it, all "LASSERT" is placed out of the spin_lock and spin_unlock. > > Signed-off-by: Jia-Ju Bai > --- > drivers/staging/lustre/lnet/libcfs/workitem.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) What changed from v1? You have to always tell us that. Please redo all of these, if they are still valid patches, and send them as a patch series, so I know what order they should be applied in. thanks, greg k-h From kedrot at gmail.com Wed Jun 7 09:15:18 2017 From: kedrot at gmail.com (Guillermo O. Freschi) Date: Wed, 7 Jun 2017 06:15:18 -0300 Subject: [lustre-devel] [PATCH 1/2] drivers: staging/lustre: conrpc.c - fix sparse error: incompatible types in comparison expression (different address spaces) In-Reply-To: <8FAAC9A9-A33E-40FA-B073-C4E0EAA7725A@intel.com> References: <8FAAC9A9-A33E-40FA-B073-C4E0EAA7725A@intel.com> Message-ID: <20170607091519.5248-1-kedrot@gmail.com> This patch reveals hidden warnings after this line. (This is a stepping-stone patch for the following one, it should be ignored as per Andreas Dilger.) Signed-off-by: Guillermo O. Freschi --- drivers/staging/lustre/lnet/selftest/conrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c index da36c55b86d3..f4578200994f 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.c +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c @@ -487,7 +487,7 @@ lstcon_rpc_trans_interpreter(struct lstcon_rpc_trans *trans, sizeof(struct list_head))) return -EFAULT; - if (tmp.next == head_up) + if ((struct list_head __user *)tmp.next == head_up) return 0; next = tmp.next; -- 2.11.0 From kedrot at gmail.com Wed Jun 7 09:15:19 2017 From: kedrot at gmail.com (Guillermo O. Freschi) Date: Wed, 7 Jun 2017 06:15:19 -0300 Subject: [lustre-devel] [PATCH 2/2] drivers: staging/lustre: conrpc.c - fix sparse warning: warning: incorrect type in argument * (different address spaces) In-Reply-To: <20170607091519.5248-1-kedrot@gmail.com> References: <8FAAC9A9-A33E-40FA-B073-C4E0EAA7725A@intel.com> <20170607091519.5248-1-kedrot@gmail.com> Message-ID: <20170607091519.5248-2-kedrot@gmail.com> The calls to `copy_to_user` suggest that `ent` is pointing to userspace memory, but `ent` is missing the `__user` qualifier. Signed-off-by: Guillermo O. Freschi --- drivers/staging/lustre/lnet/selftest/conrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c index f4578200994f..04a5d7e80151 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.c +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c @@ -469,7 +469,7 @@ lstcon_rpc_trans_interpreter(struct lstcon_rpc_trans *trans, { struct list_head tmp; struct list_head __user *next; - struct lstcon_rpc_ent *ent; + struct lstcon_rpc_ent __user *ent; struct srpc_generic_reply *rep; struct lstcon_rpc *crpc; struct srpc_msg *msg; -- 2.11.0 From mikesart at fastmail.com Wed Jun 7 20:09:06 2017 From: mikesart at fastmail.com (Michael Sartain) Date: Wed, 7 Jun 2017 14:09:06 -0600 Subject: [lustre-devel] [PATCH] drivers: staging/lustre: lmv_obd.c - suppress Sparse user cast warning Message-ID: <20170607200906.6af6jd7vmfnpq2gt@mikesart-cos> Comment above assignment states that uarg does not point to user space memory (ll_dir_ioctl does copy_from_user), so this is a valid cast. This patch adds a __force annotation to suppress the "cast removes address space of expression" Sparse warning. Signed-off-by: Michael Sartain --- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index 271e18966f50..a6473a06dcf7 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -989,7 +989,7 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp, * Note: this is from llite(see ll_dir_ioctl()), @uarg does not * point to user space memory for FID2MDTIDX. */ - *(__u32 *)uarg = mdt_index; + *(__force __u32 *)uarg = mdt_index; break; } case OBD_IOC_FID2PATH: { -- 2.11.0 From kedrot at gmail.com Thu Jun 8 05:35:27 2017 From: kedrot at gmail.com (Guillermo O. Freschi) Date: Thu, 8 Jun 2017 02:35:27 -0300 Subject: [lustre-devel] [PATCH] staging/lustre: echo_client.c - fix sparse warning: cast removes address space of expression Message-ID: <20170608053527.21599-1-kedrot@gmail.com> The function only cares about the value of the pointer, not the contents of the pointed-to data. Adding a `__force` annotation to the cast removes this warning. Signed-off-by: Guillermo O. Freschi --- drivers/staging/lustre/lustre/obdecho/echo_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c b/drivers/staging/lustre/lustre/obdecho/echo_client.c index d4768311cf92..1757714c56a0 100644 --- a/drivers/staging/lustre/lustre/obdecho/echo_client.c +++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c @@ -1428,7 +1428,7 @@ static int echo_client_brw_ioctl(const struct lu_env *env, int rw, oa->o_valid &= ~OBD_MD_FLHANDLE; /* OFD/obdfilter works only via prep/commit */ - test_mode = (long)data->ioc_pbuf1; + test_mode = (__force long)data->ioc_pbuf1; if (test_mode == 1) async = 0; -- 2.11.0 From romeusmeister at gmail.com Thu Jun 8 17:25:41 2017 From: romeusmeister at gmail.com (Roman Storozhenko) Date: Thu, 8 Jun 2017 20:25:41 +0300 Subject: [lustre-devel] [PATCH] staging: lustre: llite: Replace the symbolic file permission mode with the numeric one Message-ID: <20170608172541.GA2314@home> Replaces S_IRWXUGO with 0007. The reason is that symbolic permissions considered harmful: https://lwn.net/Articles/696229/ Signed-off-by: Roman Storozhenko --- drivers/staging/lustre/lustre/llite/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 13b3592..de5b4bf 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -1141,7 +1141,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) } #if OBD_OCD_VERSION(2, 9, 50, 0) > LUSTRE_VERSION_CODE - mode = data->ioc_type != 0 ? data->ioc_type : S_IRWXUGO; + mode = data->ioc_type != 0 ? data->ioc_type : 0777; #else mode = data->ioc_type; #endif -- 2.7.4 From romeusmeister at gmail.com Fri Jun 9 12:04:17 2017 From: romeusmeister at gmail.com (Roman Storozhenko) Date: Fri, 9 Jun 2017 15:04:17 +0300 Subject: [lustre-devel] [PATCH] staging: lustre: llite: Make structure describing various file operations 'const' Message-ID: <20170609120417.GA19650@home> Use 'const' in declarations of various 'file_operations' structures. Signed-off-by: Roman Storozhenko --- drivers/staging/lustre/lustre/llite/file.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 67c4b9c..4072240 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -3114,7 +3114,7 @@ int ll_inode_permission(struct inode *inode, int mask) } /* -o localflock - only provides locally consistent flock locks */ -struct file_operations ll_file_operations = { +struct const file_operations ll_file_operations = { .read_iter = ll_file_read_iter, .write_iter = ll_file_write_iter, .unlocked_ioctl = ll_file_ioctl, @@ -3127,7 +3127,7 @@ struct file_operations ll_file_operations = { .flush = ll_flush }; -struct file_operations ll_file_operations_flock = { +struct const file_operations ll_file_operations_flock = { .read_iter = ll_file_read_iter, .write_iter = ll_file_write_iter, .unlocked_ioctl = ll_file_ioctl, @@ -3143,7 +3143,7 @@ struct file_operations ll_file_operations_flock = { }; /* These are for -o noflock - to return ENOSYS on flock calls */ -struct file_operations ll_file_operations_noflock = { +struct const file_operations ll_file_operations_noflock = { .read_iter = ll_file_read_iter, .write_iter = ll_file_write_iter, .unlocked_ioctl = ll_file_ioctl, -- 2.7.4 From romeusmeister at gmail.com Fri Jun 9 12:35:58 2017 From: romeusmeister at gmail.com (Roman Storozhenko) Date: Fri, 9 Jun 2017 15:35:58 +0300 Subject: [lustre-devel] [PATCH] staging: lustre: fid: Fixes debug output style problem Message-ID: <20170609123558.GA22491@home> Fixes a style problems. Replaces non-standard 'Lx' specifier with a standard 'llx'. Signed-off-by: Roman Storozhenko --- drivers/staging/lustre/lustre/fid/fid_request.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/fid/fid_request.c b/drivers/staging/lustre/lustre/fid/fid_request.c index 999f250..cd84b42 100644 --- a/drivers/staging/lustre/lustre/fid/fid_request.c +++ b/drivers/staging/lustre/lustre/fid/fid_request.c @@ -259,7 +259,7 @@ int seq_client_alloc_fid(const struct lu_env *env, return rc; } - CDEBUG(D_INFO, "%s: Switch to sequence [0x%16.16Lx]\n", + CDEBUG(D_INFO, "%s: Switch to sequence [0x%16.16llx]\n", seq->lcs_name, seqnr); seq->lcs_fid.f_oid = LUSTRE_FID_INIT_OID; -- 2.7.4 From spitzcor at cray.com Fri Jun 9 20:13:49 2017 From: spitzcor at cray.com (Cory Spitz) Date: Fri, 9 Jun 2017 20:13:49 +0000 Subject: [lustre-devel] [PATCH] staging: lustre: llite: Replace the symbolic file permission mode with the numeric one In-Reply-To: <20170608172541.GA2314@home> References: <20170608172541.GA2314@home> Message-ID: <78EAE665-9BDD-4EF4-8793-3FC55D565AFB@cray.com> Roman, You have “0007” in the description vs. “0777” in the patch. -Cory On 6/8/17, 12:25 PM, "lustre-devel on behalf of Roman Storozhenko" wrote: Replaces S_IRWXUGO with 0007. The reason is that symbolic permissions + mode = data->ioc_type != 0 ? data->ioc_type : 0777; From romeusmeister at gmail.com Sat Jun 10 12:01:50 2017 From: romeusmeister at gmail.com (Roman Storozhenko) Date: Sat, 10 Jun 2017 15:01:50 +0300 Subject: [lustre-devel] [PATCH] staging: lustre: llite: Replace the symbolic file permission mode with the numeric one In-Reply-To: <78EAE665-9BDD-4EF4-8793-3FC55D565AFB@cray.com> References: <20170608172541.GA2314@home> <78EAE665-9BDD-4EF4-8793-3FC55D565AFB@cray.com> Message-ID: <20170610120150.GA18030@home> On Fri, Jun 09, 2017 at 08:13:49PM +0000, Cory Spitz wrote: > Roman, > You have “0007” in the description vs. “0777” in the patch. > -Cory > > > On 6/8/17, 12:25 PM, "lustre-devel on behalf of Roman Storozhenko" wrote: > > Replaces S_IRWXUGO with 0007. The reason is that symbolic permissions > > > + mode = data->ioc_type != 0 ? data->ioc_type : 0777; > > Thanks that you pointed out that error. I have published the second version of the patch here: http://lists.lustre.org/pipermail/lustre-devel-lustre.org/2017-June/005727.html From gregkh at linuxfoundation.org Sun Jun 11 07:44:41 2017 From: gregkh at linuxfoundation.org (Greg KH) Date: Sun, 11 Jun 2017 09:44:41 +0200 Subject: [lustre-devel] [PATCH v2] staging: lustre: llite: Replace the symbolic file permission mode with the numeric one In-Reply-To: <20170608172541.GA2314@home> References: <20170608172541.GA2314@home> Message-ID: <20170611074441.GA30102@kroah.com> On Sat, Jun 10, 2017 at 02:48:34PM +0300, Roman Storozhenko wrote: > Replaces S_IRWXUGO with 0777. The reason is that symbolic permissions > considered harmful: > https://lwn.net/Articles/696229/ > > The second version of that patch fixes the mistype in the first version. > There were "0007" in the description instead of correct "0777" value. > Thanks to Cory Spitz, who pointed out this error here: > http://lists.lustre.org/pipermail/lustre-devel-lustre.org/2017-June/005726.html This info doesn't need to be in the patch itself, it should go below the --- line. Please fix up and resend. And also don't make your v3 of the patch with the same exact message-id of the previous ones. That's ripe for getting automatically deleted by mail filters and email clients. thanks, greg k-h From andreas.dilger at intel.com Mon Jun 12 20:20:15 2017 From: andreas.dilger at intel.com (Dilger, Andreas) Date: Mon, 12 Jun 2017 20:20:15 +0000 Subject: [lustre-devel] [PATCH] staging: lustre: headers: potential UAPI headers In-Reply-To: <20170121092459.GA29138@kroah.com> References: <1482167207-22800-1-git-send-email-jsimmons@infradead.org> <20170103141248.GA8695@kroah.com> <20170117074140.GA19328@kroah.com> <20170121092459.GA29138@kroah.com> Message-ID: <32AAAA94-0C88-40F5-8FAD-37F35A401AC3@intel.com> On Jan 21, 2017, at 02:24, Greg Kroah-Hartman wrote: > > On Fri, Jan 20, 2017 at 11:33:11PM +0000, James Simmons wrote: >> >>>>> On Mon, Dec 19, 2016 at 12:06:47PM -0500, James Simmons wrote: >>>>>> Not for landing. This is the purposed UAPI headers >>>>>> with the removal of unlikely and debugging macros. >>>>>> This is just for feedback to see if this is acceptable >>>>>> for the upstream client. >>>>>> >>>>>> Signed-off-by: James Simmons >>>>>> --- >>>>>> .../lustre/lustre/include/lustre/lustre_fid.h | 353 +++++++++++++++++++++ >>>>>> .../lustre/lustre/include/lustre/lustre_ostid.h | 233 ++++++++++++++ >>>>> >>>>> Can you make a lustre "uapi" directory so we can see which files you >>>>> really want to be UAPI and which you don't as time goes on? >>>> >>>> Where do you want them placed? In uapi/linux/lustre or uapi/lustre. Does >>>> it matter to you? The below was to forth coming UAPI headers which from >>>> your response you seem okay with in general. >>> >>> How many .h files are there going to be? It's just a single filesystem, >>> shouldn't you just need a single file? If so, how about >>> drivers/staging/lustre/include/uapi/lustre.h >>> ? >>> >>> If you really need multiple .h files, put them all in the same uapi/ >>> directory with a lustre_ prefix, you don't need a whole subdir just for >>> yourself, right? >> >> We have 12 UAPI headers and yes they all begin with lustre_*. Okay I will >> create a driver/staging/lustre/include/uapi/linux directory and start >> moving headers there. > > 12 seems like a lot just for a single, tiny, filesystem :) > > But moving them all to a single directory will see where we can later > merge them together, sounds like a good plan. Greg, are you really adamantly against moving the Lustre headers into their own lustre/ subdirectory? This change actually breaks userspace libraries/tools that are using these headers to interface with the kernel (which is the whole point of the UAPI headers). Current Lustre tools/libraries include headers like, e.g.: #include (from /usr/include/lustre) but with this change tools will have to change to use: #ifdef HAVE_LINUX_LUSTRE_USER #include #else #include #endif and will need to have configure checks in the build environment to know which location to use for include files. If we put the Lustre headers into an "include/linux/lustre/" subdir then the tools can continue to use "" and similar, and the Makefile can be changed to add "-I /usr/include/linux" (in addition to the normal "/usr/include") but it will work transparently to the code, regardless of where the headers are located or which kernel is being used. On the maintainability point of view, I'd also think that putting headers into a separate subdir would also be preferable just to avoid /usr/include/uapi/linux from growing huge. There are already several storage-related sybsystems that have their headers in a subdirectory, like ceph, cifs, mtd, nfsd, raid, and sunrpc. Cheers, Andreas From dan.carpenter at oracle.com Mon Jun 12 20:25:46 2017 From: dan.carpenter at oracle.com (Dan Carpenter) Date: Mon, 12 Jun 2017 23:25:46 +0300 Subject: [lustre-devel] [PATCH] staging: lustre: headers: potential UAPI headers In-Reply-To: <32AAAA94-0C88-40F5-8FAD-37F35A401AC3@intel.com> References: <1482167207-22800-1-git-send-email-jsimmons@infradead.org> <20170103141248.GA8695@kroah.com> <20170117074140.GA19328@kroah.com> <20170121092459.GA29138@kroah.com> <32AAAA94-0C88-40F5-8FAD-37F35A401AC3@intel.com> Message-ID: <20170612202546.ul7njlg7fkrnoool@mwanda> Greg said to go ahead... I think you misread something. We've all agreed to move the uapi directories into a separate dir and later we can discuss if it should be one enormous file or 12 huge files. regards, dan carpenter From oleg.drokin at intel.com Mon Jun 12 22:39:43 2017 From: oleg.drokin at intel.com (Oleg Drokin) Date: Mon, 12 Jun 2017 18:39:43 -0400 Subject: [lustre-devel] New tag 2.9.59 Message-ID: <1C93B8CA-9BA3-4A07-AA10-109BE98F5FBD@intel.com> Hello! I just tagged 2.9.59 in lustre community tree master branch. Here's the changelog: Alex Zhuravlev (2): LU-9333 osd: few cleanups to support gcc6 LU-9288 tests: t-f to check if ZFS module is loaded Amir Shehata (4): LU-9448 lnet: handle empty CPTs LU-9549 lnet: prevent assert on ln_state LU-9536 lnet: set LND tunalbes properly LU-9119 lnet: increment per NI stats Andreas Dilger (3): LU-9090 ofd: increase default OST BRW size to 4MB LU-930 doc: improve mount.lustre.8 option descriptions LU-930 doc: remove llapi_layout_t from man pages Andrew Perepechko (1): LU-9413 llite: llite.stat_blocksize param for fixed st_blksize Arnd Bergmann (1): LU-4423 libcfs: remove CFS_TIME_T definition Ben Evans (2): LU-9523 obdclass: remove CL_PAGE_INVOKE et. al. LU-9575 obdclass: remove cl_for_each defines Bob Glossman (5): LU-9459 kernel: kernel update [SLES12 SP2 4.4.59-92.17] LU-9503 kernel: kernel update [SLES11 SP4 3.0.101-100] LU-9539 kernel: kernel update [SLES12 SP1 3.12.74-60.64.40] LU-9561 kernel: kernel update RHEL7.3 [3.10.0-514.21.1.el7] LU-9572 kernel: kernel update RHEL6.9 [2.6.32-696.3.1.el6] Bobi Jam (5): LU-9229 osc: osc page lru list race LU-9489 lod: keep minimum LOVEA size LU-9486 llapi-test: sanity test_27D failure LU-9484 llite: eat -EEXIST on setting trunsted.lov LU-9367 llite: restore ll_file_getstripe in ll_lov_setstripe Bruno Faccini (1): LU-4640 mdt: implement Remove Archive on Last Unlink policy Chris Hanna (1): LU-8989 tests: fix sanity test_256() use of hardcoded filename Dmitry Eremin (4): LU-9183 ptlrpc: handle posix_acl: xattr representation cleanups LU-8964 libcfs: Introduce parallel tasks framework LU-8964 clio: Parallelize generic I/O LU-8703 libcfs: make tolerant to offline CPUs and empty NUMA nodes Doug Oucharek (1): LU-9507 lnd: Don't Assert On Reconnect with MultiQP Elena Gryaznova (2): LU-7088 tests: merge sanityn test_1[a-d] into test_1 LU-6900 tests: parallel-scale-nfs improvement Emoly Liu (2): LU-9463 utils: print lcme_flags in text format LU-9550 adio: delete the old Lustre ADIO driver patches Fan Yong (4): LU-9560 tests: sanity test_801a sleeps more time LU-9440 osd-ldiskfs: efficient way to get ldiskfs backend name LU-9488 scrub: reset noslot for full speed scrub LU-9433 osd-ldiskfs: fix inode reference leak Frank Zago (1): LU-7988 hsm: change the cdt event flags to a simple boolean Giuseppe Di Natale (2): LU-9526 spec: Improve systemd compat in spec file LU-9439 scripts: Provide a sample lnet.conf file Gregoire Pichon (1): LU-9533 tests: fix get_lustre_version in obdfilter-survey James Nunez (2): LU-6707 tests: Add ability to skip tests in POSIX LU-9384 tests: restore 2.9 filesystem images on 2.10 James Simmons (7): LU-9397 ksocklnd: move remaining time handling to 64 bits LU-9137 utils: replace readdir_r with readdir LU-9558 llite: generic_readlink is no longer exported LU-6401 uapi: change lustre_cfg.h into a proper UAPI header LU-9558 libcfs: handle hotplug state machine LU-9019 libcfs: remove no longer use time abstraction LU-8661 libcfs: handle pdata_set_cpumasks() removal Jian Yu (2): LU-9487 tests: stop primary and failover services in mmp test 1 LU-9556 tests: wait recovery complete in replay-single test 57 Jinshan Xiong (1): LU-9485 test: revert a change from LU-5361 John L. Hammond (3): LU-9312 hsm: convert cdt_llog_lock to a rw semaphore LU-9338 hsm: cache agent record locations LU-9010 ldlm: use static initializer macros where possible Nathaniel Clark (6): LU-2049 grant: Fix grant interop with pre-GRANT_PARAM clients LU-2049 tests: Add GRANT_CHECK_LIST to sanity LU-8797 lbuild: Fail build if zfs or spl git checkout fails LU-4378 wireshark: Add parsing for HSM commands LU-6582 wireshark: Add new LDLM intent bits LU-6648 wireshark: Process ldlm intent getxattr Niu Yawei (8): LU-8998 tools: parse optional argument properly LU-9513 liblustre: always check return value LU-9371 tools: handle component options properly LU-9424 tools: v1/v3 as composite layout LU-9449 tools: component add to no stripe info file LU-9490 llite: return v1/v3 layout for legacy app LU-9470 osc: update timestamps on write only LU-9490 tests: ll_dirstripe_verify handles PFL layout Oleg Drokin (2): Revert "LU-8359 ldlm: Wrong evict during failover" New tag 2.9.59 Parinay Kondekar (1): LU-9521 tests: Avoid cleanup() being called twice. Patrick Farrell (1): LU-8656 vvp: Add S_NOSEC support Prakash Surya (1): LU-9439 scripts: Change behavior of lustre_rmmod Qian Yingjin (1): LU-9140 nrs: calculate the measured rate according to dd runtime Quentin Bouget (2): LU-9482 hsm: release restore lock without object (part2) LU-7884 utils: mkfs prevents the creation of files in /dev/shm Robin Humble (1): LU-9562 llite: Remove filtering of seclabel xattr Sebastien Buisson (2): LU-8956 llite: set sec ctx on client's inode at create time LU-9289 nodemap: fix fileset string length issue Sonia (2): LU-8576 test: Fix hard-coded NETTYPE in test-framework.sh LU-9603 test: Fix test-framework.sh Steve Guminski (1): LU-6210 utils: Use C99 struct initializers in lfs_setstripe() Yang Sheng (3): LU-8364 ldiskfs: fixes for failover mode for RHEL7.3 LU-9384 ldiskfs: port extra isize patches to sles12sp2 LU-9384 ldiskfs: extra patch for changing extra isize From gregkh at linuxfoundation.org Tue Jun 13 04:25:31 2017 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Tue, 13 Jun 2017 06:25:31 +0200 Subject: [lustre-devel] [PATCH] staging: lustre: headers: potential UAPI headers In-Reply-To: <32AAAA94-0C88-40F5-8FAD-37F35A401AC3@intel.com> References: <1482167207-22800-1-git-send-email-jsimmons@infradead.org> <20170103141248.GA8695@kroah.com> <20170117074140.GA19328@kroah.com> <20170121092459.GA29138@kroah.com> <32AAAA94-0C88-40F5-8FAD-37F35A401AC3@intel.com> Message-ID: <20170613042531.GB13308@kroah.com> On Mon, Jun 12, 2017 at 08:20:15PM +0000, Dilger, Andreas wrote: > On Jan 21, 2017, at 02:24, Greg Kroah-Hartman wrote: > > > > On Fri, Jan 20, 2017 at 11:33:11PM +0000, James Simmons wrote: > >> > >>>>> On Mon, Dec 19, 2016 at 12:06:47PM -0500, James Simmons wrote: > >>>>>> Not for landing. This is the purposed UAPI headers > >>>>>> with the removal of unlikely and debugging macros. > >>>>>> This is just for feedback to see if this is acceptable > >>>>>> for the upstream client. > >>>>>> > >>>>>> Signed-off-by: James Simmons > >>>>>> --- > >>>>>> .../lustre/lustre/include/lustre/lustre_fid.h | 353 +++++++++++++++++++++ > >>>>>> .../lustre/lustre/include/lustre/lustre_ostid.h | 233 ++++++++++++++ > >>>>> > >>>>> Can you make a lustre "uapi" directory so we can see which files you > >>>>> really want to be UAPI and which you don't as time goes on? I said that ^^^ > >>>> Where do you want them placed? In uapi/linux/lustre or uapi/lustre. Does > >>>> it matter to you? The below was to forth coming UAPI headers which from > >>>> your response you seem okay with in general. > >>> > >>> How many .h files are there going to be? It's just a single filesystem, > >>> shouldn't you just need a single file? If so, how about > >>> drivers/staging/lustre/include/uapi/lustre.h > >>> ? > >>> > >>> If you really need multiple .h files, put them all in the same uapi/ > >>> directory with a lustre_ prefix, you don't need a whole subdir just for > >>> yourself, right? > >> > >> We have 12 UAPI headers and yes they all begin with lustre_*. Okay I will > >> create a driver/staging/lustre/include/uapi/linux directory and start > >> moving headers there. > > > > 12 seems like a lot just for a single, tiny, filesystem :) > > > > But moving them all to a single directory will see where we can later > > merge them together, sounds like a good plan. > > Greg, > are you really adamantly against moving the Lustre headers into their own lustre/ > subdirectory? I did not say that. Please, when responding to 5 month old email messages, get your quoting correct... greg k-h From romeusmeister at gmail.com Tue Jun 13 06:28:30 2017 From: romeusmeister at gmail.com (Roman Storozhenko) Date: Tue, 13 Jun 2017 09:28:30 +0300 Subject: [lustre-devel] [PATCH v3] staging: lustre: llite: Replace the symbolic file permission mode with the numeric one Message-ID: <20170613062830.GA4822@home> Replaces S_IRWXUGO with 0777. The reason is that symbolic permissions considered harmful: https://lwn.net/Articles/696229/ Signed-off-by: Roman Storozhenko --- drivers/staging/lustre/lustre/llite/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 13b3592..de5b4bf 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -1141,7 +1141,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) } #if OBD_OCD_VERSION(2, 9, 50, 0) > LUSTRE_VERSION_CODE - mode = data->ioc_type != 0 ? data->ioc_type : S_IRWXUGO; + mode = data->ioc_type != 0 ? data->ioc_type : 0777; #else mode = data->ioc_type; #endif -- 2.7.4 From greg at kroah.com Tue Jun 13 09:26:14 2017 From: greg at kroah.com (Greg Kroah-Hartman) Date: Tue, 13 Jun 2017 11:26:14 +0200 Subject: [lustre-devel] [PATCH] drivers: staging/lustre: lmv_obd.c - suppress Sparse user cast warning In-Reply-To: <20170607200906.6af6jd7vmfnpq2gt@mikesart-cos> References: <20170607200906.6af6jd7vmfnpq2gt@mikesart-cos> Message-ID: <20170613092613.GG5677@kroah.com> On Wed, Jun 07, 2017 at 02:09:06PM -0600, Michael Sartain wrote: > Comment above assignment states that uarg does not point to user space memory > (ll_dir_ioctl does copy_from_user), so this is a valid cast. This patch adds a > __force annotation to suppress the "cast removes address space of expression" > Sparse warning. > > Signed-off-by: Michael Sartain > --- > drivers/staging/lustre/lustre/lmv/lmv_obd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c > index 271e18966f50..a6473a06dcf7 100644 > --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c > +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c > @@ -989,7 +989,7 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp, > * Note: this is from llite(see ll_dir_ioctl()), @uarg does not > * point to user space memory for FID2MDTIDX. > */ > - *(__u32 *)uarg = mdt_index; > + *(__force __u32 *)uarg = mdt_index; Really? This is correct? If so, ugh, something is really wrong with the lustre code and it should be fixed "correctly". thanks, greg k-h From romeusmeister at gmail.com Tue Jun 13 09:29:31 2017 From: romeusmeister at gmail.com (Roman Storozhenko) Date: Tue, 13 Jun 2017 12:29:31 +0300 Subject: [lustre-devel] [PATCH v2] staging: lustre: fid: Fixes debug output style problem Message-ID: <20170613092931.GA14635@home> Fixes a style problems. Replaces non-standard 'Lx' specifier with a standard 'llx'. Signed-off-by: Roman Storozhenko --- drivers/staging/lustre/lustre/fid/fid_request.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/fid/fid_request.c b/drivers/staging/lustre/lustre/fid/fid_request.c index 999f250..cd84b42 100644 --- a/drivers/staging/lustre/lustre/fid/fid_request.c +++ b/drivers/staging/lustre/lustre/fid/fid_request.c @@ -259,7 +259,7 @@ int seq_client_alloc_fid(const struct lu_env *env, return rc; } - CDEBUG(D_INFO, "%s: Switch to sequence [0x%16.16Lx]\n", + CDEBUG(D_INFO, "%s: Switch to sequence [0x%16.16llx]\n", seq->lcs_name, seqnr); seq->lcs_fid.f_oid = LUSTRE_FID_INIT_OID; -- 2.7.4 From gregkh at linuxfoundation.org Tue Jun 13 09:25:31 2017 From: gregkh at linuxfoundation.org (Greg KH) Date: Tue, 13 Jun 2017 11:25:31 +0200 Subject: [lustre-devel] [PATCH v3] staging: lustre: llite: Replace the symbolic file permission mode with the numeric one In-Reply-To: <20170613062830.GA4822@home> References: <20170613062830.GA4822@home> Message-ID: <20170613092531.GF5677@kroah.com> On Tue, Jun 13, 2017 at 09:28:30AM +0300, Roman Storozhenko wrote: > Replaces S_IRWXUGO with 0777. The reason is that symbolic permissions > considered harmful: > https://lwn.net/Articles/696229/ > > Signed-off-by: Roman Storozhenko > --- > drivers/staging/lustre/lustre/llite/dir.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) What changed in this version of the patch? You always have to say that below the --- line, like the documentation says to do. Please fix, make a v4, and resend. thanks, greg k-h From romeusmeister at gmail.com Tue Jun 13 10:04:36 2017 From: romeusmeister at gmail.com (Roman Storozhenko) Date: Tue, 13 Jun 2017 13:04:36 +0300 Subject: [lustre-devel] [PATCH v4] staging: lustre: llite: Replace the symbolic file permission mode with the numeric one Message-ID: <20170613100436.GA14817@home> Replaces S_IRWXUGO with 0777. The reason is that symbolic permissions considered harmful: https://lwn.net/Articles/696229/ Signed-off-by: Roman Storozhenko --- Changes in V4: - replaces mistyped '0007' in the description with '0777' - places this description below the '---' line drivers/staging/lustre/lustre/llite/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 13b3592..de5b4bf 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -1141,7 +1141,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) } #if OBD_OCD_VERSION(2, 9, 50, 0) > LUSTRE_VERSION_CODE - mode = data->ioc_type != 0 ? data->ioc_type : S_IRWXUGO; + mode = data->ioc_type != 0 ? data->ioc_type : 0777; #else mode = data->ioc_type; #endif -- 2.7.4 From jsimmons at infradead.org Wed Jun 14 15:01:16 2017 From: jsimmons at infradead.org (James Simmons) Date: Wed, 14 Jun 2017 11:01:16 -0400 Subject: [lustre-devel] [PATCH 1/6] staging: lustre: lustre: resolve "use spaces between elements" checkpatch errors In-Reply-To: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> Message-ID: <1497452481-31124-2-git-send-email-jsimmons@infradead.org> Due to the way the DFID was embedded in our debug strings checkpatch would report the following error: CHECK: Concatenated strings should use spaces between elements This patch introduces proper space to resolve these reports. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/fid/fid_request.c | 2 +- drivers/staging/lustre/lustre/fld/fld_cache.c | 6 ++-- .../lustre/lustre/include/lustre/lustre_idl.h | 6 ++-- .../lustre/lustre/include/lustre/lustre_user.h | 2 +- drivers/staging/lustre/lustre/include/lustre_fid.h | 2 +- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 6 ++-- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 4 +-- drivers/staging/lustre/lustre/llite/dcache.c | 4 +-- drivers/staging/lustre/lustre/llite/dir.c | 12 +++---- drivers/staging/lustre/lustre/llite/file.c | 42 +++++++++++----------- .../staging/lustre/lustre/llite/llite_internal.h | 4 +-- drivers/staging/lustre/lustre/llite/llite_lib.c | 34 +++++++++--------- drivers/staging/lustre/lustre/llite/llite_mmap.c | 2 +- drivers/staging/lustre/lustre/llite/llite_nfs.c | 10 +++--- drivers/staging/lustre/lustre/llite/namei.c | 38 ++++++++++---------- drivers/staging/lustre/lustre/llite/rw26.c | 2 +- drivers/staging/lustre/lustre/llite/statahead.c | 14 ++++---- drivers/staging/lustre/lustre/llite/symlink.c | 4 +-- drivers/staging/lustre/lustre/llite/vvp_io.c | 2 +- drivers/staging/lustre/lustre/llite/vvp_object.c | 2 +- drivers/staging/lustre/lustre/llite/xattr.c | 6 ++-- drivers/staging/lustre/lustre/llite/xattr_cache.c | 4 +-- drivers/staging/lustre/lustre/lmv/lmv_fld.c | 2 +- drivers/staging/lustre/lustre/lmv/lmv_intent.c | 6 ++-- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 40 ++++++++++----------- drivers/staging/lustre/lustre/lov/lov_io.c | 2 +- drivers/staging/lustre/lustre/lov/lov_merge.c | 4 +-- drivers/staging/lustre/lustre/lov/lov_object.c | 7 ++-- drivers/staging/lustre/lustre/lov/lov_pack.c | 6 ++-- drivers/staging/lustre/lustre/lov/lov_pool.c | 8 ++--- drivers/staging/lustre/lustre/mdc/mdc_locks.c | 6 ++-- drivers/staging/lustre/lustre/mdc/mdc_reint.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_request.c | 16 ++++----- drivers/staging/lustre/lustre/mgc/mgc_request.c | 2 +- drivers/staging/lustre/lustre/obdclass/cl_lock.c | 2 +- drivers/staging/lustre/lustre/obdclass/cl_page.c | 2 +- drivers/staging/lustre/lustre/obdclass/llog_cat.c | 12 +++---- drivers/staging/lustre/lustre/obdclass/llog_swab.c | 2 +- drivers/staging/lustre/lustre/obdclass/lu_object.c | 2 +- .../staging/lustre/lustre/obdecho/echo_client.c | 4 +-- drivers/staging/lustre/lustre/osc/osc_cache.c | 8 ++--- drivers/staging/lustre/lustre/osc/osc_request.c | 3 +- drivers/staging/lustre/lustre/ptlrpc/client.c | 4 +-- .../staging/lustre/lustre/ptlrpc/pack_generic.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/service.c | 2 +- 45 files changed, 175 insertions(+), 177 deletions(-) diff --git a/drivers/staging/lustre/lustre/fid/fid_request.c b/drivers/staging/lustre/lustre/fid/fid_request.c index cd84b42..c05e928 100644 --- a/drivers/staging/lustre/lustre/fid/fid_request.c +++ b/drivers/staging/lustre/lustre/fid/fid_request.c @@ -279,7 +279,7 @@ int seq_client_alloc_fid(const struct lu_env *env, *fid = seq->lcs_fid; mutex_unlock(&seq->lcs_mutex); - CDEBUG(D_INFO, "%s: Allocated FID "DFID"\n", seq->lcs_name, PFID(fid)); + CDEBUG(D_INFO, "%s: Allocated FID " DFID "\n", seq->lcs_name, PFID(fid)); return rc; } EXPORT_SYMBOL(seq_client_alloc_fid); diff --git a/drivers/staging/lustre/lustre/fld/fld_cache.c b/drivers/staging/lustre/lustre/fld/fld_cache.c index 11f6974..b852fed 100644 --- a/drivers/staging/lustre/lustre/fld/fld_cache.c +++ b/drivers/staging/lustre/lustre/fld/fld_cache.c @@ -151,7 +151,7 @@ static void fld_fix_new_list(struct fld_cache *cache) continue; LASSERTF(c_range->lsr_start <= n_range->lsr_start, - "cur lsr_start "DRANGE" next lsr_start "DRANGE"\n", + "cur lsr_start " DRANGE " next lsr_start " DRANGE "\n", PRANGE(c_range), PRANGE(n_range)); /* check merge possibility with next range */ @@ -349,7 +349,7 @@ static void fld_cache_overlap_handle(struct fld_cache *cache, f_curr->fce_range.lsr_end = new_start; fld_cache_entry_add(cache, f_new, &f_curr->fce_list); } else - CERROR("NEW range ="DRANGE" curr = "DRANGE"\n", + CERROR("NEW range =" DRANGE " curr = " DRANGE "\n", PRANGE(range), PRANGE(&f_curr->fce_range)); } @@ -415,7 +415,7 @@ static int fld_cache_insert_nolock(struct fld_cache *cache, if (!prev) prev = head; - CDEBUG(D_INFO, "insert range "DRANGE"\n", PRANGE(&f_new->fce_range)); + CDEBUG(D_INFO, "insert range " DRANGE "\n", PRANGE(&f_new->fce_range)); /* Add new entry to cache and lru list. */ fld_cache_entry_add(cache, f_new, prev); out: diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h index df48b8d..77995fa 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h @@ -546,7 +546,7 @@ static inline void ostid_set_id(struct ost_id *oi, __u64 oid) static inline int fid_set_id(struct lu_fid *fid, __u64 oid) { if (unlikely(fid_seq_is_igif(fid->f_seq))) { - CERROR("bad IGIF, "DFID"\n", PFID(fid)); + CERROR("bad IGIF, " DFID "\n", PFID(fid)); return -EBADF; } @@ -585,7 +585,7 @@ static inline int ostid_to_fid(struct lu_fid *fid, struct ost_id *ostid, __u64 seq = ostid_seq(ostid); if (ost_idx > 0xffff) { - CERROR("bad ost_idx, "DOSTID" ost_idx:%u\n", POSTID(ostid), + CERROR("bad ost_idx, " DOSTID " ost_idx:%u\n", POSTID(ostid), ost_idx); return -EBADF; } @@ -630,7 +630,7 @@ static inline int ostid_to_fid(struct lu_fid *fid, struct ost_id *ostid, static inline int fid_to_ostid(const struct lu_fid *fid, struct ost_id *ostid) { if (unlikely(fid_seq_is_igif(fid->f_seq))) { - CERROR("bad IGIF, "DFID"\n", PFID(fid)); + CERROR("bad IGIF, " DFID "\n", PFID(fid)); return -EBADF; } diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h index 7d8628c..edff8dc 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h @@ -532,7 +532,7 @@ static inline void obd_uuid2fsname(char *buf, char *uuid, int buflen) #define FID_NOBRACE_LEN 40 #define FID_LEN (FID_NOBRACE_LEN + 2) #define DFID_NOBRACE "%#llx:0x%x:0x%x" -#define DFID "["DFID_NOBRACE"]" +#define DFID "[" DFID_NOBRACE "]" #define PFID(fid) (unsigned long long)(fid)->f_seq, (fid)->f_oid, (fid)->f_ver /* scanf input parse format for fids in DFID_NOBRACE format diff --git a/drivers/staging/lustre/lustre/include/lustre_fid.h b/drivers/staging/lustre/lustre/include/lustre_fid.h index b5a1aad..6dc24a7 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fid.h +++ b/drivers/staging/lustre/lustre/include/lustre_fid.h @@ -606,7 +606,7 @@ static inline __u32 fid_flatten32(const struct lu_fid *fid) static inline int lu_fid_diff(const struct lu_fid *fid1, const struct lu_fid *fid2) { - LASSERTF(fid_seq(fid1) == fid_seq(fid2), "fid1:"DFID", fid2:"DFID"\n", + LASSERTF(fid_seq(fid1) == fid_seq(fid2), "fid1:" DFID ", fid2:" DFID "\n", PFID(fid1), PFID(fid2)); if (fid_is_idif(fid1) && fid_is_idif(fid2)) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index 84eeaa5..4028e11 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c @@ -445,8 +445,8 @@ int ldlm_cli_enqueue_fini(struct obd_export *exp, struct ptlrpc_request *req, if (!ldlm_res_eq(&reply->lock_desc.l_resource.lr_name, &lock->l_resource->lr_name)) { - CDEBUG(D_INFO, "remote intent success, locking "DLDLMRES - " instead of "DLDLMRES"\n", + CDEBUG(D_INFO, "remote intent success, locking " DLDLMRES + " instead of " DLDLMRES "\n", PLDLMRES(&reply->lock_desc.l_resource), PLDLMRES(lock->l_resource)); @@ -1677,7 +1677,7 @@ int ldlm_cli_cancel_unused_resource(struct ldlm_namespace *ns, 0, flags | LCF_BL_AST, opaque); rc = ldlm_cli_cancel_list(&cancels, count, NULL, flags); if (rc != ELDLM_OK) - CERROR("canceling unused lock "DLDLMRES": rc = %d\n", + CERROR("canceling unused lock " DLDLMRES ": rc = %d\n", PLDLMRES(res), rc); LDLM_RESOURCE_DELREF(res); diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c index 1c8b0ea..c9ef247 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c @@ -849,7 +849,7 @@ static int ldlm_resource_complain(struct cfs_hash *hs, struct cfs_hash_bd *bd, struct ldlm_resource *res = cfs_hash_object(hs, hnode); lock_res(res); - CERROR("%s: namespace resource "DLDLMRES + CERROR("%s: namespace resource " DLDLMRES " (%p) refcount nonzero (%d) after lock cleanup; forcing cleanup.\n", ldlm_ns_name(ldlm_res_to_ns(res)), PLDLMRES(res), res, atomic_read(&res->lr_refcount) - 1); @@ -1391,7 +1391,7 @@ void ldlm_resource_dump(int level, struct ldlm_resource *res) if (!((libcfs_debug | D_ERROR) & level)) return; - CDEBUG(level, "--- Resource: "DLDLMRES" (%p) refcount = %d\n", + CDEBUG(level, "--- Resource: " DLDLMRES " (%p) refcount = %d\n", PLDLMRES(res), res, atomic_read(&res->lr_refcount)); if (!list_empty(&res->lr_granted)) { diff --git a/drivers/staging/lustre/lustre/llite/dcache.c b/drivers/staging/lustre/lustre/llite/dcache.c index 38f8466..d20425f 100644 --- a/drivers/staging/lustre/lustre/llite/dcache.c +++ b/drivers/staging/lustre/lustre/llite/dcache.c @@ -180,7 +180,7 @@ void ll_invalidate_aliases(struct inode *inode) { struct dentry *dentry; - CDEBUG(D_INODE, "marking dentries for ino "DFID"(%p) invalid\n", + CDEBUG(D_INODE, "marking dentries for ino " DFID "(%p) invalid\n", PFID(ll_inode2fid(inode)), inode); spin_lock(&inode->i_lock); @@ -216,7 +216,7 @@ void ll_lookup_finish_locks(struct lookup_intent *it, struct inode *inode) if (it->it_lock_mode && inode) { struct ll_sb_info *sbi = ll_i2sbi(inode); - CDEBUG(D_DLMTRACE, "setting l_data to inode "DFID"(%p)\n", + CDEBUG(D_DLMTRACE, "setting l_data to inode " DFID "(%p)\n", PFID(ll_inode2fid(inode)), inode); ll_set_lock_data(sbi->ll_md_exp, inode, it, NULL); } diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 13b3592..e8696be 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -303,7 +303,7 @@ static int ll_readdir(struct file *filp, struct dir_context *ctx) struct md_op_data *op_data; int rc; - CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p) pos/size %lu/%llu 32bit_api %d\n", + CDEBUG(D_VFSTRACE, "VFS Op:inode=" DFID "(%p) pos/size %lu/%llu 32bit_api %d\n", PFID(ll_inode2fid(inode)), inode, (unsigned long)pos, i_size_read(inode), api32); @@ -419,7 +419,7 @@ static int ll_dir_setdirstripe(struct inode *parent, struct lmv_user_md *lump, if (unlikely(lump->lum_magic != LMV_USER_MAGIC)) return -EINVAL; - CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p) name %s stripe_offset %d, stripe_count: %u\n", + CDEBUG(D_VFSTRACE, "VFS Op:inode=" DFID "(%p) name %s stripe_offset %d, stripe_count: %u\n", PFID(ll_inode2fid(parent)), parent, dirname, (int)lump->lum_stripe_offset, lump->lum_stripe_count); @@ -606,7 +606,7 @@ int ll_dir_getstripe(struct inode *inode, void **plmm, int *plmm_size, rc = md_getattr(sbi->ll_md_exp, op_data, &req); ll_finish_md_op_data(op_data); if (rc < 0) { - CDEBUG(D_INFO, "md_getattr failed on inode "DFID": rc %d\n", + CDEBUG(D_INFO, "md_getattr failed on inode " DFID ": rc %d\n", PFID(ll_inode2fid(inode)), rc); goto out; } @@ -733,7 +733,7 @@ static int ll_ioc_copy_start(struct super_block *sb, struct hsm_copy *copy) iput(inode); if (rc != 0) { CDEBUG(D_HSM, "Could not read file data version of " - DFID" (rc = %d). Archive request (%#llx) could not be done.\n", + DFID " (rc = %d). Archive request (%#llx) could not be done.\n", PFID(©->hc_hai.hai_fid), rc, copy->hc_hai.hai_cookie); hpk.hpk_flags |= HP_FLAG_RETRY; @@ -833,7 +833,7 @@ static int ll_ioc_copy_end(struct super_block *sb, struct hsm_copy *copy) if ((copy->hc_hai.hai_action == HSMA_ARCHIVE) && (copy->hc_data_version != data_version)) { CDEBUG(D_HSM, "File data version mismatched. File content was changed during archiving. " - DFID", start:%#llx current:%#llx\n", + DFID ", start:%#llx current:%#llx\n", PFID(©->hc_hai.hai_fid), copy->hc_data_version, data_version); /* File was changed, send error to cdt. Do not ask for @@ -1037,7 +1037,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) struct obd_ioctl_data *data; int rc = 0; - CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p), cmd=%#x\n", + CDEBUG(D_VFSTRACE, "VFS Op:inode=" DFID "(%p), cmd=%#x\n", PFID(ll_inode2fid(inode)), inode, cmd); /* asm-ppc{,64} declares TCGETS, et. al. as type 't' not 'T' */ diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 67c4b9c..711fbb0 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -316,7 +316,7 @@ int ll_file_release(struct inode *inode, struct file *file) struct ll_inode_info *lli = ll_i2info(inode); int rc; - CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p)\n", + CDEBUG(D_VFSTRACE, "VFS Op:inode=" DFID "(%p)\n", PFID(ll_inode2fid(inode)), inode); if (!is_root_inode(inode)) @@ -494,7 +494,7 @@ int ll_file_open(struct inode *inode, struct file *file) struct ll_file_data *fd; int rc = 0; - CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p), flags %o\n", + CDEBUG(D_VFSTRACE, "VFS Op:inode=" DFID "(%p), flags %o\n", PFID(ll_inode2fid(inode)), inode, file->f_flags); it = file->private_data; /* XXX: compat macro */ @@ -834,7 +834,7 @@ static int ll_md_blocking_lease_ast(struct ldlm_lock *lock, } rc2 = ll_close_inode_openhandle(inode, och, 0, NULL); if (rc2 < 0) - CERROR("%s: error closing file "DFID": %d\n", + CERROR("%s: error closing file " DFID ": %d\n", ll_get_fsname(inode->i_sb, NULL, 0), PFID(&ll_i2info(inode)->lli_fid), rc2); och = NULL; /* och has been freed in ll_close_inode_openhandle() */ @@ -1665,7 +1665,7 @@ int ll_hsm_release(struct inode *inode) int rc; u16 refcheck; - CDEBUG(D_INODE, "%s: Releasing file "DFID".\n", + CDEBUG(D_INODE, "%s: Releasing file " DFID ".\n", ll_get_fsname(inode->i_sb, NULL, 0), PFID(&ll_i2info(inode)->lli_fid)); @@ -1928,7 +1928,7 @@ static inline long ll_lease_type_from_fmode(fmode_t fmode) struct ll_file_data *fd = LUSTRE_FPRIVATE(file); int flags, rc; - CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p),cmd=%x\n", + CDEBUG(D_VFSTRACE, "VFS Op:inode=" DFID "(%p),cmd=%x\n", PFID(ll_inode2fid(inode)), inode, cmd); ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_IOCTL, 1); @@ -2263,7 +2263,7 @@ static loff_t ll_file_seek(struct file *file, loff_t offset, int origin) retval = offset + ((origin == SEEK_END) ? i_size_read(inode) : (origin == SEEK_CUR) ? file->f_pos : 0); - CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p), to=%llu=%#llx(%d)\n", + CDEBUG(D_VFSTRACE, "VFS Op:inode=" DFID "(%p), to=%llu=%#llx(%d)\n", PFID(ll_inode2fid(inode)), inode, retval, retval, origin); ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_LLSEEK, 1); @@ -2360,7 +2360,7 @@ int ll_fsync(struct file *file, loff_t start, loff_t end, int datasync) struct ptlrpc_request *req; int rc, err; - CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p)\n", + CDEBUG(D_VFSTRACE, "VFS Op:inode=" DFID "(%p)\n", PFID(ll_inode2fid(inode)), inode); ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_FSYNC, 1); @@ -2422,7 +2422,7 @@ int ll_fsync(struct file *file, loff_t start, loff_t end, int datasync) int rc; int rc2 = 0; - CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID" file_lock=%p\n", + CDEBUG(D_VFSTRACE, "VFS Op:inode=" DFID " file_lock=%p\n", PFID(ll_inode2fid(inode)), file_lock); ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_FLOCK, 1); @@ -2507,7 +2507,7 @@ int ll_fsync(struct file *file, loff_t start, loff_t end, int datasync) if (IS_ERR(op_data)) return PTR_ERR(op_data); - CDEBUG(D_DLMTRACE, "inode="DFID", pid=%u, flags=%#llx, mode=%u, start=%llu, end=%llu\n", + CDEBUG(D_DLMTRACE, "inode=" DFID ", pid=%u, flags=%#llx, mode=%u, start=%llu, end=%llu\n", PFID(ll_inode2fid(inode)), flock.l_flock.pid, flags, einfo.ei_mode, flock.l_flock.start, flock.l_flock.end); @@ -2582,7 +2582,7 @@ int ll_migrate(struct inode *parent, struct file *file, int mdtidx, struct qstr qstr; int rc; - CDEBUG(D_VFSTRACE, "migrate %s under "DFID" to MDT%d\n", + CDEBUG(D_VFSTRACE, "migrate %s under " DFID " to MDT%d\n", name, PFID(ll_inode2fid(parent)), mdtidx); op_data = ll_prep_md_op_data(NULL, parent, NULL, name, namelen, @@ -2617,7 +2617,7 @@ int ll_migrate(struct inode *parent, struct file *file, int mdtidx, inode_lock(child_inode); op_data->op_fid3 = *ll_inode2fid(child_inode); if (!fid_is_sane(&op_data->op_fid3)) { - CERROR("%s: migrate %s, but fid "DFID" is insane\n", + CERROR("%s: migrate %s, but fid " DFID " is insane\n", ll_get_fsname(parent->i_sb, NULL, 0), name, PFID(&op_data->op_fid3)); rc = -EINVAL; @@ -2629,7 +2629,7 @@ int ll_migrate(struct inode *parent, struct file *file, int mdtidx, goto out_unlock; if (rc == mdtidx) { - CDEBUG(D_INFO, "%s:"DFID" is already on MDT%d.\n", name, + CDEBUG(D_INFO, "%s: " DFID " is already on MDT%d.\n", name, PFID(&op_data->op_fid3), mdtidx); rc = 0; goto out_unlock; @@ -2733,7 +2733,7 @@ int ll_have_md_lock(struct inode *inode, __u64 *bits, return 0; fid = &ll_i2info(inode)->lli_fid; - CDEBUG(D_INFO, "trying to match res "DFID" mode %s\n", PFID(fid), + CDEBUG(D_INFO, "trying to match res " DFID " mode %s\n", PFID(fid), ldlm_lockname[mode]); flags = LDLM_FL_BLOCK_GRANTED | LDLM_FL_CBPENDING | LDLM_FL_TEST_LOCK; @@ -2767,7 +2767,7 @@ enum ldlm_mode ll_take_md_lock(struct inode *inode, __u64 bits, struct lu_fid *fid; fid = &ll_i2info(inode)->lli_fid; - CDEBUG(D_INFO, "trying to match res "DFID"\n", PFID(fid)); + CDEBUG(D_INFO, "trying to match res " DFID "\n", PFID(fid)); return md_lock_match(ll_i2mdexp(inode), flags | LDLM_FL_BLOCK_GRANTED, fid, LDLM_IBITS, &policy, mode, lockh); @@ -2792,7 +2792,7 @@ static int ll_inode_revalidate_fini(struct inode *inode, int rc) return 0; } else if (rc != 0) { CDEBUG_LIMIT((rc == -EACCES || rc == -EIDRM) ? D_INFO : D_ERROR, - "%s: revalidate FID "DFID" error: rc = %d\n", + "%s: revalidate FID " DFID " error: rc = %d\n", ll_get_fsname(inode->i_sb, NULL, 0), PFID(ll_inode2fid(inode)), rc); } @@ -2807,7 +2807,7 @@ static int __ll_inode_revalidate(struct dentry *dentry, __u64 ibits) struct obd_export *exp; int rc = 0; - CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p),name=%pd\n", + CDEBUG(D_VFSTRACE, "VFS Op:inode=" DFID "(%p),name=%pd\n", PFID(ll_inode2fid(inode)), inode, dentry); exp = ll_i2mdexp(inode); @@ -3067,7 +3067,7 @@ int ll_inode_permission(struct inode *inode, int mask) return rc; } - CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p), inode mode %x mask %o\n", + CDEBUG(D_VFSTRACE, "VFS Op:inode=" DFID "(%p), inode mode %x mask %o\n", PFID(ll_inode2fid(inode)), inode, inode->i_mode, mask); /* squash fsuid/fsgid if needed */ @@ -3322,7 +3322,7 @@ static int ll_layout_fetch(struct inode *inode, struct ldlm_lock *lock) int lmmsize; int rc; - CDEBUG(D_INODE, DFID" LVB_READY=%d l_lvb_data=%p l_lvb_len=%d\n", + CDEBUG(D_INODE, DFID " LVB_READY=%d l_lvb_data=%p l_lvb_len=%d\n", PFID(ll_inode2fid(inode)), ldlm_is_lvb_ready(lock), lock->l_lvb_data, lock->l_lvb_len); @@ -3447,7 +3447,7 @@ static int ll_layout_lock_set(struct lustre_handle *lockh, enum ldlm_mode mode, /* wait for IO to complete if it's still being used. */ if (wait_layout) { - CDEBUG(D_INODE, "%s: "DFID"(%p) wait for layout reconf\n", + CDEBUG(D_INODE, "%s: " DFID "(%p) wait for layout reconf\n", ll_get_fsname(inode->i_sb, NULL, 0), PFID(&lli->lli_fid), inode); @@ -3458,7 +3458,7 @@ static int ll_layout_lock_set(struct lustre_handle *lockh, enum ldlm_mode mode, if (rc == 0) rc = -EAGAIN; - CDEBUG(D_INODE, "%s: file="DFID" waiting layout return: %d.\n", + CDEBUG(D_INODE, "%s: file=" DFID " waiting layout return: %d.\n", ll_get_fsname(inode->i_sb, NULL, 0), PFID(&lli->lli_fid), rc); } @@ -3504,7 +3504,7 @@ static int ll_layout_refresh_locked(struct inode *inode) it.it_op = IT_LAYOUT; lockh.cookie = 0ULL; - LDLM_DEBUG_NOLOCK("%s: requeue layout lock for file "DFID"(%p)", + LDLM_DEBUG_NOLOCK("%s: requeue layout lock for file " DFID "(%p)", ll_get_fsname(inode->i_sb, NULL, 0), PFID(&lli->lli_fid), inode); diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index d2a0fab..de09ddf 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -1253,7 +1253,7 @@ static inline void ll_set_lock_data(struct obd_export *exp, struct inode *inode, */ if (it->it_remote_lock_mode) { handle.cookie = it->it_remote_lock_handle; - CDEBUG(D_DLMTRACE, "setting l_data to inode "DFID"%p for remote lock %#llx\n", + CDEBUG(D_DLMTRACE, "setting l_data to inode " DFID "%p for remote lock %#llx\n", PFID(ll_inode2fid(inode)), inode, handle.cookie); md_set_lock_data(exp, &handle, inode, NULL); @@ -1261,7 +1261,7 @@ static inline void ll_set_lock_data(struct obd_export *exp, struct inode *inode, handle.cookie = it->it_lock_handle; - CDEBUG(D_DLMTRACE, "setting l_data to inode "DFID"%p for lock %#llx\n", + CDEBUG(D_DLMTRACE, "setting l_data to inode " DFID "%p for lock %#llx\n", PFID(ll_inode2fid(inode)), inode, handle.cookie); md_set_lock_data(exp, &handle, inode, &it->it_lock_bits); diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index ca5040c..974a05d 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -427,13 +427,13 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt, goto out_lock_cn_cb; } if (!fid_is_sane(&sbi->ll_root_fid)) { - CERROR("%s: Invalid root fid "DFID" during mount\n", + CERROR("%s: Invalid root fid " DFID " during mount\n", sbi->ll_md_exp->exp_obd->obd_name, PFID(&sbi->ll_root_fid)); err = -EINVAL; goto out_lock_cn_cb; } - CDEBUG(D_SUPER, "rootfid "DFID"\n", PFID(&sbi->ll_root_fid)); + CDEBUG(D_SUPER, "rootfid " DFID "\n", PFID(&sbi->ll_root_fid)); sb->s_op = &lustre_super_operations; sb->s_xattr = ll_xattr_handlers; @@ -1079,7 +1079,7 @@ static struct inode *ll_iget_anon_dir(struct super_block *sb, ino = cl_fid_build_ino(fid, sbi->ll_flags & LL_SBI_32BIT_API); inode = iget_locked(sb, ino); if (!inode) { - CERROR("%s: failed get simple inode "DFID": rc = -ENOENT\n", + CERROR("%s: failed get simple inode " DFID ": rc = -ENOENT\n", ll_get_fsname(sb, NULL, 0), PFID(fid)); return ERR_PTR(-ENOENT); } @@ -1090,7 +1090,7 @@ static struct inode *ll_iget_anon_dir(struct super_block *sb, inode->i_mode = (inode->i_mode & ~S_IFMT) | (body->mbo_mode & S_IFMT); - LASSERTF(S_ISDIR(inode->i_mode), "Not slave inode "DFID"\n", + LASSERTF(S_ISDIR(inode->i_mode), "Not slave inode " DFID "\n", PFID(fid)); LTIME_S(inode->i_mtime) = 0; @@ -1106,7 +1106,7 @@ static struct inode *ll_iget_anon_dir(struct super_block *sb, LASSERT(lsm); /* master object FID */ lli->lli_pfid = body->mbo_fid1; - CDEBUG(D_INODE, "lli %p slave "DFID" master "DFID"\n", + CDEBUG(D_INODE, "lli %p slave " DFID " master " DFID "\n", lli, PFID(fid), PFID(&lli->lli_pfid)); unlock_new_inode(inode); } @@ -1174,7 +1174,7 @@ static int ll_update_lsm_md(struct inode *inode, struct lustre_md *md) int rc; LASSERT(S_ISDIR(inode->i_mode)); - CDEBUG(D_INODE, "update lsm %p of "DFID"\n", lli->lli_lsm_md, + CDEBUG(D_INODE, "update lsm %p of " DFID "\n", lli->lli_lsm_md, PFID(ll_inode2fid(inode))); /* no striped information from request. */ @@ -1187,7 +1187,7 @@ static int ll_update_lsm_md(struct inode *inode, struct lustre_md *md) * migration is done, the temporay MIGRATE layout has * been removed */ - CDEBUG(D_INODE, DFID" finish migration.\n", + CDEBUG(D_INODE, DFID " finish migration.\n", PFID(ll_inode2fid(inode))); lmv_free_memmd(lli->lli_lsm_md); lli->lli_lsm_md = NULL; @@ -1241,7 +1241,7 @@ static int ll_update_lsm_md(struct inode *inode, struct lustre_md *md) kfree(attr); - CDEBUG(D_INODE, "Set lsm %p magic %x to "DFID"\n", lsm, + CDEBUG(D_INODE, "Set lsm %p magic %x to " DFID "\n", lsm, lsm->lsm_md_magic, PFID(ll_inode2fid(inode))); return 0; } @@ -1251,7 +1251,7 @@ static int ll_update_lsm_md(struct inode *inode, struct lustre_md *md) struct lmv_stripe_md *old_lsm = lli->lli_lsm_md; int idx; - CERROR("%s: inode "DFID"(%p)'s lmv layout mismatch (%p)/(%p) magic:0x%x/0x%x stripe count: %d/%d master_mdt: %d/%d hash_type:0x%x/0x%x layout: 0x%x/0x%x pool:%s/%s\n", + CERROR("%s: inode " DFID "(%p)'s lmv layout mismatch (%p)/(%p) magic:0x%x/0x%x stripe count: %d/%d master_mdt: %d/%d hash_type:0x%x/0x%x layout: 0x%x/0x%x pool:%s/%s\n", ll_get_fsname(inode->i_sb, NULL, 0), PFID(&lli->lli_fid), inode, lsm, old_lsm, lsm->lsm_md_magic, old_lsm->lsm_md_magic, @@ -1266,13 +1266,13 @@ static int ll_update_lsm_md(struct inode *inode, struct lustre_md *md) old_lsm->lsm_md_pool_name); for (idx = 0; idx < old_lsm->lsm_md_stripe_count; idx++) { - CERROR("%s: sub FIDs in old lsm idx %d, old: "DFID"\n", + CERROR("%s: sub FIDs in old lsm idx %d, old: " DFID "\n", ll_get_fsname(inode->i_sb, NULL, 0), idx, PFID(&old_lsm->lsm_md_oinfo[idx].lmo_fid)); } for (idx = 0; idx < lsm->lsm_md_stripe_count; idx++) { - CERROR("%s: sub FIDs in new lsm idx %d, new: "DFID"\n", + CERROR("%s: sub FIDs in new lsm idx %d, new: " DFID "\n", ll_get_fsname(inode->i_sb, NULL, 0), idx, PFID(&lsm->lsm_md_oinfo[idx].lmo_fid)); } @@ -1288,7 +1288,7 @@ void ll_clear_inode(struct inode *inode) struct ll_inode_info *lli = ll_i2info(inode); struct ll_sb_info *sbi = ll_i2sbi(inode); - CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p)\n", + CDEBUG(D_VFSTRACE, "VFS Op:inode=" DFID "(%p)\n", PFID(ll_inode2fid(inode)), inode); if (S_ISDIR(inode->i_mode)) { @@ -1421,7 +1421,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import) struct md_op_data *op_data = NULL; int rc = 0; - CDEBUG(D_VFSTRACE, "%s: setattr inode "DFID"(%p) from %llu to %llu, valid %x, hsm_import %d\n", + CDEBUG(D_VFSTRACE, "%s: setattr inode " DFID "(%p) from %llu to %llu, valid %x, hsm_import %d\n", ll_get_fsname(inode->i_sb, NULL, 0), PFID(&lli->lli_fid), inode, i_size_read(inode), attr->ia_size, attr->ia_valid, hsm_import); @@ -1436,7 +1436,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import) * needs another check in addition to the VFS check above. */ if (attr->ia_size > ll_file_maxbytes(inode)) { - CDEBUG(D_INODE, "file "DFID" too large %llu > %llu\n", + CDEBUG(D_INODE, "file " DFID " too large %llu > %llu\n", PFID(&lli->lli_fid), attr->ia_size, ll_file_maxbytes(inode)); return -EFBIG; @@ -1785,7 +1785,7 @@ int ll_update_inode(struct inode *inode, struct lustre_md *md) /* FID shouldn't be changed! */ if (fid_is_sane(&lli->lli_fid)) { LASSERTF(lu_fid_eq(&lli->lli_fid, &body->mbo_fid1), - "Trying to change FID "DFID" to the "DFID", inode "DFID"(%p)\n", + "Trying to change FID " DFID " to the " DFID ", inode " DFID "(%p)\n", PFID(&lli->lli_fid), PFID(&body->mbo_fid1), PFID(ll_inode2fid(inode)), inode); } else { @@ -1820,7 +1820,7 @@ int ll_read_inode2(struct inode *inode, void *opaque) struct ll_inode_info *lli = ll_i2info(inode); int rc; - CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p)\n", + CDEBUG(D_VFSTRACE, "VFS Op:inode=" DFID "(%p)\n", PFID(&lli->lli_fid), inode); /* Core attributes from the MDS first. This is a new inode, and @@ -1902,7 +1902,7 @@ int ll_iocontrol(struct inode *inode, struct file *file, rc = md_getattr(sbi->ll_md_exp, op_data, &req); ll_finish_md_op_data(op_data); if (rc) { - CERROR("%s: failure inode "DFID": rc = %d\n", + CERROR("%s: failure inode " DFID ": rc = %d\n", sbi->ll_md_exp->exp_obd->obd_name, PFID(ll_inode2fid(inode)), rc); return -abs(rc); diff --git a/drivers/staging/lustre/lustre/llite/llite_mmap.c b/drivers/staging/lustre/lustre/llite/llite_mmap.c index cbbfdaf..ccc7ae1 100644 --- a/drivers/staging/lustre/lustre/llite/llite_mmap.c +++ b/drivers/staging/lustre/lustre/llite/llite_mmap.c @@ -378,7 +378,7 @@ static int ll_page_mkwrite(struct vm_fault *vmf) if (!printed && ++count > 16) { const struct dentry *de = vma->vm_file->f_path.dentry; - CWARN("app(%s): the page %lu of file "DFID" is under heavy contention\n", + CWARN("app(%s): the page %lu of file " DFID " is under heavy contention\n", current->comm, vmf->pgoff, PFID(ll_inode2fid(de->d_inode))); printed = true; diff --git a/drivers/staging/lustre/lustre/llite/llite_nfs.c b/drivers/staging/lustre/lustre/llite/llite_nfs.c index 49a930f..e50c637 100644 --- a/drivers/staging/lustre/lustre/llite/llite_nfs.c +++ b/drivers/staging/lustre/lustre/llite/llite_nfs.c @@ -84,7 +84,7 @@ struct inode *search_inode_for_lustre(struct super_block *sb, struct md_op_data *op_data; int rc; - CDEBUG(D_INFO, "searching inode for:(%lu,"DFID")\n", hash, PFID(fid)); + CDEBUG(D_INFO, "searching inode for:(%lu," DFID ")\n", hash, PFID(fid)); inode = ilookup5(sb, hash, ll_test_inode_by_fid, (void *)fid); if (inode) @@ -109,7 +109,7 @@ struct inode *search_inode_for_lustre(struct super_block *sb, rc = md_getattr(sbi->ll_md_exp, op_data, &req); kfree(op_data); if (rc) { - CDEBUG(D_INFO, "can't get object attrs, fid "DFID", rc %d\n", + CDEBUG(D_INFO, "can't get object attrs, fid " DFID ", rc %d\n", PFID(fid), rc); return ERR_PTR(rc); } @@ -195,7 +195,7 @@ static int ll_encode_fh(struct inode *inode, __u32 *fh, int *plen, int fileid_len = sizeof(struct lustre_nfs_fid) / 4; struct lustre_nfs_fid *nfs_fid = (void *)fh; - CDEBUG(D_INFO, "%s: encoding for ("DFID") maxlen=%d minlen=%d\n", + CDEBUG(D_INFO, "%s: encoding for (" DFID ") maxlen=%d minlen=%d\n", ll_get_fsname(inode->i_sb, NULL, 0), PFID(ll_inode2fid(inode)), *plen, fileid_len); @@ -312,7 +312,7 @@ int ll_dir_get_parent_fid(struct inode *dir, struct lu_fid *parent_fid) sbi = ll_s2sbi(dir->i_sb); - CDEBUG(D_INFO, "%s: getting parent for ("DFID")\n", + CDEBUG(D_INFO, "%s: getting parent for (" DFID ")\n", ll_get_fsname(dir->i_sb, NULL, 0), PFID(ll_inode2fid(dir))); @@ -329,7 +329,7 @@ int ll_dir_get_parent_fid(struct inode *dir, struct lu_fid *parent_fid) rc = md_getattr_name(sbi->ll_md_exp, op_data, &req); ll_finish_md_op_data(op_data); if (rc) { - CERROR("%s: failure inode "DFID" get parent: rc = %d\n", + CERROR("%s: failure inode " DFID " get parent: rc = %d\n", ll_get_fsname(dir->i_sb, NULL, 0), PFID(ll_inode2fid(dir)), rc); return rc; diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index d583696..9f118a1 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -86,7 +86,7 @@ static int ll_set_inode(struct inode *inode, void *opaque) inode->i_mode = (inode->i_mode & ~S_IFMT) | (body->mbo_mode & S_IFMT); if (unlikely(inode->i_mode == 0)) { - CERROR("Invalid inode "DFID" type\n", PFID(&lli->lli_fid)); + CERROR("Invalid inode " DFID " type\n", PFID(&lli->lli_fid)); return -EINVAL; } @@ -134,7 +134,7 @@ struct inode *ll_iget(struct super_block *sb, ino_t hash, } } else if (!(inode->i_state & (I_FREEING | I_CLEAR))) { rc = ll_update_inode(inode, md); - CDEBUG(D_VFSTRACE, "got inode: "DFID"(%p): rc = %d\n", + CDEBUG(D_VFSTRACE, "got inode: " DFID "(%p): rc = %d\n", PFID(&md->body->mbo_fid1), inode, rc); if (rc) { if (S_ISDIR(inode->i_mode)) @@ -205,7 +205,7 @@ int ll_md_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, if (!fid_res_name_eq(ll_inode2fid(inode), &lock->l_resource->lr_name)) { - LDLM_ERROR(lock, "data mismatch with object "DFID"(%p)", + LDLM_ERROR(lock, "data mismatch with object " DFID "(%p)", PFID(ll_inode2fid(inode)), inode); LBUG(); } @@ -257,7 +257,7 @@ int ll_md_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, rc = ll_layout_conf(inode, &conf); if (rc < 0) CDEBUG(D_INODE, "cannot invalidate layout of " - DFID": rc = %d\n", + DFID ": rc = %d\n", PFID(ll_inode2fid(inode)), rc); } @@ -274,7 +274,7 @@ int ll_md_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, if ((bits & MDS_INODELOCK_UPDATE) && S_ISDIR(inode->i_mode)) { struct ll_inode_info *lli = ll_i2info(inode); - CDEBUG(D_INODE, "invalidating inode "DFID" lli = %p, pfid = "DFID"\n", + CDEBUG(D_INODE, "invalidating inode " DFID " lli = %p, pfid = " DFID "\n", PFID(ll_inode2fid(inode)), lli, PFID(&lli->lli_pfid)); @@ -290,7 +290,7 @@ int ll_md_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, * we have to invalidate the negative children * on master inode */ - CDEBUG(D_INODE, "Invalidate s"DFID" m"DFID"\n", + CDEBUG(D_INODE, "Invalidate s" DFID " m" DFID "\n", PFID(ll_inode2fid(inode)), PFID(&lli->lli_pfid)); @@ -542,7 +542,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry, if (dentry->d_name.len > ll_i2sbi(parent)->ll_namelen) return ERR_PTR(-ENAMETOOLONG); - CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir="DFID"(%p),intent=%s\n", + CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir=" DFID "(%p),intent=%s\n", dentry, PFID(ll_inode2fid(parent)), parent, LL_IT2STR(it)); if (d_mountpoint(dentry)) @@ -650,7 +650,7 @@ static struct dentry *ll_lookup_nd(struct inode *parent, struct dentry *dentry, struct lookup_intent *itp, it = { .it_op = IT_GETATTR }; struct dentry *de; - CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir="DFID"(%p),flags=%u\n", + CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir=" DFID "(%p),flags=%u\n", dentry, PFID(ll_inode2fid(parent)), parent, flags); /* Optimize away (CREATE && !OPEN). Let .create handle the race. @@ -685,7 +685,7 @@ static int ll_atomic_open(struct inode *dir, struct dentry *dentry, struct dentry *de; int rc = 0; - CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir="DFID"(%p),file %p,open_flags %x,mode %x opened %d\n", + CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir=" DFID "(%p),file %p,open_flags %x,mode %x opened %d\n", dentry, PFID(ll_inode2fid(dir)), dir, file, open_flags, mode, *opened); @@ -792,7 +792,7 @@ static struct inode *ll_create_node(struct inode *dir, struct lookup_intent *it) * lock on the inode. Since we finally have an inode pointer, * stuff it in the lock. */ - CDEBUG(D_DLMTRACE, "setting l_ast_data to inode "DFID"(%p)\n", + CDEBUG(D_DLMTRACE, "setting l_ast_data to inode " DFID "(%p)\n", PFID(ll_inode2fid(dir)), inode); ll_set_lock_data(sbi->ll_md_exp, inode, it, NULL); out: @@ -820,7 +820,7 @@ static int ll_create_it(struct inode *dir, struct dentry *dentry, struct inode *inode; int rc = 0; - CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir="DFID"(%p), intent=%s\n", + CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir=" DFID "(%p), intent=%s\n", dentry, PFID(ll_inode2fid(dir)), dir, LL_IT2STR(it)); rc = it_open_error(DISP_OPEN_CREATE, it); @@ -844,7 +844,7 @@ void ll_update_times(struct ptlrpc_request *request, struct inode *inode) LASSERT(body); if (body->mbo_valid & OBD_MD_FLMTIME && body->mbo_mtime > LTIME_S(inode->i_mtime)) { - CDEBUG(D_INODE, "setting fid "DFID" mtime from %lu to %llu\n", + CDEBUG(D_INODE, "setting fid " DFID " mtime from %lu to %llu\n", PFID(ll_inode2fid(inode)), LTIME_S(inode->i_mtime), body->mbo_mtime); LTIME_S(inode->i_mtime) = body->mbo_mtime; @@ -942,7 +942,7 @@ static int ll_mknod(struct inode *dir, struct dentry *dchild, { int err; - CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir="DFID"(%p) mode %o dev %x\n", + CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir=" DFID "(%p) mode %o dev %x\n", dchild, PFID(ll_inode2fid(dir)), dir, mode, old_encode_dev(rdev)); @@ -982,7 +982,7 @@ static int ll_create_nd(struct inode *dir, struct dentry *dentry, { int rc; - CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir="DFID"(%p), flags=%u, excl=%d\n", + CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir=" DFID "(%p), flags=%u, excl=%d\n", dentry, PFID(ll_inode2fid(dir)), dir, mode, want_excl); rc = ll_mknod(dir, dentry, mode, 0); @@ -1032,7 +1032,7 @@ static int ll_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) { int err; - CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir"DFID"(%p)\n", + CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir" DFID "(%p)\n", dentry, PFID(ll_inode2fid(dir)), dir); if (!IS_POSIXACL(dir) || !exp_connect_umask(ll_i2mdexp(dir))) @@ -1052,7 +1052,7 @@ static int ll_rmdir(struct inode *dir, struct dentry *dchild) struct md_op_data *op_data; int rc; - CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir="DFID"(%p)\n", + CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir=" DFID "(%p)\n", dchild, PFID(ll_inode2fid(dir)), dir); op_data = ll_prep_md_op_data(NULL, dir, NULL, @@ -1082,7 +1082,7 @@ static int ll_symlink(struct inode *dir, struct dentry *dentry, { int err; - CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir="DFID"(%p),target=%.*s\n", + CDEBUG(D_VFSTRACE, "VFS Op:name=%pd, dir=" DFID "(%p),target=%.*s\n", dentry, PFID(ll_inode2fid(dir)), dir, 3000, oldname); err = ll_new_node(dir, dentry, oldname, S_IFLNK | 0777, @@ -1103,7 +1103,7 @@ static int ll_link(struct dentry *old_dentry, struct inode *dir, struct md_op_data *op_data; int err; - CDEBUG(D_VFSTRACE, "VFS Op: inode="DFID"(%p), dir="DFID"(%p), target=%pd\n", + CDEBUG(D_VFSTRACE, "VFS Op: inode=" DFID "(%p), dir=" DFID "(%p), target=%pd\n", PFID(ll_inode2fid(src)), src, PFID(ll_inode2fid(dir)), dir, new_dentry); @@ -1138,7 +1138,7 @@ static int ll_rename(struct inode *src, struct dentry *src_dchild, return -EINVAL; CDEBUG(D_VFSTRACE, - "VFS Op:oldname=%pd, src_dir="DFID"(%p), newname=%pd, tgt_dir="DFID"(%p)\n", + "VFS Op:oldname=%pd, src_dir=" DFID "(%p), newname=%pd, tgt_dir=" DFID "(%p)\n", src_dchild, PFID(ll_inode2fid(src)), src, tgt_dchild, PFID(ll_inode2fid(tgt)), tgt); diff --git a/drivers/staging/lustre/lustre/llite/rw26.c b/drivers/staging/lustre/lustre/llite/rw26.c index 420f296..22dc6a5 100644 --- a/drivers/staging/lustre/lustre/llite/rw26.c +++ b/drivers/staging/lustre/lustre/llite/rw26.c @@ -327,7 +327,7 @@ static ssize_t ll_direct_IO_26(struct kiocb *iocb, struct iov_iter *iter) if ((file_offset & ~PAGE_MASK) || (count & ~PAGE_MASK)) return -EINVAL; - CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p), size=%zd (max %lu), offset=%lld=%llx, pages %zd (max %lu)\n", + CDEBUG(D_VFSTRACE, "VFS Op:inode=" DFID "(%p), size=%zd (max %lu), offset=%lld=%llx, pages %zd (max %lu)\n", PFID(ll_inode2fid(inode)), inode, count, MAX_DIO_SIZE, file_offset, file_offset, count >> PAGE_SHIFT, MAX_DIO_SIZE >> PAGE_SHIFT); diff --git a/drivers/staging/lustre/lustre/llite/statahead.c b/drivers/staging/lustre/lustre/llite/statahead.c index fb7c315..9bbca01 100644 --- a/drivers/staging/lustre/lustre/llite/statahead.c +++ b/drivers/staging/lustre/lustre/llite/statahead.c @@ -528,7 +528,7 @@ static void ll_agl_trigger(struct inode *inode, struct ll_statahead_info *sai) } CDEBUG(D_READA, "Handling (init) async glimpse: inode = " - DFID", idx = %llu\n", PFID(&lli->lli_fid), index); + DFID ", idx = %llu\n", PFID(&lli->lli_fid), index); cl_agl(inode); lli->lli_agl_index = 0; @@ -536,7 +536,7 @@ static void ll_agl_trigger(struct inode *inode, struct ll_statahead_info *sai) up_write(&lli->lli_glimpse_sem); CDEBUG(D_READA, "Handled (init) async glimpse: inode= " - DFID", idx = %llu, rc = %d\n", + DFID ", idx = %llu, rc = %d\n", PFID(&lli->lli_fid), index, rc); iput(inode); @@ -1008,7 +1008,7 @@ static int ll_statahead_thread(void *arg) sai->sai_in_readpage = 0; if (IS_ERR(page)) { rc = PTR_ERR(page); - CDEBUG(D_READA, "error reading dir "DFID" at %llu/%llu: opendir_pid = %u: rc = %d\n", + CDEBUG(D_READA, "error reading dir " DFID " at %llu/%llu: opendir_pid = %u: rc = %d\n", PFID(ll_inode2fid(dir)), pos, sai->sai_index, lli->lli_opendir_pid, rc); break; @@ -1105,7 +1105,7 @@ static int ll_statahead_thread(void *arg) if (sa_low_hit(sai)) { rc = -EFAULT; atomic_inc(&sbi->ll_sa_wrong); - CDEBUG(D_READA, "Statahead for dir "DFID" hit ratio too low: hit/miss %llu/%llu, sent/replied %llu/%llu, stopping statahead thread: pid %d\n", + CDEBUG(D_READA, "Statahead for dir " DFID " hit ratio too low: hit/miss %llu/%llu, sent/replied %llu/%llu, stopping statahead thread: pid %d\n", PFID(&lli->lli_fid), sai->sai_hit, sai->sai_miss, sai->sai_sent, sai->sai_replied, current_pid()); @@ -1211,7 +1211,7 @@ void ll_deauthorize_statahead(struct inode *dir, void *key) LASSERT(lli->lli_opendir_key == key); LASSERT(lli->lli_opendir_pid); - CDEBUG(D_READA, "deauthorize statahead for "DFID"\n", + CDEBUG(D_READA, "deauthorize statahead for " DFID "\n", PFID(&lli->lli_fid)); spin_lock(&lli->lli_sa_lock); @@ -1274,7 +1274,7 @@ static int is_first_dirent(struct inode *dir, struct dentry *dentry) struct ll_inode_info *lli = ll_i2info(dir); rc = PTR_ERR(page); - CERROR("%s: error reading dir "DFID" at %llu: opendir_pid = %u : rc = %d\n", + CERROR("%s: error reading dir " DFID " at %llu: opendir_pid = %u : rc = %d\n", ll_get_fsname(dir->i_sb, NULL, 0), PFID(ll_inode2fid(dir)), pos, lli->lli_opendir_pid, rc); @@ -1471,7 +1471,7 @@ static int revalidate_statahead_dentry(struct inode *dir, } else if ((*dentryp)->d_inode != inode) { /* revalidate, but inode is recreated */ CDEBUG(D_READA, - "%s: stale dentry %pd inode "DFID", statahead inode "DFID"\n", + "%s: stale dentry %pd inode " DFID ", statahead inode " DFID "\n", ll_get_fsname((*dentryp)->d_inode->i_sb, NULL, 0), *dentryp, diff --git a/drivers/staging/lustre/lustre/llite/symlink.c b/drivers/staging/lustre/lustre/llite/symlink.c index 60aac42..3cd3348 100644 --- a/drivers/staging/lustre/lustre/llite/symlink.c +++ b/drivers/staging/lustre/lustre/llite/symlink.c @@ -72,7 +72,7 @@ static int ll_readlink_internal(struct inode *inode, ll_finish_md_op_data(op_data); if (rc) { if (rc != -ENOENT) - CERROR("%s: inode "DFID": rc = %d\n", + CERROR("%s: inode " DFID ": rc = %d\n", ll_get_fsname(inode->i_sb, NULL, 0), PFID(ll_inode2fid(inode)), rc); goto failed; @@ -87,7 +87,7 @@ static int ll_readlink_internal(struct inode *inode, LASSERT(symlen != 0); if (body->mbo_eadatasize != symlen) { - CERROR("%s: inode "DFID": symlink length %d not expected %d\n", + CERROR("%s: inode " DFID ": symlink length %d not expected %d\n", ll_get_fsname(inode->i_sb, NULL, 0), PFID(ll_inode2fid(inode)), body->mbo_eadatasize - 1, symlen - 1); diff --git a/drivers/staging/lustre/lustre/llite/vvp_io.c b/drivers/staging/lustre/lustre/llite/vvp_io.c index aa31bc0..c5ba265 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_io.c +++ b/drivers/staging/lustre/lustre/llite/vvp_io.c @@ -325,7 +325,7 @@ static void vvp_io_fini(const struct lu_env *env, const struct cl_io_slice *ios) io->ci_need_restart = vio->vui_layout_gen != gen; if (io->ci_need_restart) { CDEBUG(D_VFSTRACE, - DFID" layout changed from %d to %d.\n", + DFID " layout changed from %d to %d.\n", PFID(lu_object_fid(&obj->co_lu)), vio->vui_layout_gen, gen); /* today successful restore is the only possible case */ diff --git a/drivers/staging/lustre/lustre/llite/vvp_object.c b/drivers/staging/lustre/lustre/llite/vvp_object.c index 8e18cf8..9bfd72e 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_object.c +++ b/drivers/staging/lustre/lustre/llite/vvp_object.c @@ -70,7 +70,7 @@ static int vvp_object_print(const struct lu_env *env, void *cookie, atomic_read(&obj->vob_mmap_cnt), inode); if (inode) { lli = ll_i2info(inode); - (*p)(env, cookie, "%lu/%u %o %u %d %p "DFID, + (*p)(env, cookie, "%lu/%u %o %u %d %p " DFID, inode->i_ino, inode->i_generation, inode->i_mode, inode->i_nlink, atomic_read(&inode->i_count), lli->lli_clob, PFID(&lli->lli_fid)); diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index 6187bff..bd30abd 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -195,7 +195,7 @@ static int ll_xattr_set(const struct xattr_handler *handler, LASSERT(inode); LASSERT(name); - CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p), xattr %s\n", + CDEBUG(D_VFSTRACE, "VFS Op:inode=" DFID "(%p), xattr %s\n", PFID(ll_inode2fid(inode)), inode, name); if (!strcmp(name, "lov")) { @@ -370,7 +370,7 @@ static int ll_xattr_get_common(const struct xattr_handler *handler, #endif int rc; - CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p)\n", + CDEBUG(D_VFSTRACE, "VFS Op:inode=" DFID "(%p)\n", PFID(ll_inode2fid(inode)), inode); ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_GETXATTR, 1); @@ -523,7 +523,7 @@ ssize_t ll_listxattr(struct dentry *dentry, char *buffer, size_t size) LASSERT(inode); - CDEBUG(D_VFSTRACE, "VFS Op:inode="DFID"(%p)\n", + CDEBUG(D_VFSTRACE, "VFS Op:inode=" DFID "(%p)\n", PFID(ll_inode2fid(inode)), inode); ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_LISTXATTR, 1); diff --git a/drivers/staging/lustre/lustre/llite/xattr_cache.c b/drivers/staging/lustre/lustre/llite/xattr_cache.c index 38f75f6..82cf421 100644 --- a/drivers/staging/lustre/lustre/llite/xattr_cache.c +++ b/drivers/staging/lustre/lustre/llite/xattr_cache.c @@ -311,7 +311,7 @@ static int ll_xattr_find_get_lock(struct inode *inode, if (rc < 0) { CDEBUG(D_CACHE, - "md_intent_lock failed with %d for fid "DFID"\n", + "md_intent_lock failed with %d for fid " DFID "\n", rc, PFID(ll_inode2fid(inode))); mutex_unlock(&lli->lli_xattrs_enq_lock); return rc; @@ -365,7 +365,7 @@ static int ll_xattr_cache_refill(struct inode *inode, struct lookup_intent *oit) } if (oit->it_status < 0) { - CDEBUG(D_CACHE, "getxattr intent returned %d for fid "DFID"\n", + CDEBUG(D_CACHE, "getxattr intent returned %d for fid " DFID "\n", oit->it_status, PFID(ll_inode2fid(inode))); rc = oit->it_status; /* xattr data is so large that we don't want to cache it */ diff --git a/drivers/staging/lustre/lustre/lmv/lmv_fld.c b/drivers/staging/lustre/lustre/lmv/lmv_fld.c index a5265f9..6f8070f 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_fld.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_fld.c @@ -70,7 +70,7 @@ int lmv_fld_lookup(struct lmv_obd *lmv, const struct lu_fid *fid, u32 *mds) return rc; } - CDEBUG(D_INODE, "FLD lookup got mds #%x for fid="DFID"\n", + CDEBUG(D_INODE, "FLD lookup got mds #%x for fid=" DFID "\n", *mds, PFID(fid)); if (*mds >= lmv->desc.ld_tgt_count) { diff --git a/drivers/staging/lustre/lustre/lmv/lmv_intent.c b/drivers/staging/lustre/lustre/lmv/lmv_intent.c index aa42066..f49db6c 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_intent.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_intent.c @@ -213,7 +213,7 @@ int lmv_revalidate_slaves(struct obd_export *exp, lockh = (struct lustre_handle *)&it.it_lock_handle; if (rc > 0 && !req) { /* slave inode is still valid */ - CDEBUG(D_INODE, "slave "DFID" is still valid.\n", + CDEBUG(D_INODE, "slave " DFID " is still valid.\n", PFID(&fid)); rc = 0; } else { @@ -435,7 +435,7 @@ static int lmv_intent_lookup(struct obd_export *exp, if (IS_ERR(tgt)) return PTR_ERR(tgt); - CDEBUG(D_INODE, "Try other stripes " DFID"\n", + CDEBUG(D_INODE, "Try other stripes " DFID "\n", PFID(&oinfo->lmo_fid)); op_data->op_fid1 = oinfo->lmo_fid; @@ -479,7 +479,7 @@ int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data, LASSERT(fid_is_sane(&op_data->op_fid1)); - CDEBUG(D_INODE, "INTENT LOCK '%s' for "DFID" '%*s' on "DFID"\n", + CDEBUG(D_INODE, "INTENT LOCK '%s' for " DFID " '%*s' on " DFID "\n", LL_IT2STR(it), PFID(&op_data->op_fid2), (int)op_data->op_namelen, op_data->op_name, PFID(&op_data->op_fid1)); diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index b222dfa..63a10a9 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -673,7 +673,7 @@ static int lmv_fid2path(struct obd_export *exp, int len, void *karg, *ptr = '/'; } - CDEBUG(D_INFO, "%s: get path %s "DFID" rec: %llu ln: %u\n", + CDEBUG(D_INFO, "%s: get path %s " DFID " rec: %llu ln: %u\n", tgt->ltd_exp->exp_obd->obd_name, gf->gf_path, PFID(&gf->gf_fid), gf->gf_recno, gf->gf_linkno); @@ -693,7 +693,7 @@ static int lmv_fid2path(struct obd_export *exp, int len, void *karg, } if (!fid_is_sane(&gf->gf_fid)) { - CERROR("%s: invalid FID "DFID": rc = %d\n", + CERROR("%s: invalid FID " DFID ": rc = %d\n", tgt->ltd_exp->exp_obd->obd_name, PFID(&gf->gf_fid), -EINVAL); rc = -EINVAL; @@ -1508,7 +1508,7 @@ static int lmv_null_inode(struct obd_export *exp, const struct lu_fid *fid) if (rc) return rc; - CDEBUG(D_INODE, "CBDATA for "DFID"\n", PFID(fid)); + CDEBUG(D_INODE, "CBDATA for " DFID "\n", PFID(fid)); /* * With DNE every object can have two locks in different namespaces: @@ -1540,7 +1540,7 @@ static int lmv_close(struct obd_export *exp, struct md_op_data *op_data, if (IS_ERR(tgt)) return PTR_ERR(tgt); - CDEBUG(D_INODE, "CLOSE "DFID"\n", PFID(&op_data->op_fid1)); + CDEBUG(D_INODE, "CLOSE " DFID "\n", PFID(&op_data->op_fid1)); return md_close(tgt->ltd_exp, op_data, mod, request); } @@ -1672,7 +1672,7 @@ static int lmv_create(struct obd_export *exp, struct md_op_data *op_data, if (IS_ERR(tgt)) return PTR_ERR(tgt); - CDEBUG(D_INODE, "CREATE name '%.*s' on "DFID" -> mds #%x\n", + CDEBUG(D_INODE, "CREATE name '%.*s' on " DFID " -> mds #%x\n", (int)op_data->op_namelen, op_data->op_name, PFID(&op_data->op_fid1), op_data->op_mds); @@ -1694,7 +1694,7 @@ static int lmv_create(struct obd_export *exp, struct md_op_data *op_data, CDEBUG(D_CONFIG, "Server doesn't support striped dirs\n"); } - CDEBUG(D_INODE, "CREATE obj "DFID" -> mds #%x\n", + CDEBUG(D_INODE, "CREATE obj " DFID " -> mds #%x\n", PFID(&op_data->op_fid1), op_data->op_mds); op_data->op_flags |= MF_MDC_CANCEL_FID1; @@ -1704,7 +1704,7 @@ static int lmv_create(struct obd_export *exp, struct md_op_data *op_data, if (rc == 0) { if (!*request) return rc; - CDEBUG(D_INODE, "Created - "DFID"\n", PFID(&op_data->op_fid2)); + CDEBUG(D_INODE, "Created - " DFID "\n", PFID(&op_data->op_fid2)); } return rc; } @@ -1724,7 +1724,7 @@ static int lmv_create(struct obd_export *exp, struct md_op_data *op_data, if (rc) return rc; - CDEBUG(D_INODE, "ENQUEUE '%s' on "DFID"\n", + CDEBUG(D_INODE, "ENQUEUE '%s' on " DFID "\n", LL_IT2STR(it), PFID(&op_data->op_fid1)); tgt = lmv_locate_mds(lmv, op_data, &op_data->op_fid1); @@ -1769,7 +1769,7 @@ static int lmv_create(struct obd_export *exp, struct md_op_data *op_data, if (body->mbo_valid & OBD_MD_MDS) { struct lu_fid rid = body->mbo_fid1; - CDEBUG(D_INODE, "Request attrs for "DFID"\n", + CDEBUG(D_INODE, "Request attrs for " DFID "\n", PFID(&rid)); tgt = lmv_find_target(lmv, &rid); @@ -1818,13 +1818,13 @@ static int lmv_early_cancel(struct obd_export *exp, struct lmv_tgt_desc *tgt, } if (tgt->ltd_idx != op_tgt) { - CDEBUG(D_INODE, "EARLY_CANCEL on "DFID"\n", PFID(fid)); + CDEBUG(D_INODE, "EARLY_CANCEL on " DFID "\n", PFID(fid)); policy.l_inodebits.bits = bits; rc = md_cancel_unused(tgt->ltd_exp, fid, &policy, mode, LCF_ASYNC, NULL); } else { CDEBUG(D_INODE, - "EARLY_CANCEL skip operation target %d on "DFID"\n", + "EARLY_CANCEL skip operation target %d on " DFID "\n", op_tgt, PFID(fid)); op_data->op_flags |= flag; rc = 0; @@ -1851,7 +1851,7 @@ static int lmv_link(struct obd_export *exp, struct md_op_data *op_data, LASSERT(op_data->op_namelen != 0); - CDEBUG(D_INODE, "LINK "DFID":%*s to "DFID"\n", + CDEBUG(D_INODE, "LINK " DFID ":%*s to " DFID "\n", PFID(&op_data->op_fid2), (int)op_data->op_namelen, op_data->op_name, PFID(&op_data->op_fid1)); @@ -1901,7 +1901,7 @@ static int lmv_rename(struct obd_export *exp, struct md_op_data *op_data, LASSERT(oldlen != 0); - CDEBUG(D_INODE, "RENAME %.*s in "DFID":%d to %.*s in "DFID":%d\n", + CDEBUG(D_INODE, "RENAME %.*s in " DFID ":%d to %.*s in " DFID ":%d\n", (int)oldlen, old, PFID(&op_data->op_fid1), op_data->op_mea1 ? op_data->op_mea1->lsm_md_stripe_count : 0, (int)newlen, new, PFID(&op_data->op_fid2), @@ -1916,7 +1916,7 @@ static int lmv_rename(struct obd_export *exp, struct md_op_data *op_data, op_data->op_cap = cfs_curproc_cap_pack(); if (op_data->op_cli_flags & CLI_MIGRATE) { - LASSERTF(fid_is_sane(&op_data->op_fid3), "invalid FID "DFID"\n", + LASSERTF(fid_is_sane(&op_data->op_fid3), "invalid FID " DFID "\n", PFID(&op_data->op_fid3)); if (op_data->op_mea1) { @@ -2069,7 +2069,7 @@ static int lmv_setattr(struct obd_export *exp, struct md_op_data *op_data, if (rc) return rc; - CDEBUG(D_INODE, "SETATTR for "DFID", valid 0x%x\n", + CDEBUG(D_INODE, "SETATTR for " DFID ", valid 0x%x\n", PFID(&op_data->op_fid1), op_data->op_attr.ia_valid); op_data->op_flags |= MF_MDC_CANCEL_FID1; @@ -2577,7 +2577,7 @@ static int lmv_unlink(struct obd_export *exp, struct md_op_data *op_data, if (likely(!(body->mbo_valid & OBD_MD_MDS))) return rc; - CDEBUG(D_INODE, "%s: try unlink to another MDT for "DFID"\n", + CDEBUG(D_INODE, "%s: try unlink to another MDT for " DFID "\n", exp->exp_obd->obd_name, PFID(&body->mbo_fid1)); /* This is a remote object, try remote MDT, Note: it may @@ -2781,7 +2781,7 @@ static int lmv_unpack_md_v1(struct obd_export *exp, struct lmv_stripe_md *lsm, &lsm->lsm_md_oinfo[i].lmo_mds); if (rc) return rc; - CDEBUG(D_INFO, "unpack fid #%d "DFID"\n", i, + CDEBUG(D_INFO, "unpack fid #%d " DFID "\n", i, PFID(&lsm->lsm_md_oinfo[i].lmo_fid)); } @@ -2925,7 +2925,7 @@ static enum ldlm_mode lmv_lock_match(struct obd_export *exp, __u64 flags, int tgt; u32 i; - CDEBUG(D_INODE, "Lock match for "DFID"\n", PFID(fid)); + CDEBUG(D_INODE, "Lock match for " DFID "\n", PFID(fid)); /* * With DNE every object can have two locks in different namespaces: @@ -2937,7 +2937,7 @@ static enum ldlm_mode lmv_lock_match(struct obd_export *exp, __u64 flags, i < lmv->desc.ld_tgt_count; i++, tgt = (tgt + 1) % lmv->desc.ld_tgt_count) { if (tgt < 0) { - CDEBUG(D_HA, "%s: "DFID" is inaccessible: rc = %d\n", + CDEBUG(D_HA, "%s: " DFID " is inaccessible: rc = %d\n", obd->obd_name, PFID(fid), tgt); tgt = 0; } @@ -3148,7 +3148,7 @@ static int lmv_merge_attr(struct obd_export *exp, for (i = 0; i < lsm->lsm_md_stripe_count; i++) { struct inode *inode = lsm->lsm_md_oinfo[i].lmo_root; - CDEBUG(D_INFO, ""DFID" size %llu, blocks %llu nlink %u, atime %lu ctime %lu, mtime %lu.\n", + CDEBUG(D_INFO, "" DFID " size %llu, blocks %llu nlink %u, atime %lu ctime %lu, mtime %lu.\n", PFID(&lsm->lsm_md_oinfo[i].lmo_fid), i_size_read(inode), (unsigned long long)inode->i_blocks, inode->i_nlink, LTIME_S(inode->i_atime), diff --git a/drivers/staging/lustre/lustre/lov/lov_io.c b/drivers/staging/lustre/lustre/lov/lov_io.c index df77b25..babf39a 100644 --- a/drivers/staging/lustre/lustre/lov/lov_io.c +++ b/drivers/staging/lustre/lustre/lov/lov_io.c @@ -1021,7 +1021,7 @@ int lov_io_init_empty(const struct lu_env *env, struct cl_object *obj, break; case CIT_FAULT: result = -EFAULT; - CERROR("Page fault on a file without stripes: "DFID"\n", + CERROR("Page fault on a file without stripes: " DFID "\n", PFID(lu_object_fid(&obj->co_lu))); break; } diff --git a/drivers/staging/lustre/lustre/lov/lov_merge.c b/drivers/staging/lustre/lustre/lov/lov_merge.c index 391dfd2..034b4fc 100644 --- a/drivers/staging/lustre/lustre/lov/lov_merge.c +++ b/drivers/staging/lustre/lustre/lov/lov_merge.c @@ -57,7 +57,7 @@ int lov_merge_lvb_kms(struct lov_stripe_md *lsm, assert_spin_locked(&lsm->lsm_lock); LASSERT(lsm->lsm_lock_owner == current_pid()); - CDEBUG(D_INODE, "MDT ID "DOSTID" initial value: s=%llu m=%llu a=%llu c=%llu b=%llu\n", + CDEBUG(D_INODE, "MDT ID " DOSTID " initial value: s=%llu m=%llu a=%llu c=%llu b=%llu\n", POSTID(&lsm->lsm_oi), lvb->lvb_size, lvb->lvb_mtime, lvb->lvb_atime, lvb->lvb_ctime, lvb->lvb_blocks); for (i = 0; i < lsm->lsm_stripe_count; i++) { @@ -89,7 +89,7 @@ int lov_merge_lvb_kms(struct lov_stripe_md *lsm, if (loi->loi_lvb.lvb_ctime > current_ctime) current_ctime = loi->loi_lvb.lvb_ctime; - CDEBUG(D_INODE, "MDT ID "DOSTID" on OST[%u]: s=%llu m=%llu a=%llu c=%llu b=%llu\n", + CDEBUG(D_INODE, "MDT ID " DOSTID " on OST[%u]: s=%llu m=%llu a=%llu c=%llu b=%llu\n", POSTID(&lsm->lsm_oi), loi->loi_ost_idx, loi->loi_lvb.lvb_size, loi->loi_lvb.lvb_mtime, loi->loi_lvb.lvb_atime, loi->loi_lvb.lvb_ctime, diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c b/drivers/staging/lustre/lustre/lov/lov_object.c index ab3ecfe..d31895e 100644 --- a/drivers/staging/lustre/lustre/lov/lov_object.c +++ b/drivers/staging/lustre/lustre/lov/lov_object.c @@ -153,8 +153,7 @@ static int lov_init_sub(const struct lu_env *env, struct lov_object *lov, subhdr = cl_object_header(stripe); oinfo = lov->lo_lsm->lsm_oinfo[idx]; - CDEBUG(D_INODE, DFID"@%p[%d] -> "DFID"@%p: ostid: "DOSTID - " idx: %d gen: %d\n", + CDEBUG(D_INODE, DFID "@%p[%d] -> " DFID "@%p: ostid: " DOSTID " idx: %d gen: %d\n", PFID(&subhdr->coh_lu.loh_fid), subhdr, idx, PFID(&hdr->coh_lu.loh_fid), hdr, POSTID(&oinfo->loi_oi), oinfo->loi_ost_idx, oinfo->loi_ost_gen); @@ -757,7 +756,7 @@ static int lov_layout_change(const struct lu_env *unused, LASSERT(0 <= llt && llt < ARRAY_SIZE(lov_dispatch)); - CDEBUG(D_INODE, DFID" from %s to %s\n", + CDEBUG(D_INODE, DFID " from %s to %s\n", PFID(lu_object_fid(lov2lu(lov))), llt2str(lov->lo_type), llt2str(llt)); @@ -904,7 +903,7 @@ static int lov_conf_set(const struct lu_env *env, struct cl_object *obj, out: lov_conf_unlock(lov); lov_lsm_put(lsm); - CDEBUG(D_INODE, DFID" lo_layout_invalid=%d\n", + CDEBUG(D_INODE, DFID " lo_layout_invalid=%d\n", PFID(lu_object_fid(lov2lu(lov))), lov->lo_layout_invalid); return result; } diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c b/drivers/staging/lustre/lustre/lov/lov_pack.c index e6727ce..638b764 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pack.c +++ b/drivers/staging/lustre/lustre/lov/lov_pack.c @@ -56,7 +56,7 @@ void lov_dump_lmm_common(int level, void *lmmp) struct ost_id oi; lmm_oi_le_to_cpu(&oi, &lmm->lmm_oi); - CDEBUG(level, "objid "DOSTID", magic 0x%08x, pattern %#x\n", + CDEBUG(level, "objid " DOSTID ", magic 0x%08x, pattern %#x\n", POSTID(&oi), le32_to_cpu(lmm->lmm_magic), le32_to_cpu(lmm->lmm_pattern)); CDEBUG(level, "stripe_size %u, stripe_count %u, layout_gen %u\n", @@ -80,7 +80,7 @@ static void lov_dump_lmm_objects(int level, struct lov_ost_data *lod, struct ost_id oi; ostid_le_to_cpu(&lod->l_ost_oi, &oi); - CDEBUG(level, "stripe %u idx %u subobj "DOSTID"\n", i, + CDEBUG(level, "stripe %u idx %u subobj " DOSTID "\n", i, le32_to_cpu(lod->l_ost_idx), POSTID(&oi)); } } @@ -95,7 +95,7 @@ void lov_dump_lmm_v1(int level, struct lov_mds_md_v1 *lmm) void lov_dump_lmm_v3(int level, struct lov_mds_md_v3 *lmm) { lov_dump_lmm_common(level, lmm); - CDEBUG(level, "pool_name "LOV_POOLNAMEF"\n", lmm->lmm_pool_name); + CDEBUG(level, "pool_name " LOV_POOLNAMEF "\n", lmm->lmm_pool_name); lov_dump_lmm_objects(level, lmm->lmm_objects, le16_to_cpu(lmm->lmm_stripe_count)); } diff --git a/drivers/staging/lustre/lustre/lov/lov_pool.c b/drivers/staging/lustre/lustre/lov/lov_pool.c index 7daa867..1952bbd 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pool.c +++ b/drivers/staging/lustre/lustre/lov/lov_pool.c @@ -429,7 +429,7 @@ int lov_pool_new(struct obd_device *obd, char *poolname) poolname, new_pool, &pool_proc_operations); if (IS_ERR_OR_NULL(new_pool->pool_debugfs_entry)) { - CWARN("Cannot add debugfs pool entry "LOV_POOLNAMEF"\n", + CWARN("Cannot add debugfs pool entry " LOV_POOLNAMEF "\n", poolname); new_pool->pool_debugfs_entry = NULL; lov_pool_putref(new_pool); @@ -450,7 +450,7 @@ int lov_pool_new(struct obd_device *obd, char *poolname) goto out_err; } - CDEBUG(D_CONFIG, LOV_POOLNAMEF" is pool #%d\n", + CDEBUG(D_CONFIG, LOV_POOLNAMEF " is pool #%d\n", poolname, lov->lov_pool_count); return 0; @@ -531,7 +531,7 @@ int lov_pool_add(struct obd_device *obd, char *poolname, char *ostname) if (rc) goto out; - CDEBUG(D_CONFIG, "Added %s to "LOV_POOLNAMEF" as member %d\n", + CDEBUG(D_CONFIG, "Added %s to " LOV_POOLNAMEF " as member %d\n", ostname, poolname, pool_tgt_count(pool)); out: @@ -575,7 +575,7 @@ int lov_pool_remove(struct obd_device *obd, char *poolname, char *ostname) lov_ost_pool_remove(&pool->pool_obds, lov_idx); - CDEBUG(D_CONFIG, "%s removed from "LOV_POOLNAMEF"\n", ostname, + CDEBUG(D_CONFIG, "%s removed from " LOV_POOLNAMEF "\n", ostname, poolname); out: diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c index 9e06078..3eb66ce 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c @@ -830,7 +830,7 @@ int mdc_enqueue(struct obd_export *exp, struct ldlm_enqueue_info *einfo, ptlrpc_req_finished(req); resends++; - CDEBUG(D_HA, "%s: resend:%d op:%d "DFID"/"DFID"\n", + CDEBUG(D_HA, "%s: resend:%d op:%d " DFID "/" DFID "\n", obddev->obd_name, resends, it->it_op, PFID(&op_data->op_fid1), PFID(&op_data->op_fid2)); @@ -933,7 +933,7 @@ static int mdc_finish_intent_lock(struct obd_export *exp, LASSERTF(fid_res_name_eq(&mdt_body->mbo_fid1, &lock->l_resource->lr_name), - "Lock res_id: "DLDLMRES", fid: "DFID"\n", + "Lock res_id: " DLDLMRES ", fid: " DFID "\n", PLDLMRES(lock->l_resource), PFID(&mdt_body->mbo_fid1)); LDLM_LOCK_PUT(lock); @@ -1063,7 +1063,7 @@ int mdc_intent_lock(struct obd_export *exp, struct md_op_data *op_data, LASSERT(it); - CDEBUG(D_DLMTRACE, "(name: %.*s,"DFID") in obj "DFID + CDEBUG(D_DLMTRACE, "(name: %.*s," DFID ") in obj " DFID ", intent: %s flags %#Lo\n", (int)op_data->op_namelen, op_data->op_name, PFID(&op_data->op_fid2), PFID(&op_data->op_fid1), ldlm_it2str(it->it_op), diff --git a/drivers/staging/lustre/lustre/mdc/mdc_reint.c b/drivers/staging/lustre/lustre/mdc/mdc_reint.c index 07b1684..2287bd4 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_reint.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_reint.c @@ -227,7 +227,7 @@ int mdc_create(struct obd_export *exp, struct md_op_data *op_data, ptlrpc_req_finished(req); resends++; - CDEBUG(D_HA, "%s: resend:%d create on "DFID"/"DFID"\n", + CDEBUG(D_HA, "%s: resend:%d create on " DFID "/" DFID "\n", exp->exp_obd->obd_name, resends, PFID(&op_data->op_fid1), PFID(&op_data->op_fid2)); diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index 6bc2fb8..1a3fa1b 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -105,7 +105,7 @@ static int mdc_getstatus(struct obd_export *exp, struct lu_fid *rootfid) *rootfid = body->mbo_fid1; CDEBUG(D_NET, - "root fid="DFID", last_committed=%llu\n", + "root fid=" DFID ", last_committed=%llu\n", PFID(rootfid), lustre_msg_get_last_committed(req->rq_repmsg)); out: @@ -713,7 +713,7 @@ static int mdc_close(struct obd_export *exp, struct md_op_data *op_data, /* allocate a FID for volatile file */ rc = mdc_fid_alloc(NULL, exp, &op_data->op_fid2, op_data); if (rc < 0) { - CERROR("%s: "DFID" failed to allocate FID: %d\n", + CERROR("%s: " DFID " failed to allocate FID: %d\n", obd->obd_name, PFID(&op_data->op_fid1), rc); /* save the errcode and proceed to close */ saved_rc = rc; @@ -753,7 +753,7 @@ static int mdc_close(struct obd_export *exp, struct md_op_data *op_data, /* * TODO: repeat close after errors */ - CWARN("%s: close of FID "DFID" failed, file reference will be dropped when this client unmounts or is evicted\n", + CWARN("%s: close of FID " DFID " failed, file reference will be dropped when this client unmounts or is evicted\n", obd->obd_name, PFID(&op_data->op_fid1)); rc = -ENOMEM; goto out; @@ -1254,7 +1254,7 @@ static int mdc_read_page(struct obd_export *exp, struct md_op_data *op_data, ptlrpc_req_finished(enq_req); if (rc < 0) { - CERROR("%s: "DFID" lock enqueue fails: rc = %d\n", + CERROR("%s: " DFID " lock enqueue fails: rc = %d\n", exp->exp_obd->obd_name, PFID(&op_data->op_fid1), rc); return rc; } @@ -1298,7 +1298,7 @@ static int mdc_read_page(struct obd_export *exp, struct md_op_data *op_data, rp_param.rp_hash64), mdc_read_page_remote, &rp_param); if (IS_ERR(page)) { - CERROR("%s: read cache page: "DFID" at %llu: rc %ld\n", + CERROR("%s: read cache page: " DFID " at %llu: rc %ld\n", exp->exp_obd->obd_name, PFID(&op_data->op_fid1), rp_param.rp_off, PTR_ERR(page)); rc = PTR_ERR(page); @@ -1308,7 +1308,7 @@ static int mdc_read_page(struct obd_export *exp, struct md_op_data *op_data, wait_on_page_locked(page); (void)kmap(page); if (!PageUptodate(page)) { - CERROR("%s: page not updated: "DFID" at %llu: rc %d\n", + CERROR("%s: page not updated: " DFID " at %llu: rc %d\n", exp->exp_obd->obd_name, PFID(&op_data->op_fid1), rp_param.rp_off, -5); goto fail; @@ -1316,7 +1316,7 @@ static int mdc_read_page(struct obd_export *exp, struct md_op_data *op_data, if (!PageChecked(page)) SetPageChecked(page); if (PageError(page)) { - CERROR("%s: page error: "DFID" at %llu: rc %d\n", + CERROR("%s: page error: " DFID " at %llu: rc %d\n", exp->exp_obd->obd_name, PFID(&op_data->op_fid1), rp_param.rp_off, -5); goto fail; @@ -1436,7 +1436,7 @@ static int mdc_ioc_fid2path(struct obd_export *exp, struct getinfo_fid2path *gf) memcpy(key, KEY_FID2PATH, sizeof(KEY_FID2PATH)); memcpy(key + cfs_size_round(sizeof(KEY_FID2PATH)), gf, sizeof(*gf)); - CDEBUG(D_IOCTL, "path get "DFID" from %llu #%d\n", + CDEBUG(D_IOCTL, "path get " DFID " from %llu #%d\n", PFID(&gf->gf_fid), gf->gf_recno, gf->gf_linkno); if (!fid_is_sane(&gf->gf_fid)) { diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index 6a76605..eee0b66 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -800,7 +800,7 @@ static int mgc_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, /* We've given up the lock, prepare ourselves to update. */ LDLM_DEBUG(lock, "MGC cancel CB"); - CDEBUG(D_MGC, "Lock res "DLDLMRES" (%.8s)\n", + CDEBUG(D_MGC, "Lock res " DLDLMRES " (%.8s)\n", PLDLMRES(lock->l_resource), (char *)&lock->l_resource->lr_name.name[0]); diff --git a/drivers/staging/lustre/lustre/obdclass/cl_lock.c b/drivers/staging/lustre/lustre/obdclass/cl_lock.c index 9d7b593..a343e3a 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_lock.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_lock.c @@ -246,7 +246,7 @@ void cl_lock_descr_print(const struct lu_env *env, void *cookie, const struct lu_fid *fid; fid = lu_object_fid(&descr->cld_obj->co_lu); - (*printer)(env, cookie, DDESCR"@"DFID, PDESCR(descr), PFID(fid)); + (*printer)(env, cookie, DDESCR "@" DFID, PDESCR(descr), PFID(fid)); } EXPORT_SYMBOL(cl_lock_descr_print); diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c b/drivers/staging/lustre/lustre/obdclass/cl_page.c index 71fcc4c..6b8c41b 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_page.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c @@ -193,7 +193,7 @@ struct cl_page *cl_page_find(const struct lu_env *env, hdr = cl_object_header(o); - CDEBUG(D_PAGE, "%lu@"DFID" %p %lx %d\n", + CDEBUG(D_PAGE, "%lu@" DFID " %p %lx %d\n", idx, PFID(&hdr->coh_lu.loh_fid), vmpage, vmpage->private, type); /* fast path. */ if (type == CPT_CACHEABLE) { diff --git a/drivers/staging/lustre/lustre/obdclass/llog_cat.c b/drivers/staging/lustre/lustre/obdclass/llog_cat.c index ce8e2f6..8f1533c 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_cat.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_cat.c @@ -78,7 +78,7 @@ static int llog_cat_id2handle(const struct lu_env *env, if (ostid_id(&cgl->lgl_oi) == ostid_id(&logid->lgl_oi) && ostid_seq(&cgl->lgl_oi) == ostid_seq(&logid->lgl_oi)) { if (cgl->lgl_ogen != logid->lgl_ogen) { - CERROR("%s: log "DOSTID" generation %x != %x\n", + CERROR("%s: log " DOSTID " generation %x != %x\n", loghandle->lgh_ctxt->loc_obd->obd_name, POSTID(&logid->lgl_oi), cgl->lgl_ogen, logid->lgl_ogen); @@ -95,7 +95,7 @@ static int llog_cat_id2handle(const struct lu_env *env, rc = llog_open(env, cathandle->lgh_ctxt, &loghandle, logid, NULL, LLOG_OPEN_EXISTS); if (rc < 0) { - CERROR("%s: error opening log id "DOSTID":%x: rc = %d\n", + CERROR("%s: error opening log id " DOSTID ":%x: rc = %d\n", cathandle->lgh_ctxt->loc_obd->obd_name, POSTID(&logid->lgl_oi), logid->lgl_ogen, rc); return rc; @@ -152,13 +152,13 @@ static int llog_cat_process_cb(const struct lu_env *env, CERROR("invalid record in catalog\n"); return -EINVAL; } - CDEBUG(D_HA, "processing log "DOSTID":%x at index %u of catalog " - DOSTID"\n", POSTID(&lir->lid_id.lgl_oi), lir->lid_id.lgl_ogen, + CDEBUG(D_HA, "processing log " DOSTID ":%x at index %u of catalog " + DOSTID "\n", POSTID(&lir->lid_id.lgl_oi), lir->lid_id.lgl_ogen, rec->lrh_index, POSTID(&cat_llh->lgh_id.lgl_oi)); rc = llog_cat_id2handle(env, cat_llh, &llh, &lir->lid_id); if (rc) { - CERROR("%s: cannot find handle for llog "DOSTID": %d\n", + CERROR("%s: cannot find handle for llog " DOSTID ": %d\n", cat_llh->lgh_ctxt->loc_obd->obd_name, POSTID(&lir->lid_id.lgl_oi), rc); return rc; @@ -204,7 +204,7 @@ static int llog_cat_process_or_fork(const struct lu_env *env, if (llh->llh_cat_idx > cat_llh->lgh_last_idx) { struct llog_process_cat_data cd; - CWARN("catlog "DOSTID" crosses index zero\n", + CWARN("catlog " DOSTID " crosses index zero\n", POSTID(&cat_llh->lgh_id.lgl_oi)); cd.lpcd_first_idx = llh->llh_cat_idx; diff --git a/drivers/staging/lustre/lustre/obdclass/llog_swab.c b/drivers/staging/lustre/lustre/obdclass/llog_swab.c index 723c212..016046d 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_swab.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_swab.c @@ -44,7 +44,7 @@ static void print_llogd_body(struct llogd_body *d) { CDEBUG(D_OTHER, "llogd body: %p\n", d); - CDEBUG(D_OTHER, "\tlgd_logid.lgl_oi: "DOSTID"\n", + CDEBUG(D_OTHER, "\tlgd_logid.lgl_oi: " DOSTID "\n", POSTID(&d->lgd_logid.lgl_oi)); CDEBUG(D_OTHER, "\tlgd_logid.lgl_ogen: %#x\n", d->lgd_logid.lgl_ogen); CDEBUG(D_OTHER, "\tlgd_ctxt_idx: %#x\n", d->lgd_ctxt_idx); diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre/lustre/obdclass/lu_object.c index 94c8ae5..b7ba351 100644 --- a/drivers/staging/lustre/lustre/obdclass/lu_object.c +++ b/drivers/staging/lustre/lustre/obdclass/lu_object.c @@ -512,7 +512,7 @@ void lu_object_header_print(const struct lu_env *env, void *cookie, lu_printer_t printer, const struct lu_object_header *hdr) { - (*printer)(env, cookie, "header@%p[%#lx, %d, "DFID"%s%s%s]", + (*printer)(env, cookie, "header@%p[%#lx, %d, " DFID "%s%s%s]", hdr, hdr->loh_flags, atomic_read(&hdr->loh_ref), PFID(&hdr->loh_fid), hlist_unhashed(&hdr->loh_hash) ? "" : " hash", diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c b/drivers/staging/lustre/lustre/obdecho/echo_client.c index d476831..1c4a8fe 100644 --- a/drivers/staging/lustre/lustre/obdecho/echo_client.c +++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c @@ -277,7 +277,7 @@ static int echo_page_print(const struct lu_env *env, { struct echo_page *ep = cl2echo_page(slice); - (*printer)(env, cookie, LUSTRE_ECHO_CLIENT_NAME"-page@%p %d vm@%p\n", + (*printer)(env, cookie, LUSTRE_ECHO_CLIENT_NAME "-page@%p %d vm@%p\n", ep, mutex_is_locked(&ep->ep_lock), slice->cpl_page->cp_vmpage); return 0; @@ -1121,7 +1121,7 @@ static int echo_create_object(const struct lu_env *env, struct echo_device *ed, } cl_echo_object_put(eco); - CDEBUG(D_INFO, "oa oid "DOSTID"\n", POSTID(&oa->o_oi)); + CDEBUG(D_INFO, "oa oid " DOSTID "\n", POSTID(&oa->o_oi)); failed: if (created && rc) diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c index 33d769c..4db8116 100644 --- a/drivers/staging/lustre/lustre/osc/osc_cache.c +++ b/drivers/staging/lustre/lustre/osc/osc_cache.c @@ -472,7 +472,7 @@ static void osc_extent_insert(struct osc_object *obj, struct osc_extent *ext) else if (ext->oe_start > tmp->oe_end) n = &(*n)->rb_right; else - EASSERTF(0, tmp, EXTSTR"\n", EXTPARA(ext)); + EASSERTF(0, tmp, EXTSTR "\n", EXTPARA(ext)); } rb_link_node(&ext->oe_node, parent, n); rb_insert_color(&ext->oe_node, &obj->oo_root); @@ -690,7 +690,7 @@ static struct osc_extent *osc_extent_find(const struct lu_env *env, /* grants has been allocated by caller */ LASSERTF(*grants >= chunksize + cli->cl_extent_tax, "%u/%u/%u.\n", *grants, chunksize, cli->cl_extent_tax); - LASSERTF((max_end - cur->oe_start) < max_pages, EXTSTR"\n", + LASSERTF((max_end - cur->oe_start) < max_pages, EXTSTR "\n", EXTPARA(cur)); restart: @@ -709,7 +709,7 @@ static struct osc_extent *osc_extent_find(const struct lu_env *env, /* if covering by different locks, no chance to match */ if (olck->ols_dlmlock != ext->oe_dlmlock) { EASSERTF(!overlapped(ext, cur), ext, - EXTSTR"\n", EXTPARA(cur)); + EXTSTR "\n", EXTPARA(cur)); ext = next_extent(ext); continue; @@ -732,7 +732,7 @@ static struct osc_extent *osc_extent_find(const struct lu_env *env, */ EASSERTF((ext->oe_start <= cur->oe_start && ext->oe_end >= cur->oe_end), - ext, EXTSTR"\n", EXTPARA(cur)); + ext, EXTSTR "\n", EXTPARA(cur)); if (ext->oe_state > OES_CACHE || ext->oe_fsync_wait) { /* for simplicity, we wait for this extent to diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c index d8aa3fb..922d0cb 100644 --- a/drivers/staging/lustre/lustre/osc/osc_request.c +++ b/drivers/staging/lustre/lustre/osc/osc_request.c @@ -1227,8 +1227,7 @@ static int check_write_checksum(struct obdo *oa, msg = "changed in transit AND doesn't match the original - likely false positive due to mmap IO (bug 11742)" ; - LCONSOLE_ERROR_MSG(0x132, "BAD WRITE CHECKSUM: %s: from %s inode "DFID - " object "DOSTID" extent [%llu-%llu]\n", + LCONSOLE_ERROR_MSG(0x132, "BAD WRITE CHECKSUM: %s: from %s inode " DFID " object " DOSTID " extent [%llu-%llu]\n", msg, libcfs_nid2str(peer->nid), oa->o_valid & OBD_MD_FLFID ? oa->o_parent_seq : (__u64)0, oa->o_valid & OBD_MD_FLFID ? oa->o_parent_oid : 0, diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c index 6466974..1c77792 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/client.c +++ b/drivers/staging/lustre/lustre/ptlrpc/client.c @@ -367,8 +367,8 @@ void ptlrpc_at_adj_net_latency(struct ptlrpc_request *req, */ CDEBUG((lustre_msg_get_flags(req->rq_reqmsg) & MSG_RESENT) ? D_ADAPTTO : D_WARNING, - "Reported service time %u > total measured time " - CFS_DURATION_T"\n", service_time, + "Reported service time %u > total measured time " CFS_DURATION_T "\n", + service_time, (long)(now - req->rq_sent)); return; } diff --git a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c index 9456a18..55e8696e 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c @@ -2089,7 +2089,7 @@ static void dump_obdo(struct obdo *oa) CDEBUG(D_RPCTRACE, "obdo: o_valid = %08x\n", valid); if (valid & OBD_MD_FLID) - CDEBUG(D_RPCTRACE, "obdo: id = "DOSTID"\n", POSTID(&oa->o_oi)); + CDEBUG(D_RPCTRACE, "obdo: id = " DOSTID "\n", POSTID(&oa->o_oi)); if (valid & OBD_MD_FLFID) CDEBUG(D_RPCTRACE, "obdo: o_parent_seq = %#llx\n", oa->o_parent_seq); diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c b/drivers/staging/lustre/lustre/ptlrpc/service.c index b8091c1..759aa6c 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/service.c +++ b/drivers/staging/lustre/lustre/ptlrpc/service.c @@ -1565,7 +1565,7 @@ static bool ptlrpc_server_normal_pending(struct ptlrpc_service_part *svcpt, /* req_in handling should/must be fast */ if (ktime_get_real_seconds() - req->rq_arrival_time.tv_sec > 5) - DEBUG_REQ(D_WARNING, req, "Slow req_in handling "CFS_DURATION_T"s", + DEBUG_REQ(D_WARNING, req, "Slow req_in handling " CFS_DURATION_T "s", (long)(ktime_get_real_seconds() - req->rq_arrival_time.tv_sec)); -- 1.8.3.1 From jsimmons at infradead.org Wed Jun 14 15:01:15 2017 From: jsimmons at infradead.org (James Simmons) Date: Wed, 14 Jun 2017 11:01:15 -0400 Subject: [lustre-devel] [PATCH 0/6] staging: lustre: lustre: assortment of checkpatch cleanups Message-ID: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> This patch series covers a good chunk of the checkpatch issues in the current lustre client code. James Simmons (6): staging: lustre: lustre: resolve "use spaces between elements" checkpatch errors staging: lustre: lustre: make all struct file_operations constant staging: lustre: lustre: fix all bare unsigned usage staging: lustre: lustre: add all missing indentifier names staging: lustre: lustre: several over 80 characters cleanups staging: lustre: lustre: fix all braces issues reported by checkpatch drivers/staging/lustre/lustre/fid/fid_request.c | 2 +- drivers/staging/lustre/lustre/fld/fld_cache.c | 9 ++-- drivers/staging/lustre/lustre/fld/lproc_fld.c | 2 +- drivers/staging/lustre/lustre/include/cl_object.h | 6 +-- .../staging/lustre/lustre/include/lprocfs_status.h | 15 ++++--- drivers/staging/lustre/lustre/include/lu_object.h | 4 +- .../lustre/lustre/include/lustre/lustre_idl.h | 6 +-- .../lustre/lustre/include/lustre/lustre_user.h | 2 +- drivers/staging/lustre/lustre/include/lustre_fid.h | 2 +- drivers/staging/lustre/lustre/ldlm/ldlm_extent.c | 5 ++- drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 40 +++++++++-------- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 42 +++++++++++------- drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 3 +- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 20 +++++---- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 4 +- drivers/staging/lustre/lustre/llite/dcache.c | 4 +- drivers/staging/lustre/lustre/llite/dir.c | 12 ++--- drivers/staging/lustre/lustre/llite/file.c | 51 +++++++++++----------- .../staging/lustre/lustre/llite/llite_internal.h | 36 ++++++++------- drivers/staging/lustre/lustre/llite/llite_lib.c | 39 +++++++++-------- drivers/staging/lustre/lustre/llite/llite_mmap.c | 2 +- drivers/staging/lustre/lustre/llite/llite_nfs.c | 13 +++--- drivers/staging/lustre/lustre/llite/lproc_llite.c | 12 ++--- drivers/staging/lustre/lustre/llite/namei.c | 46 +++++++++---------- drivers/staging/lustre/lustre/llite/rw.c | 6 ++- drivers/staging/lustre/lustre/llite/rw26.c | 4 +- drivers/staging/lustre/lustre/llite/statahead.c | 23 +++++----- drivers/staging/lustre/lustre/llite/super25.c | 3 +- drivers/staging/lustre/lustre/llite/symlink.c | 4 +- drivers/staging/lustre/lustre/llite/vvp_dev.c | 11 ++--- drivers/staging/lustre/lustre/llite/vvp_io.c | 2 +- drivers/staging/lustre/lustre/llite/vvp_object.c | 2 +- drivers/staging/lustre/lustre/llite/xattr.c | 6 +-- drivers/staging/lustre/lustre/llite/xattr_cache.c | 4 +- drivers/staging/lustre/lustre/lmv/lmv_fld.c | 2 +- drivers/staging/lustre/lustre/lmv/lmv_intent.c | 9 ++-- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 50 +++++++++++---------- drivers/staging/lustre/lustre/lov/lov_io.c | 2 +- drivers/staging/lustre/lustre/lov/lov_merge.c | 4 +- drivers/staging/lustre/lustre/lov/lov_object.c | 7 ++- drivers/staging/lustre/lustre/lov/lov_pack.c | 9 ++-- drivers/staging/lustre/lustre/lov/lov_pool.c | 19 +++++--- drivers/staging/lustre/lustre/lov/lproc_lov.c | 12 +++-- drivers/staging/lustre/lustre/mdc/mdc_lib.c | 15 ++++--- drivers/staging/lustre/lustre/mdc/mdc_locks.c | 11 ++--- drivers/staging/lustre/lustre/mdc/mdc_reint.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_request.c | 16 +++---- drivers/staging/lustre/lustre/mgc/mgc_request.c | 5 ++- drivers/staging/lustre/lustre/obdclass/cl_lock.c | 2 +- drivers/staging/lustre/lustre/obdclass/cl_page.c | 2 +- drivers/staging/lustre/lustre/obdclass/genops.c | 6 ++- drivers/staging/lustre/lustre/obdclass/llog_cat.c | 12 ++--- drivers/staging/lustre/lustre/obdclass/llog_swab.c | 2 +- .../lustre/lustre/obdclass/lprocfs_status.c | 2 +- drivers/staging/lustre/lustre/obdclass/lu_object.c | 2 +- .../staging/lustre/lustre/obdecho/echo_client.c | 7 +-- drivers/staging/lustre/lustre/osc/lproc_osc.c | 6 ++- drivers/staging/lustre/lustre/osc/osc_cache.c | 24 +++++----- .../staging/lustre/lustre/osc/osc_cl_internal.h | 4 +- drivers/staging/lustre/lustre/osc/osc_internal.h | 2 +- drivers/staging/lustre/lustre/osc/osc_request.c | 17 +++++--- drivers/staging/lustre/lustre/ptlrpc/client.c | 25 ++++++----- drivers/staging/lustre/lustre/ptlrpc/import.c | 8 ++-- drivers/staging/lustre/lustre/ptlrpc/layout.c | 7 +-- drivers/staging/lustre/lustre/ptlrpc/llog_client.c | 3 +- .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 15 ++++--- .../staging/lustre/lustre/ptlrpc/pack_generic.c | 2 +- .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h | 4 +- drivers/staging/lustre/lustre/ptlrpc/sec.c | 3 +- drivers/staging/lustre/lustre/ptlrpc/service.c | 2 +- 70 files changed, 425 insertions(+), 337 deletions(-) -- 1.8.3.1 From jsimmons at infradead.org Wed Jun 14 15:01:20 2017 From: jsimmons at infradead.org (James Simmons) Date: Wed, 14 Jun 2017 11:01:20 -0400 Subject: [lustre-devel] [PATCH 5/6] staging: lustre: lustre: several over 80 characters cleanups In-Reply-To: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> Message-ID: <1497452481-31124-6-git-send-email-jsimmons@infradead.org> Cleanup many of the over 80 characters reported by checkpatch Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/cl_object.h | 2 +- .../staging/lustre/lustre/include/lprocfs_status.h | 3 +- drivers/staging/lustre/lustre/ldlm/ldlm_extent.c | 5 ++-- drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 13 +++++---- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 33 ++++++++++++++-------- drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 3 +- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 14 +++++---- drivers/staging/lustre/lustre/llite/file.c | 3 +- .../staging/lustre/lustre/llite/llite_internal.h | 10 +++++-- drivers/staging/lustre/lustre/llite/llite_lib.c | 5 ++-- drivers/staging/lustre/lustre/llite/llite_nfs.c | 3 +- drivers/staging/lustre/lustre/llite/lproc_llite.c | 6 ++-- drivers/staging/lustre/lustre/llite/namei.c | 6 ++-- drivers/staging/lustre/lustre/llite/rw.c | 6 ++-- drivers/staging/lustre/lustre/llite/statahead.c | 9 ++++-- drivers/staging/lustre/lustre/llite/super25.c | 3 +- drivers/staging/lustre/lustre/lmv/lmv_intent.c | 3 +- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 10 ++++--- drivers/staging/lustre/lustre/lov/lov_pack.c | 3 +- drivers/staging/lustre/lustre/lov/lov_pool.c | 9 ++++-- drivers/staging/lustre/lustre/lov/lproc_lov.c | 12 +++++--- drivers/staging/lustre/lustre/mdc/mdc_lib.c | 15 ++++++---- drivers/staging/lustre/lustre/mdc/mdc_locks.c | 5 ++-- drivers/staging/lustre/lustre/mgc/mgc_request.c | 3 +- drivers/staging/lustre/lustre/obdclass/genops.c | 6 ++-- .../staging/lustre/lustre/obdecho/echo_client.c | 3 +- drivers/staging/lustre/lustre/osc/lproc_osc.c | 6 ++-- drivers/staging/lustre/lustre/osc/osc_cache.c | 10 +++++-- .../staging/lustre/lustre/osc/osc_cl_internal.h | 4 ++- drivers/staging/lustre/lustre/osc/osc_request.c | 14 +++++---- drivers/staging/lustre/lustre/ptlrpc/client.c | 21 ++++++++------ drivers/staging/lustre/lustre/ptlrpc/import.c | 8 +++--- drivers/staging/lustre/lustre/ptlrpc/layout.c | 7 +++-- drivers/staging/lustre/lustre/ptlrpc/llog_client.c | 3 +- .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 15 ++++++---- drivers/staging/lustre/lustre/ptlrpc/sec.c | 3 +- 36 files changed, 184 insertions(+), 100 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/cl_object.h b/drivers/staging/lustre/lustre/include/cl_object.h index 90a0c50..6e3b149 100644 --- a/drivers/staging/lustre/lustre/include/cl_object.h +++ b/drivers/staging/lustre/lustre/include/cl_object.h @@ -1012,7 +1012,7 @@ struct cl_page_operations { #define CL_PAGE_HEADER(mask, env, page, format, ...) \ do { \ if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) { \ - LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL); \ + LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL); \ cl_page_header_print(env, &msgdata, lu_cdebug_printer, page); \ CDEBUG(mask, format, ## __VA_ARGS__); \ } \ diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h index 915283c..2d92055 100644 --- a/drivers/staging/lustre/lustre/include/lprocfs_status.h +++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h @@ -577,7 +577,8 @@ void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx, { \ return lprocfs_wr_##type(file, buffer, count, off); \ } \ - static int name##_##type##_open(struct inode *inode, struct file *file) \ + static int name##_##type##_open(struct inode *inode, \ + struct file *file) \ { \ return single_open(file, NULL, inode->i_private); \ } \ diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c index 08f97e2..8011368 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c @@ -241,8 +241,9 @@ void ldlm_extent_unlink_lock(struct ldlm_lock *lock) } } -void ldlm_extent_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy, - union ldlm_policy_data *lpolicy) +void +ldlm_extent_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy, + union ldlm_policy_data *lpolicy) { lpolicy->l_extent.start = wpolicy->l_extent.start; lpolicy->l_extent.end = wpolicy->l_extent.end; diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h index ec3b23c..cffdb94 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h @@ -88,7 +88,8 @@ void ldlm_namespace_move_to_inactive_locked(struct ldlm_namespace *ns, /* ldlm_request.c */ /* Cancel lru flag, it indicates we cancel aged locks. */ enum { - LDLM_LRU_FLAG_AGED = BIT(0), /* Cancel aged locks (non lru resize). */ + LDLM_LRU_FLAG_AGED = BIT(0), /* Cancel aged locks (non lru resize). + */ LDLM_LRU_FLAG_PASSED = BIT(1), /* Cancel passed number of locks. */ LDLM_LRU_FLAG_SHRINK = BIT(2), /* Cancel locks from shrinker. */ LDLM_LRU_FLAG_LRUR = BIT(3), /* Cancel locks from lru resize. */ @@ -326,10 +327,12 @@ void ldlm_plain_policy_local_to_wire(const union ldlm_policy_data *lpolicy, union ldlm_wire_policy_data *wpolicy); void ldlm_ibits_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy, union ldlm_policy_data *lpolicy); -void ldlm_ibits_policy_local_to_wire(const union ldlm_policy_data *lpolicy, - union ldlm_wire_policy_data *wpolicy); -void ldlm_extent_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy, - union ldlm_policy_data *lpolicy); +void +ldlm_ibits_policy_local_to_wire(const union ldlm_policy_data *lpolicy, + union ldlm_wire_policy_data *wpolicy); +void +ldlm_extent_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy, + union ldlm_policy_data *lpolicy); void ldlm_extent_policy_local_to_wire(const union ldlm_policy_data *lpolicy, union ldlm_wire_policy_data *wpolicy); void ldlm_flock_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy, diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c index ddb4642..8599134 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c @@ -1035,7 +1035,8 @@ void ldlm_grant_lock(struct ldlm_lock *lock, struct list_head *work_list) ldlm_extent_add_lock(res, lock); else if (res->lr_type == LDLM_FLOCK) { /* - * We should not add locks to granted list in the following cases: + * We should not add locks to granted list in the following + * cases: * - this is an UNLOCK but not a real lock; * - this is a TEST lock; * - this is a F_CANCELLK lock (async flock has req_mode == 0) @@ -2050,13 +2051,16 @@ void _ldlm_lock_debug(struct ldlm_lock *lock, libcfs_debug_vmsg2(msgdata, fmt, args, " ns: \?\? lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: \?\? rrc=\?\? type: \?\?\? flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n", lock, - lock->l_handle.h_cookie, atomic_read(&lock->l_refc), + lock->l_handle.h_cookie, + atomic_read(&lock->l_refc), lock->l_readers, lock->l_writers, ldlm_lockname[lock->l_granted_mode], ldlm_lockname[lock->l_req_mode], - lock->l_flags, nid, lock->l_remote_handle.cookie, + lock->l_flags, nid, + lock->l_remote_handle.cookie, exp ? atomic_read(&exp->exp_refcount) : -99, - lock->l_pid, lock->l_callback_timeout, lock->l_lvb_type); + lock->l_pid, lock->l_callback_timeout, + lock->l_lvb_type); va_end(args); return; } @@ -2066,7 +2070,8 @@ void _ldlm_lock_debug(struct ldlm_lock *lock, libcfs_debug_vmsg2(msgdata, fmt, args, " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: " DLDLMRES " rrc: %d type: %s [%llu->%llu] (req %llu->%llu) flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n", ldlm_lock_to_ns_name(lock), lock, - lock->l_handle.h_cookie, atomic_read(&lock->l_refc), + lock->l_handle.h_cookie, + atomic_read(&lock->l_refc), lock->l_readers, lock->l_writers, ldlm_lockname[lock->l_granted_mode], ldlm_lockname[lock->l_req_mode], @@ -2075,8 +2080,10 @@ void _ldlm_lock_debug(struct ldlm_lock *lock, ldlm_typename[resource->lr_type], lock->l_policy_data.l_extent.start, lock->l_policy_data.l_extent.end, - lock->l_req_extent.start, lock->l_req_extent.end, - lock->l_flags, nid, lock->l_remote_handle.cookie, + lock->l_req_extent.start, + lock->l_req_extent.end, + lock->l_flags, nid, + lock->l_remote_handle.cookie, exp ? atomic_read(&exp->exp_refcount) : -99, lock->l_pid, lock->l_callback_timeout, lock->l_lvb_type); @@ -2086,7 +2093,8 @@ void _ldlm_lock_debug(struct ldlm_lock *lock, libcfs_debug_vmsg2(msgdata, fmt, args, " ns: %s lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: " DLDLMRES " rrc: %d type: %s pid: %d [%llu->%llu] flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu\n", ldlm_lock_to_ns_name(lock), lock, - lock->l_handle.h_cookie, atomic_read(&lock->l_refc), + lock->l_handle.h_cookie, + atomic_read(&lock->l_refc), lock->l_readers, lock->l_writers, ldlm_lockname[lock->l_granted_mode], ldlm_lockname[lock->l_req_mode], @@ -2096,7 +2104,8 @@ void _ldlm_lock_debug(struct ldlm_lock *lock, lock->l_policy_data.l_flock.pid, lock->l_policy_data.l_flock.start, lock->l_policy_data.l_flock.end, - lock->l_flags, nid, lock->l_remote_handle.cookie, + lock->l_flags, nid, + lock->l_remote_handle.cookie, exp ? atomic_read(&exp->exp_refcount) : -99, lock->l_pid, lock->l_callback_timeout); break; @@ -2114,7 +2123,8 @@ void _ldlm_lock_debug(struct ldlm_lock *lock, lock->l_policy_data.l_inodebits.bits, atomic_read(&resource->lr_refcount), ldlm_typename[resource->lr_type], - lock->l_flags, nid, lock->l_remote_handle.cookie, + lock->l_flags, nid, + lock->l_remote_handle.cookie, exp ? atomic_read(&exp->exp_refcount) : -99, lock->l_pid, lock->l_callback_timeout, lock->l_lvb_type); @@ -2132,7 +2142,8 @@ void _ldlm_lock_debug(struct ldlm_lock *lock, PLDLMRES(resource), atomic_read(&resource->lr_refcount), ldlm_typename[resource->lr_type], - lock->l_flags, nid, lock->l_remote_handle.cookie, + lock->l_flags, nid, + lock->l_remote_handle.cookie, exp ? atomic_read(&exp->exp_refcount) : -99, lock->l_pid, lock->l_callback_timeout, lock->l_lvb_type); diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c index cf3fc57..a2b659f 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c @@ -359,7 +359,8 @@ static int ldlm_pool_recalc(struct ldlm_pool *pl) recalc_interval_sec = ktime_get_real_seconds() - pl->pl_recalc_time; if (recalc_interval_sec > 0) { spin_lock(&pl->pl_lock); - recalc_interval_sec = ktime_get_real_seconds() - pl->pl_recalc_time; + recalc_interval_sec = ktime_get_real_seconds() - + pl->pl_recalc_time; if (recalc_interval_sec > 0) { /* diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index 4028e11..96fb8a9 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c @@ -1335,13 +1335,14 @@ typedef enum ldlm_policy_res (*ldlm_cancel_lru_policy_t)( * flags & LDLM_LRU_FLAG_LRUR - use LRU resize policy (SLV from server) to * cancel not more than \a count locks; * - * flags & LDLM_LRU_FLAG_PASSED - cancel \a count number of old locks (located at - * the beginning of LRU list); + * flags & LDLM_LRU_FLAG_PASSED - cancel \a count number of old locks (located + * at the beginning of LRU list); * - * flags & LDLM_LRU_FLAG_SHRINK - cancel not more than \a count locks according to - * memory pressure policy function; + * flags & LDLM_LRU_FLAG_SHRINK - cancel not more than \a count locks according + * to memory pressure policy function; * - * flags & LDLM_LRU_FLAG_AGED - cancel \a count locks according to "aged policy". + * flags & LDLM_LRU_FLAG_AGED - cancel \a count locks according to + * "aged policy". * * flags & LDLM_LRU_FLAG_NO_WAIT - cancel as many unused locks as possible * (typically before replaying locks) w/o @@ -1355,7 +1356,8 @@ static int ldlm_prepare_lru_list(struct ldlm_namespace *ns, ldlm_cancel_lru_policy_t pf; struct ldlm_lock *lock, *next; int added = 0, unused, remained; - int no_wait = flags & (LDLM_LRU_FLAG_NO_WAIT | LDLM_LRU_FLAG_LRUR_NO_WAIT); + int no_wait = flags & (LDLM_LRU_FLAG_NO_WAIT | + LDLM_LRU_FLAG_LRUR_NO_WAIT); spin_lock(&ns->ns_lock); unused = ns->ns_nr_unused; diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index ab1c85c..22d7939 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -605,7 +605,8 @@ int ll_file_open(struct inode *inode, struct file *file) * to get file with different fid. */ it->it_flags |= MDS_OPEN_LOCK | MDS_OPEN_BY_FID; - rc = ll_intent_file_open(file->f_path.dentry, NULL, 0, it); + rc = ll_intent_file_open(file->f_path.dentry, NULL, 0, + it); if (rc) goto out_openerr; diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index cd3311a..e585f88 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -84,7 +84,9 @@ struct ll_dentry_data { struct ll_getname_data { struct dir_context ctx; - char *lgd_name; /* points to a buffer with NAME_MAX+1 size */ + char *lgd_name; /* points to a buffer with NAME_MAX + 1 + * size + */ struct lu_fid lgd_fid; /* target fid we are looking for */ int lgd_found; /* inode matched? */ }; @@ -637,7 +639,8 @@ static inline int ll_need_32bit_api(struct ll_sb_info *sbi) #if BITS_PER_LONG == 32 return 1; #elif defined(CONFIG_COMPAT) - return unlikely(in_compat_syscall() || (sbi->ll_flags & LL_SBI_32BIT_API)); + return unlikely(in_compat_syscall() || + (sbi->ll_flags & LL_SBI_32BIT_API)); #else return unlikely(sbi->ll_flags & LL_SBI_32BIT_API); #endif @@ -1065,7 +1068,8 @@ struct ll_statahead_info { * hidden entries */ sai_agl_valid:1,/* AGL is valid for the dir */ - sai_in_readpage:1;/* statahead is in readdir() */ + sai_in_readpage:1;/* statahead is in readdir() + */ wait_queue_head_t sai_waitq; /* stat-ahead wait queue */ struct ptlrpc_thread sai_thread; /* stat-ahead thread */ struct ptlrpc_thread sai_agl_thread; /* AGL thread */ diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index 974a05d..98d350a 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -2574,8 +2574,9 @@ static int ll_linkea_decode(struct linkea_data *ldata, unsigned int linkno, * * \param[in] file - File descriptor against which to perform the operation * \param[in,out] arg - User-filled structure containing the linkno to operate - * on and the available size. It is eventually filled with - * the requested information or left untouched on error + * on and the available size. It is eventually filled + * with the requested information or left untouched on + * error * * \retval - 0 on success * \retval - Appropriate negative error code on failure diff --git a/drivers/staging/lustre/lustre/llite/llite_nfs.c b/drivers/staging/lustre/lustre/llite/llite_nfs.c index e50c637..db12c83 100644 --- a/drivers/staging/lustre/lustre/llite/llite_nfs.c +++ b/drivers/staging/lustre/lustre/llite/llite_nfs.c @@ -127,7 +127,8 @@ struct lustre_nfs_fid { }; static struct dentry * -ll_iget_for_nfs(struct super_block *sb, struct lu_fid *fid, struct lu_fid *parent) +ll_iget_for_nfs(struct super_block *sb, struct lu_fid *fid, + struct lu_fid *parent) { struct inode *inode; struct dentry *result; diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c b/drivers/staging/lustre/lustre/llite/lproc_llite.c index aeae667..564761d 100644 --- a/drivers/staging/lustre/lustre/llite/lproc_llite.c +++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c @@ -380,7 +380,8 @@ static ssize_t ll_max_cached_mb_seq_write(struct file *file, const char __user *buffer, size_t count, loff_t *off) { - struct super_block *sb = ((struct seq_file *)file->private_data)->private; + struct seq_file *seq = file->private_data; + struct super_block *sb = seq->private; struct ll_sb_info *sbi = ll_s2sbi(sb); struct cl_client_cache *cache = sbi->ll_cache; struct lu_env *env; @@ -895,7 +896,8 @@ static ssize_t ll_unstable_stats_seq_write(struct file *file, const char __user *buffer, size_t count, loff_t *off) { - struct super_block *sb = ((struct seq_file *)file->private_data)->private; + struct seq_file *seq = file->private_data; + struct super_block *sb = seq->private; struct ll_sb_info *sbi = ll_s2sbi(sb); char kernbuf[128]; int val, rc; diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index a208a8b..54c18d9 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -281,6 +281,7 @@ int ll_md_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, truncate_inode_pages(inode->i_mapping, 0); if (unlikely(!fid_is_zero(&lli->lli_pfid))) { + struct ll_sb_info *sbi = ll_i2sbi(inode); struct inode *master_inode = NULL; unsigned long hash; @@ -295,7 +296,7 @@ int ll_md_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, PFID(&lli->lli_pfid)); hash = cl_fid_build_ino(&lli->lli_pfid, - ll_need_32bit_api(ll_i2sbi(inode))); + ll_need_32bit_api(sbi)); /* * Do not lookup the inode with ilookup5, * otherwise it will cause dead lock, @@ -738,7 +739,8 @@ static int ll_atomic_open(struct inode *dir, struct dentry *dentry, *opened |= FILE_CREATED; } - if (d_really_is_positive(dentry) && it_disposition(it, DISP_OPEN_OPEN)) { + if (d_really_is_positive(dentry) && + it_disposition(it, DISP_OPEN_OPEN)) { /* Open dentry. */ if (S_ISFIFO(d_inode(dentry)->i_mode)) { /* We cannot call open here as it might diff --git a/drivers/staging/lustre/lustre/llite/rw.c b/drivers/staging/lustre/lustre/llite/rw.c index 1bac51f..9b68c4e 100644 --- a/drivers/staging/lustre/lustre/llite/rw.c +++ b/drivers/staging/lustre/lustre/llite/rw.c @@ -670,7 +670,8 @@ static void ras_stride_increase_window(struct ll_readahead_state *ras, LASSERT(ras->ras_stride_length > 0); LASSERTF(ras->ras_window_start + ras->ras_window_len - >= ras->ras_stride_offset, "window_start %lu, window_len %lu stride_offset %lu\n", + >= ras->ras_stride_offset, + "window_start %lu, window_len %lu stride_offset %lu\n", ras->ras_window_start, ras->ras_window_len, ras->ras_stride_offset); @@ -766,7 +767,8 @@ static void ras_update(struct ll_sb_info *sbi, struct inode *inode, PAGE_SHIFT; CDEBUG(D_READA, "kmsp %llu mwp %lu mp %lu\n", kms_pages, - ra->ra_max_read_ahead_whole_pages, ra->ra_max_pages_per_file); + ra->ra_max_read_ahead_whole_pages, + ra->ra_max_pages_per_file); if (kms_pages && kms_pages <= ra->ra_max_read_ahead_whole_pages) { diff --git a/drivers/staging/lustre/lustre/llite/statahead.c b/drivers/staging/lustre/lustre/llite/statahead.c index 9bbca01..15b713c 100644 --- a/drivers/staging/lustre/lustre/llite/statahead.c +++ b/drivers/staging/lustre/lustre/llite/statahead.c @@ -571,7 +571,8 @@ static void sa_instantiate(struct ll_statahead_info *sai, child = entry->se_inode; if (child) { /* revalidate; unlinked and re-created with the same name */ - if (unlikely(!lu_fid_eq(&minfo->mi_data.op_fid2, &body->mbo_fid1))) { + if (unlikely(!lu_fid_eq(&minfo->mi_data.op_fid2, + &body->mbo_fid1))) { entry->se_inode = NULL; iput(child); child = NULL; @@ -1082,7 +1083,8 @@ static int ll_statahead_thread(void *arg) struct ll_inode_info *clli; clli = list_entry(sai->sai_agls.next, - struct ll_inode_info, lli_agl_list); + struct ll_inode_info, + lli_agl_list); list_del_init(&clli->lli_agl_list); spin_unlock(&lli->lli_agl_lock); @@ -1447,7 +1449,8 @@ static int revalidate_statahead_dentry(struct inode *dir, if (entry->se_state == SA_ENTRY_SUCC && entry->se_inode) { struct inode *inode = entry->se_inode; struct lookup_intent it = { .it_op = IT_GETATTR, - .it_lock_handle = entry->se_handle }; + .it_lock_handle = entry->se_handle + }; __u64 bits; rc = md_revalidate_lock(ll_i2mdexp(dir), &it, diff --git a/drivers/staging/lustre/lustre/llite/super25.c b/drivers/staging/lustre/lustre/llite/super25.c index 56f4b10..856390a 100644 --- a/drivers/staging/lustre/lustre/llite/super25.c +++ b/drivers/staging/lustre/lustre/llite/super25.c @@ -88,7 +88,8 @@ static int __init lustre_init(void) struct timespec64 ts; int i, rc, seed[2]; - BUILD_BUG_ON(sizeof(LUSTRE_VOLATILE_HDR) != LUSTRE_VOLATILE_HDR_LEN + 1); + BUILD_BUG_ON(sizeof(LUSTRE_VOLATILE_HDR) != + LUSTRE_VOLATILE_HDR_LEN + 1); /* print an address of _any_ initialized kernel symbol from this * module, to allow debugging with gdb that doesn't support data diff --git a/drivers/staging/lustre/lustre/lmv/lmv_intent.c b/drivers/staging/lustre/lustre/lmv/lmv_intent.c index f49db6c..c899fd0 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_intent.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_intent.c @@ -222,7 +222,8 @@ int lmv_revalidate_slaves(struct obd_export *exp, &RMF_MDT_BODY); if (!body) { if (it.it_lock_mode && lockh) { - ldlm_lock_decref(lockh, it.it_lock_mode); + ldlm_lock_decref(lockh, + it.it_lock_mode); it.it_lock_mode = 0; } diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index 64fcaef..7f0cb41 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -1834,8 +1834,8 @@ static int lmv_early_cancel(struct obd_export *exp, struct lmv_tgt_desc *tgt, } /* - * llite passes fid of an target inode in op_data->op_fid1 and id of directory in - * op_data->op_fid2 + * llite passes fid of an target inode in op_data->op_fid1 and id of directory + * in op_data->op_fid2 */ static int lmv_link(struct obd_export *exp, struct md_op_data *op_data, struct ptlrpc_request **request) @@ -1916,7 +1916,8 @@ static int lmv_rename(struct obd_export *exp, struct md_op_data *op_data, op_data->op_cap = cfs_curproc_cap_pack(); if (op_data->op_cli_flags & CLI_MIGRATE) { - LASSERTF(fid_is_sane(&op_data->op_fid3), "invalid FID " DFID "\n", + LASSERTF(fid_is_sane(&op_data->op_fid3), + "invalid FID " DFID "\n", PFID(&op_data->op_fid3)); if (op_data->op_mea1) { @@ -2415,7 +2416,8 @@ static int lmv_read_page(struct obd_export *exp, struct md_op_data *op_data, return rc; if (unlikely(lsm)) - return lmv_read_striped_page(exp, op_data, cb_op, offset, ppage); + return lmv_read_striped_page(exp, op_data, cb_op, offset, + ppage); tgt = lmv_find_target(lmv, &op_data->op_fid1); if (IS_ERR(tgt)) diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c b/drivers/staging/lustre/lustre/lov/lov_pack.c index 638b764..a6c90a6 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pack.c +++ b/drivers/staging/lustre/lustre/lov/lov_pack.c @@ -350,7 +350,8 @@ int lov_getstripe(struct lov_object *obj, struct lov_stripe_md *lsm, /* FIXME: Bug 1185 - copy fields properly when structs change */ /* struct lov_user_md_v3 and struct lov_mds_md_v3 must be the same */ BUILD_BUG_ON(sizeof(lum) != sizeof(struct lov_mds_md_v3)); - BUILD_BUG_ON(sizeof(lum.lmm_objects[0]) != sizeof(lmmk->lmm_objects[0])); + BUILD_BUG_ON(sizeof(lum.lmm_objects[0]) != + sizeof(lmmk->lmm_objects[0])); if (cpu_to_le32(LOV_MAGIC) != LOV_MAGIC && (lmmk->lmm_magic == cpu_to_le32(LOV_MAGIC_V1) || diff --git a/drivers/staging/lustre/lustre/lov/lov_pool.c b/drivers/staging/lustre/lustre/lov/lov_pool.c index 39daa17..0059aa8 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pool.c +++ b/drivers/staging/lustre/lustre/lov/lov_pool.c @@ -106,7 +106,8 @@ static void *pool_key(struct hlist_node *hnode) return pool->pool_name; } -static int pool_hashkey_keycmp(const void *key, struct hlist_node *compared_hnode) +static int pool_hashkey_keycmp(const void *key, + struct hlist_node *compared_hnode) { char *pool_name; struct pool_desc *pool; @@ -367,8 +368,12 @@ int lov_ost_pool_remove(struct ost_pool *op, __u32 idx) for (i = 0; i < op->op_count; i++) { if (op->op_array[i] == idx) { + size_t array_size; + + array_size = (op->op_count - i - 1) * + sizeof(op->op_array[0]); memmove(&op->op_array[i], &op->op_array[i + 1], - (op->op_count - i - 1) * sizeof(op->op_array[0])); + array_size); op->op_count--; up_write(&op->op_rw_sem); return 0; diff --git a/drivers/staging/lustre/lustre/lov/lproc_lov.c b/drivers/staging/lustre/lustre/lov/lproc_lov.c index eb6d30d..c028b6d 100644 --- a/drivers/staging/lustre/lustre/lov/lproc_lov.c +++ b/drivers/staging/lustre/lustre/lov/lproc_lov.c @@ -52,7 +52,8 @@ static ssize_t lov_stripesize_seq_write(struct file *file, const char __user *buffer, size_t count, loff_t *off) { - struct obd_device *dev = ((struct seq_file *)file->private_data)->private; + struct seq_file *seq = file->private_data; + struct obd_device *dev = seq->private; struct lov_desc *desc; __u64 val; int rc; @@ -85,7 +86,8 @@ static ssize_t lov_stripeoffset_seq_write(struct file *file, const char __user *buffer, size_t count, loff_t *off) { - struct obd_device *dev = ((struct seq_file *)file->private_data)->private; + struct seq_file *seq = file->private_data; + struct obd_device *dev = seq->private; struct lov_desc *desc; __u64 val; int rc; @@ -117,7 +119,8 @@ static ssize_t lov_stripetype_seq_write(struct file *file, const char __user *buffer, size_t count, loff_t *off) { - struct obd_device *dev = ((struct seq_file *)file->private_data)->private; + struct seq_file *seq = file->private_data; + struct obd_device *dev = seq->private; struct lov_desc *desc; int val, rc; @@ -149,7 +152,8 @@ static ssize_t lov_stripecount_seq_write(struct file *file, const char __user *buffer, size_t count, loff_t *off) { - struct obd_device *dev = ((struct seq_file *)file->private_data)->private; + struct seq_file *seq = file->private_data; + struct obd_device *dev = seq->private; struct lov_desc *desc; int val, rc; diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c index b1853ff..35f40ee 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c @@ -125,7 +125,8 @@ void mdc_create_pack(struct ptlrpc_request *req, struct md_op_data *op_data, char *tmp; __u64 flags; - BUILD_BUG_ON(sizeof(struct mdt_rec_reint) != sizeof(struct mdt_rec_create)); + BUILD_BUG_ON(sizeof(struct mdt_rec_reint) != + sizeof(struct mdt_rec_create)); rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT); rec->cr_opcode = REINT_CREATE; @@ -189,7 +190,8 @@ void mdc_open_pack(struct ptlrpc_request *req, struct md_op_data *op_data, char *tmp; __u64 cr_flags; - BUILD_BUG_ON(sizeof(struct mdt_rec_reint) != sizeof(struct mdt_rec_create)); + BUILD_BUG_ON(sizeof(struct mdt_rec_reint) != + sizeof(struct mdt_rec_create)); rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT); /* XXX do something about time, uid, gid */ @@ -336,7 +338,8 @@ void mdc_unlink_pack(struct ptlrpc_request *req, struct md_op_data *op_data) { struct mdt_rec_unlink *rec; - BUILD_BUG_ON(sizeof(struct mdt_rec_reint) != sizeof(struct mdt_rec_unlink)); + BUILD_BUG_ON(sizeof(struct mdt_rec_reint) != + sizeof(struct mdt_rec_unlink)); rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT); rec->ul_opcode = op_data->op_cli_flags & CLI_RM_ENTRY ? @@ -359,7 +362,8 @@ void mdc_link_pack(struct ptlrpc_request *req, struct md_op_data *op_data) { struct mdt_rec_link *rec; - BUILD_BUG_ON(sizeof(struct mdt_rec_reint) != sizeof(struct mdt_rec_link)); + BUILD_BUG_ON(sizeof(struct mdt_rec_reint) != + sizeof(struct mdt_rec_link)); rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT); rec->lk_opcode = REINT_LINK; @@ -407,7 +411,8 @@ void mdc_rename_pack(struct ptlrpc_request *req, struct md_op_data *op_data, { struct mdt_rec_rename *rec; - BUILD_BUG_ON(sizeof(struct mdt_rec_reint) != sizeof(struct mdt_rec_rename)); + BUILD_BUG_ON(sizeof(struct mdt_rec_reint) != + sizeof(struct mdt_rec_rename)); rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_REINT); /* XXX do something about time, uid, gid */ diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c index 3eb66ce..05ea024 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c @@ -587,7 +587,7 @@ static int mdc_finish_enqueue(struct obd_export *exp, mdc_set_open_replay_data(NULL, NULL, it); } - if ((body->mbo_valid & (OBD_MD_FLDIREA | OBD_MD_FLEASIZE)) != 0) { + if (body->mbo_valid & (OBD_MD_FLDIREA | OBD_MD_FLEASIZE)) { void *eadata; mdc_update_max_ea_from_body(exp, body); @@ -634,7 +634,8 @@ static int mdc_finish_enqueue(struct obd_export *exp, lmm = req_capsule_client_get(pill, &RMF_EADATA); if (lmm) - memcpy(lmm, eadata, body->mbo_eadatasize); + memcpy(lmm, eadata, + body->mbo_eadatasize); } } } else if (it->it_op & IT_LAYOUT) { diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index eee0b66..bb69a60 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -94,7 +94,8 @@ int mgc_fsname2resid(char *fsname, struct ldlm_res_id *res_id, int type) } EXPORT_SYMBOL(mgc_fsname2resid); -static int mgc_logname2resid(char *logname, struct ldlm_res_id *res_id, int type) +static int mgc_logname2resid(char *logname, struct ldlm_res_id *res_id, + int type) { char *name_end; int len; diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c index fa0d38d..c30d735 100644 --- a/drivers/staging/lustre/lustre/obdclass/genops.c +++ b/drivers/staging/lustre/lustre/obdclass/genops.c @@ -73,7 +73,8 @@ static struct obd_device *obd_device_alloc(void) static void obd_device_free(struct obd_device *obd) { - LASSERTF(obd->obd_magic == OBD_DEVICE_MAGIC, "obd %p obd_magic %08x != %08x\n", + LASSERTF(obd->obd_magic == OBD_DEVICE_MAGIC, + "obd %p obd_magic %08x != %08x\n", obd, obd->obd_magic, OBD_DEVICE_MAGIC); if (obd->obd_namespace) { CERROR("obd %p: namespace %p was not properly cleaned up (obd_force=%d)!\n", @@ -346,7 +347,8 @@ void class_release_dev(struct obd_device *obd) { struct obd_type *obd_type = obd->obd_type; - LASSERTF(obd->obd_magic == OBD_DEVICE_MAGIC, "%p obd_magic %08x != %08x\n", + LASSERTF(obd->obd_magic == OBD_DEVICE_MAGIC, + "%p obd_magic %08x != %08x\n", obd, obd->obd_magic, OBD_DEVICE_MAGIC); LASSERTF(obd == obd_devs[obd->obd_minor], "obd %p != obd_devs[%d] %p\n", obd, obd->obd_minor, obd_devs[obd->obd_minor]); diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c b/drivers/staging/lustre/lustre/obdecho/echo_client.c index 1c4a8fe..f4d49dc 100644 --- a/drivers/staging/lustre/lustre/obdecho/echo_client.c +++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c @@ -1304,7 +1304,8 @@ static int echo_client_kbrw(struct echo_device *ed, int rw, struct obdo *oa, vrc = echo_client_page_debug_check(pgp->pg, ostid_id(&oa->o_oi), - pgp->off, pgp->count); + pgp->off, + pgp->count); if (vrc != 0 && rc == 0) rc = vrc; } diff --git a/drivers/staging/lustre/lustre/osc/lproc_osc.c b/drivers/staging/lustre/lustre/osc/lproc_osc.c index 86f252d..f36273a 100644 --- a/drivers/staging/lustre/lustre/osc/lproc_osc.c +++ b/drivers/staging/lustre/lustre/osc/lproc_osc.c @@ -198,7 +198,8 @@ static ssize_t osc_cached_mb_seq_write(struct file *file, const char __user *buffer, size_t count, loff_t *off) { - struct obd_device *dev = ((struct seq_file *)file->private_data)->private; + struct seq_file *seq = file->private_data; + struct obd_device *dev = seq->private; struct client_obd *cli = &dev->u.cli; long pages_number, rc; char kernbuf[128]; @@ -413,7 +414,8 @@ static ssize_t osc_checksum_type_seq_write(struct file *file, const char __user *buffer, size_t count, loff_t *off) { - struct obd_device *obd = ((struct seq_file *)file->private_data)->private; + struct seq_file *seq = file->private_data; + struct obd_device *obd = seq->private; int i; DECLARE_CKSUM_NAME; diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c index d8a95f8..c20c7d7 100644 --- a/drivers/staging/lustre/lustre/osc/osc_cache.c +++ b/drivers/staging/lustre/lustre/osc/osc_cache.c @@ -1141,8 +1141,9 @@ static int osc_extent_make_ready(const struct lu_env *env, * the size of file. */ if (!(last->oap_async_flags & ASYNC_COUNT_STABLE)) { - int last_oap_count = osc_refresh_count(env, last, OBD_BRW_WRITE); + int last_oap_count; + last_oap_count = osc_refresh_count(env, last, OBD_BRW_WRITE); LASSERT(last_oap_count > 0); LASSERT(last->oap_page_off + last_oap_count <= PAGE_SIZE); last->oap_count = last_oap_count; @@ -1619,7 +1620,9 @@ static int osc_enter_cache(const struct lu_env *env, struct client_obd *cli, spin_lock(&cli->cl_loi_list_lock); if (rc < 0) { - /* l_wait_event is interrupted by signal, or timed out */ + /* l_wait_event is interrupted by signal, or + * timed out + */ list_del_init(&ocw.ocw_entry); break; } @@ -1781,7 +1784,8 @@ static int osc_makes_hprpc(struct osc_object *obj) return !list_empty(&obj->oo_hp_exts); } -static void on_list(struct list_head *item, struct list_head *list, int should_be_on) +static void on_list(struct list_head *item, struct list_head *list, + int should_be_on) { if (list_empty(item) && should_be_on) list_add_tail(item, list); diff --git a/drivers/staging/lustre/lustre/osc/osc_cl_internal.h b/drivers/staging/lustre/lustre/osc/osc_cl_internal.h index 270212f..252c664 100644 --- a/drivers/staging/lustre/lustre/osc/osc_cl_internal.h +++ b/drivers/staging/lustre/lustre/osc/osc_cl_internal.h @@ -138,7 +138,9 @@ struct osc_object { * Manage write(dirty) extents. */ struct list_head oo_hp_exts; /* list of hp extents */ - struct list_head oo_urgent_exts; /* list of writeback extents */ + struct list_head oo_urgent_exts; /* list of writeback + * extents + */ struct list_head oo_rpc_exts; struct list_head oo_reading_exts; diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c index 922d0cb..cd306a0 100644 --- a/drivers/staging/lustre/lustre/osc/osc_request.c +++ b/drivers/staging/lustre/lustre/osc/osc_request.c @@ -1229,7 +1229,7 @@ static int check_write_checksum(struct obdo *oa, LCONSOLE_ERROR_MSG(0x132, "BAD WRITE CHECKSUM: %s: from %s inode " DFID " object " DOSTID " extent [%llu-%llu]\n", msg, libcfs_nid2str(peer->nid), - oa->o_valid & OBD_MD_FLFID ? oa->o_parent_seq : (__u64)0, + oa->o_valid & OBD_MD_FLFID ? oa->o_parent_seq : 0ULL, oa->o_valid & OBD_MD_FLFID ? oa->o_parent_oid : 0, oa->o_valid & OBD_MD_FLFID ? oa->o_parent_ver : 0, POSTID(&oa->o_oi), pga[0]->off, @@ -1266,7 +1266,9 @@ static int osc_brw_fini_request(struct ptlrpc_request *req, int rc) /* set/clear over quota flag for a uid/gid */ if (lustre_msg_get_opc(req->rq_reqmsg) == OST_WRITE && body->oa.o_valid & (OBD_MD_FLUSRQUOTA | OBD_MD_FLGRPQUOTA)) { - unsigned int qid[MAXQUOTAS] = { body->oa.o_uid, body->oa.o_gid }; + unsigned int qid[MAXQUOTAS] = { + body->oa.o_uid, body->oa.o_gid + }; CDEBUG(D_QUOTA, "setdq for [%u %u] with valid %#llx, flags %x\n", body->oa.o_uid, body->oa.o_gid, body->oa.o_valid, @@ -1431,10 +1433,11 @@ static int osc_brw_redo_request(struct ptlrpc_request *request, /* cap resend delay to the current request timeout, this is similar to * what ptlrpc does (see after_reply()) */ + new_req->rq_sent = ktime_get_real_seconds(); if (aa->aa_resends > new_req->rq_timeout) - new_req->rq_sent = ktime_get_real_seconds() + new_req->rq_timeout; + new_req->rq_sent += new_req->rq_timeout; else - new_req->rq_sent = ktime_get_real_seconds() + aa->aa_resends; + new_req->rq_sent += aa->aa_resends; new_req->rq_generation_set = 1; new_req->rq_import_generation = request->rq_import_generation; @@ -1486,7 +1489,8 @@ static void sort_brw_pages(struct brw_page **array, int num) for (i = stride ; i < num ; i++) { tmp = array[i]; j = i; - while (j >= stride && array[j - stride]->off > tmp->off) { + while (array[j - stride]->off > tmp->off && + j >= stride) { array[j] = array[j - stride]; j -= stride; } diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c index 1c77792..532fbdd 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/client.c +++ b/drivers/staging/lustre/lustre/ptlrpc/client.c @@ -196,8 +196,8 @@ struct ptlrpc_bulk_desc *ptlrpc_prep_bulk_imp(struct ptlrpc_request *req, } EXPORT_SYMBOL(ptlrpc_prep_bulk_imp); -void __ptlrpc_prep_bulk_page(struct ptlrpc_bulk_desc *desc, - struct page *page, int pageoffset, int len, int pin) +void __ptlrpc_prep_bulk_page(struct ptlrpc_bulk_desc *desc, struct page *page, + int pageoffset, int len, int pin) { struct bio_vec *kiov; @@ -336,7 +336,8 @@ static void ptlrpc_at_adj_service(struct ptlrpc_request *req, oldse = at_measured(&at->iat_service_estimate[idx], serv_est); if (oldse != 0) CDEBUG(D_ADAPTTO, "The RPC service estimate for %s ptl %d has changed from %d to %d\n", - req->rq_import->imp_obd->obd_name, req->rq_request_portal, + req->rq_import->imp_obd->obd_name, + req->rq_request_portal, oldse, at_get(&at->iat_service_estimate[idx])); } @@ -1138,7 +1139,9 @@ static int ptlrpc_import_delay_req(struct obd_import *imp, D_HA : D_ERROR, req, "IMP_CLOSED "); *status = -EIO; } else if (ptlrpc_send_limit_expired(req)) { - /* probably doesn't need to be a D_ERROR after initial testing */ + /* probably doesn't need to be a D_ERROR after initial + * testing + */ DEBUG_REQ(D_HA, req, "send limit expired "); *status = -ETIMEDOUT; } else if (req->rq_send_state == LUSTRE_IMP_CONNECTING && @@ -1840,7 +1843,9 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set) spin_unlock(&req->rq_lock); if (req->rq_timedout || req->rq_resend) { - /* This is re-sending anyway, let's mark req as resend. */ + /* This is re-sending anyway, + * let's mark req as resend. + */ spin_lock(&req->rq_lock); req->rq_resend = 1; spin_unlock(&req->rq_lock); @@ -2296,8 +2301,8 @@ int ptlrpc_set_wait(struct ptlrpc_request_set *set) lwi = LWI_TIMEOUT(cfs_time_seconds(timeout ? timeout : 1), ptlrpc_expired_set, set); - rc = l_wait_event(set->set_waitq, ptlrpc_check_set(NULL, set), &lwi); - + rc = l_wait_event(set->set_waitq, ptlrpc_check_set(NULL, set), + &lwi); /* * LU-769 - if we ignored the signal because it was already * pending when we started, we need to handle it now or we risk @@ -3075,7 +3080,7 @@ void ptlrpc_init_xid(void) } /* Always need to be aligned to a power-of-two for multi-bulk BRW */ - BUILD_BUG_ON(((PTLRPC_BULK_OPS_COUNT - 1) & PTLRPC_BULK_OPS_COUNT) != 0); + BUILD_BUG_ON((PTLRPC_BULK_OPS_COUNT - 1) & PTLRPC_BULK_OPS_COUNT); ptlrpc_last_xid &= PTLRPC_BULK_OPS_MASK; } diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c b/drivers/staging/lustre/lustre/ptlrpc/import.c index 52cb1f0..f08879a 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/import.c +++ b/drivers/staging/lustre/lustre/ptlrpc/import.c @@ -159,6 +159,7 @@ int ptlrpc_set_import_discon(struct obd_import *imp, __u32 conn_cnt) if (imp->imp_state == LUSTRE_IMP_FULL && (conn_cnt == 0 || conn_cnt == imp->imp_conn_cnt)) { + char *nid = libcfs_nid2str(imp->imp_connection->c_peer.nid); char *target_start; int target_len; @@ -167,13 +168,12 @@ int ptlrpc_set_import_discon(struct obd_import *imp, __u32 conn_cnt) if (imp->imp_replayable) { LCONSOLE_WARN("%s: Connection to %.*s (at %s) was lost; in progress operations using this service will wait for recovery to complete\n", - imp->imp_obd->obd_name, target_len, target_start, - libcfs_nid2str(imp->imp_connection->c_peer.nid)); + imp->imp_obd->obd_name, target_len, + target_start, nid); } else { LCONSOLE_ERROR_MSG(0x166, "%s: Connection to %.*s (at %s) was lost; in progress operations using this service will fail\n", imp->imp_obd->obd_name, - target_len, target_start, - libcfs_nid2str(imp->imp_connection->c_peer.nid)); + target_len, target_start, nid); } IMPORT_SET_STATE_NOLOCK(imp, LUSTRE_IMP_DISCON); spin_unlock(&imp->imp_lock); diff --git a/drivers/staging/lustre/lustre/ptlrpc/layout.c b/drivers/staging/lustre/lustre/ptlrpc/layout.c index 5810bba..55ab12d 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/layout.c +++ b/drivers/staging/lustre/lustre/ptlrpc/layout.c @@ -1022,8 +1022,8 @@ struct req_msg_field RMF_LAYOUT_INTENT = * OST request field. */ struct req_msg_field RMF_OST_BODY = - DEFINE_MSGF("ost_body", 0, - sizeof(struct ost_body), lustre_swab_ost_body, dump_ost_body); + DEFINE_MSGF("ost_body", 0, sizeof(struct ost_body), + lustre_swab_ost_body, dump_ost_body); EXPORT_SYMBOL(RMF_OST_BODY); struct req_msg_field RMF_OBD_IOOBJ = @@ -2142,9 +2142,10 @@ void req_capsule_extend(struct req_capsule *pill, const struct req_format *fmt) for (i = 0; i < RCL_NR; ++i) { LASSERT(fmt->rf_fields[i].nr >= old->rf_fields[i].nr); for (j = 0; j < old->rf_fields[i].nr - 1; ++j) { - const struct req_msg_field *ofield = FMT_FIELD(old, i, j); + const struct req_msg_field *ofield; /* "opaque" fields can be transmogrified */ + ofield = FMT_FIELD(old, i, j); if (!ofield->rmf_swabber && (ofield->rmf_flags & ~RMF_F_NO_SIZE_CHECK) == 0 && (ofield->rmf_size == -1 || diff --git a/drivers/staging/lustre/lustre/ptlrpc/llog_client.c b/drivers/staging/lustre/lustre/ptlrpc/llog_client.c index 110d9f5..c3a0daf 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/llog_client.c +++ b/drivers/staging/lustre/lustre/ptlrpc/llog_client.c @@ -263,7 +263,8 @@ static int llog_client_read_header(const struct lu_env *env, int rc; LLOG_CLIENT_ENTRY(handle->lgh_ctxt, imp); - req = ptlrpc_request_alloc_pack(imp, &RQF_LLOG_ORIGIN_HANDLE_READ_HEADER, + req = ptlrpc_request_alloc_pack(imp, + &RQF_LLOG_ORIGIN_HANDLE_READ_HEADER, LUSTRE_LOG_VERSION, LLOG_ORIGIN_HANDLE_READ_HEADER); if (!req) { diff --git a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c index f874781..e874d0b 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +++ b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c @@ -289,7 +289,8 @@ static const char *ll_eopcode2str(__u32 opcode) const char __user *buffer, size_t count, loff_t *off) { - struct ptlrpc_service *svc = ((struct seq_file *)file->private_data)->private; + struct seq_file *seq = file->private_data; + struct ptlrpc_service *svc = seq->private; int bufpages; int val; int rc; @@ -635,7 +636,8 @@ static ssize_t ptlrpc_lprocfs_nrs_seq_write(struct file *file, const char __user *buffer, size_t count, loff_t *off) { - struct ptlrpc_service *svc = ((struct seq_file *)file->private_data)->private; + struct seq_file *seq = file->private_data; + struct ptlrpc_service *svc = seq->private; enum ptlrpc_nrs_queue_type queue = PTLRPC_NRS_QUEUE_BOTH; char *cmd; char *cmd_copy = NULL; @@ -1184,7 +1186,8 @@ void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd) int lprocfs_wr_ping(struct file *file, const char __user *buffer, size_t count, loff_t *off) { - struct obd_device *obd = ((struct seq_file *)file->private_data)->private; + struct seq_file *seq = file->private_data; + struct obd_device *obd = seq->private; struct ptlrpc_request *req; int rc; @@ -1215,7 +1218,8 @@ int lprocfs_wr_ping(struct file *file, const char __user *buffer, int lprocfs_wr_import(struct file *file, const char __user *buffer, size_t count, loff_t *off) { - struct obd_device *obd = ((struct seq_file *)file->private_data)->private; + struct seq_file *seq = file->private_data; + struct obd_device *obd = seq->private; struct obd_import *imp = obd->u.cli.cl_import; char *kbuf = NULL; char *uuid; @@ -1296,7 +1300,8 @@ int lprocfs_rd_pinger_recov(struct seq_file *m, void *n) int lprocfs_wr_pinger_recov(struct file *file, const char __user *buffer, size_t count, loff_t *off) { - struct obd_device *obd = ((struct seq_file *)file->private_data)->private; + struct seq_file *seq = file->private_data; + struct obd_device *obd = seq->private; struct client_obd *cli = &obd->u.cli; struct obd_import *imp = cli->cl_import; int rc, val; diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec.c b/drivers/staging/lustre/lustre/ptlrpc/sec.c index 366f2ce..8c608bb 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec.c @@ -517,7 +517,8 @@ static int sptlrpc_req_replace_dead_ctx(struct ptlrpc_request *req) set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(msecs_to_jiffies(MSEC_PER_SEC)); - } else if (unlikely(!test_bit(PTLRPC_CTX_UPTODATE_BIT, &newctx->cc_flags))) { + } else if (unlikely(!test_bit(PTLRPC_CTX_UPTODATE_BIT, + &newctx->cc_flags))) { /* * new ctx not up to date yet */ -- 1.8.3.1 From jsimmons at infradead.org Wed Jun 14 15:01:17 2017 From: jsimmons at infradead.org (James Simmons) Date: Wed, 14 Jun 2017 11:01:17 -0400 Subject: [lustre-devel] [PATCH 2/6] staging: lustre: lustre: make all struct file_operations constant In-Reply-To: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> Message-ID: <1497452481-31124-3-git-send-email-jsimmons@infradead.org> Checkpatch reported several cases of struct file_operations not being const. This resolves those warnings. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/fld/lproc_fld.c | 2 +- drivers/staging/lustre/lustre/include/lprocfs_status.h | 8 ++++---- drivers/staging/lustre/lustre/llite/file.c | 6 +++--- drivers/staging/lustre/lustre/llite/llite_internal.h | 8 ++++---- drivers/staging/lustre/lustre/llite/lproc_llite.c | 6 +++--- drivers/staging/lustre/lustre/lov/lov_pool.c | 2 +- drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/staging/lustre/lustre/fld/lproc_fld.c b/drivers/staging/lustre/lustre/fld/lproc_fld.c index 61ac420..b83d7eb 100644 --- a/drivers/staging/lustre/lustre/fld/lproc_fld.c +++ b/drivers/staging/lustre/lustre/fld/lproc_fld.c @@ -136,7 +136,7 @@ return 0; } -static struct file_operations fld_debugfs_cache_flush_fops = { +static const struct file_operations fld_debugfs_cache_flush_fops = { .owner = THIS_MODULE, .open = simple_open, .write = fld_debugfs_cache_flush_write, diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h index 242abb8..1e68c77 100644 --- a/drivers/staging/lustre/lustre/include/lprocfs_status.h +++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h @@ -49,7 +49,7 @@ struct lprocfs_vars { const char *name; - struct file_operations *fops; + const struct file_operations *fops; void *data; /** * sysfs file mode. @@ -449,7 +449,7 @@ void lprocfs_counter_init(struct lprocfs_stats *stats, int index, struct dentry *ldebugfs_add_simple(struct dentry *root, char *name, void *data, - struct file_operations *fops); + const struct file_operations *fops); int ldebugfs_register_stats(struct dentry *parent, const char *name, @@ -536,7 +536,7 @@ void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx, { \ return single_open(file, name##_seq_show, inode->i_private); \ } \ -static struct file_operations name##_fops = { \ +static const struct file_operations name##_fops = { \ .owner = THIS_MODULE, \ .open = name##_single_open, \ .read = seq_read, \ @@ -581,7 +581,7 @@ void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx, { \ return single_open(file, NULL, inode->i_private); \ } \ - static struct file_operations name##_##type##_fops = { \ + static const struct file_operations name##_##type##_fops = { \ .open = name##_##type##_open, \ .write = name##_##type##_write, \ .release = lprocfs_single_release, \ diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 711fbb0..ab1c85c 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -3114,7 +3114,7 @@ int ll_inode_permission(struct inode *inode, int mask) } /* -o localflock - only provides locally consistent flock locks */ -struct file_operations ll_file_operations = { +const struct file_operations ll_file_operations = { .read_iter = ll_file_read_iter, .write_iter = ll_file_write_iter, .unlocked_ioctl = ll_file_ioctl, @@ -3127,7 +3127,7 @@ struct file_operations ll_file_operations = { .flush = ll_flush }; -struct file_operations ll_file_operations_flock = { +const struct file_operations ll_file_operations_flock = { .read_iter = ll_file_read_iter, .write_iter = ll_file_write_iter, .unlocked_ioctl = ll_file_ioctl, @@ -3143,7 +3143,7 @@ struct file_operations ll_file_operations_flock = { }; /* These are for -o noflock - to return ENOSYS on flock calls */ -struct file_operations ll_file_operations_noflock = { +const struct file_operations ll_file_operations_noflock = { .read_iter = ll_file_read_iter, .write_iter = ll_file_write_iter, .unlocked_ioctl = ll_file_ioctl, diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index de09ddf..41a0c8d 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -470,7 +470,7 @@ struct ll_sb_info { struct ll_ra_info ll_ra_info; unsigned int ll_namelen; - struct file_operations *ll_fop; + const struct file_operations *ll_fop; unsigned int ll_md_brw_pages; /* readdir pages per RPC */ @@ -736,9 +736,9 @@ int ll_md_blocking_ast(struct ldlm_lock *, struct ldlm_lock_desc *, extern const struct address_space_operations ll_aops; /* llite/file.c */ -extern struct file_operations ll_file_operations; -extern struct file_operations ll_file_operations_flock; -extern struct file_operations ll_file_operations_noflock; +extern const struct file_operations ll_file_operations; +extern const struct file_operations ll_file_operations_flock; +extern const struct file_operations ll_file_operations_noflock; extern const struct inode_operations ll_file_inode_operations; int ll_have_md_lock(struct inode *inode, __u64 *bits, enum ldlm_mode l_req_mode); diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c b/drivers/staging/lustre/lustre/llite/lproc_llite.c index c742cba..aeae667 100644 --- a/drivers/staging/lustre/lustre/llite/lproc_llite.c +++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c @@ -39,9 +39,9 @@ #include "vvp_internal.h" /* debugfs llite mount point registration */ -static struct file_operations ll_rw_extents_stats_fops; -static struct file_operations ll_rw_extents_stats_pp_fops; -static struct file_operations ll_rw_offset_stats_fops; +static const struct file_operations ll_rw_extents_stats_fops; +static const struct file_operations ll_rw_extents_stats_pp_fops; +static const struct file_operations ll_rw_offset_stats_fops; static ssize_t blocksize_show(struct kobject *kobj, struct attribute *attr, char *buf) diff --git a/drivers/staging/lustre/lustre/lov/lov_pool.c b/drivers/staging/lustre/lustre/lov/lov_pool.c index 1952bbd..39daa17 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pool.c +++ b/drivers/staging/lustre/lustre/lov/lov_pool.c @@ -286,7 +286,7 @@ static int pool_proc_open(struct inode *inode, struct file *file) return rc; } -static struct file_operations pool_proc_operations = { +static const struct file_operations pool_proc_operations = { .open = pool_proc_open, .read = seq_read, .llseek = seq_lseek, diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c index 6d1caed0..bc19f19 100644 --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c @@ -301,7 +301,7 @@ int lprocfs_seq_release(struct inode *inode, struct file *file) struct dentry *ldebugfs_add_simple(struct dentry *root, char *name, void *data, - struct file_operations *fops) + const struct file_operations *fops) { struct dentry *entry; umode_t mode = 0; -- 1.8.3.1 From jsimmons at infradead.org Wed Jun 14 15:01:19 2017 From: jsimmons at infradead.org (James Simmons) Date: Wed, 14 Jun 2017 11:01:19 -0400 Subject: [lustre-devel] [PATCH 4/6] staging: lustre: lustre: add all missing indentifier names In-Reply-To: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> Message-ID: <1497452481-31124-5-git-send-email-jsimmons@infradead.org> Create identifier names missing from function prototypes as reported by checkpatch. Signed-off-by: James Simmons --- .../staging/lustre/lustre/include/lprocfs_status.h | 4 ++-- drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 27 ++++++++++++---------- .../staging/lustre/lustre/llite/llite_internal.h | 14 +++++------ drivers/staging/lustre/lustre/lmv/lmv_obd.c | 2 +- .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h | 4 ++-- 5 files changed, 27 insertions(+), 24 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h index 1e68c77..915283c 100644 --- a/drivers/staging/lustre/lustre/include/lprocfs_status.h +++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h @@ -523,8 +523,8 @@ char *lprocfs_find_named_value(const char *buffer, const char *name, void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx, struct lprocfs_counter *cnt); -int lprocfs_single_release(struct inode *, struct file *); -int lprocfs_seq_release(struct inode *, struct file *); +int lprocfs_single_release(struct inode *inode, struct file *file); +int lprocfs_seq_release(struct inode *inode, struct file *file); /* write the name##_seq_show function, call LPROC_SEQ_FOPS_RO for read-only * proc entries; otherwise, you will define name##_seq_write function also for diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h index 5d24b48..ec3b23c 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h @@ -79,11 +79,11 @@ static inline int ldlm_ns_empty(struct ldlm_namespace *ns) return atomic_read(&ns->ns_bref) == 0; } -void ldlm_namespace_move_to_active_locked(struct ldlm_namespace *, - enum ldlm_side); -void ldlm_namespace_move_to_inactive_locked(struct ldlm_namespace *, - enum ldlm_side); -struct ldlm_namespace *ldlm_namespace_first_locked(enum ldlm_side); +void ldlm_namespace_move_to_active_locked(struct ldlm_namespace *ns, + enum ldlm_side client); +void ldlm_namespace_move_to_inactive_locked(struct ldlm_namespace *ns, + enum ldlm_side client); +struct ldlm_namespace *ldlm_namespace_first_locked(enum ldlm_side client); /* ldlm_request.c */ /* Cancel lru flag, it indicates we cancel aged locks. */ @@ -130,16 +130,19 @@ enum ldlm_desc_ast_t { int ldlm_fill_lvb(struct ldlm_lock *lock, struct req_capsule *pill, enum req_location loc, void *data, int size); struct ldlm_lock * -ldlm_lock_create(struct ldlm_namespace *ns, const struct ldlm_res_id *, +ldlm_lock_create(struct ldlm_namespace *ns, const struct ldlm_res_id *id, enum ldlm_type type, enum ldlm_mode mode, const struct ldlm_callback_suite *cbs, void *data, __u32 lvb_len, enum lvb_type lvb_type); -enum ldlm_error ldlm_lock_enqueue(struct ldlm_namespace *, struct ldlm_lock **, - void *cookie, __u64 *flags); -void ldlm_lock_addref_internal(struct ldlm_lock *, enum ldlm_mode mode); -void ldlm_lock_addref_internal_nolock(struct ldlm_lock *, enum ldlm_mode mode); -void ldlm_lock_decref_internal(struct ldlm_lock *, enum ldlm_mode mode); -void ldlm_lock_decref_internal_nolock(struct ldlm_lock *, enum ldlm_mode mode); +enum ldlm_error ldlm_lock_enqueue(struct ldlm_namespace *ns, + struct ldlm_lock **lock, void *cookie, + __u64 *flags); +void ldlm_lock_addref_internal(struct ldlm_lock *lock, enum ldlm_mode mode); +void ldlm_lock_addref_internal_nolock(struct ldlm_lock *lock, + enum ldlm_mode mode); +void ldlm_lock_decref_internal(struct ldlm_lock *lock, enum ldlm_mode mode); +void ldlm_lock_decref_internal_nolock(struct ldlm_lock *lock, + enum ldlm_mode mode); int ldlm_run_ast_work(struct ldlm_namespace *ns, struct list_head *rpc_list, enum ldlm_desc_ast_t ast_type); int ldlm_lock_remove_from_lru_check(struct ldlm_lock *lock, time_t last_use); diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index 41a0c8d..cd3311a 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -718,14 +718,14 @@ struct page *ll_get_dir_page(struct inode *dir, struct md_op_data *op_data, struct inode *ll_iget(struct super_block *sb, ino_t hash, struct lustre_md *lic); int ll_test_inode_by_fid(struct inode *inode, void *opaque); -int ll_md_blocking_ast(struct ldlm_lock *, struct ldlm_lock_desc *, +int ll_md_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, void *data, int flag); struct dentry *ll_splice_alias(struct inode *inode, struct dentry *de); void ll_update_times(struct ptlrpc_request *request, struct inode *inode); /* llite/rw.c */ int ll_writepage(struct page *page, struct writeback_control *wbc); -int ll_writepages(struct address_space *, struct writeback_control *wbc); +int ll_writepages(struct address_space *mapping, struct writeback_control *wbc); int ll_readpage(struct file *file, struct page *page); void ll_readahead_init(struct inode *inode, struct ll_readahead_state *ras); int vvp_io_write_commit(const struct lu_env *env, struct cl_io *io); @@ -747,7 +747,7 @@ enum ldlm_mode ll_take_md_lock(struct inode *inode, __u64 bits, enum ldlm_mode mode); int ll_file_open(struct inode *inode, struct file *file); int ll_file_release(struct inode *inode, struct file *file); -int ll_release_openhandle(struct inode *, struct lookup_intent *); +int ll_release_openhandle(struct inode *inode, struct lookup_intent *it); int ll_md_real_close(struct inode *inode, fmode_t fmode); int ll_getattr(const struct path *path, struct kstat *stat, u32 request_mask, unsigned int flags); @@ -778,9 +778,9 @@ int ll_dir_getstripe(struct inode *inode, void **lmmp, int *lmm_size, /* llite/dcache.c */ extern const struct dentry_operations ll_d_ops; -void ll_intent_drop_lock(struct lookup_intent *); -void ll_intent_release(struct lookup_intent *); -void ll_invalidate_aliases(struct inode *); +void ll_intent_drop_lock(struct lookup_intent *it); +void ll_intent_release(struct lookup_intent *it); +void ll_invalidate_aliases(struct inode *inode); void ll_lookup_finish_locks(struct lookup_intent *it, struct inode *inode); int ll_revalidate_it_finish(struct ptlrpc_request *request, struct lookup_intent *it, struct inode *inode); @@ -811,7 +811,7 @@ int ll_iocontrol(struct inode *inode, struct file *file, int ll_show_options(struct seq_file *seq, struct dentry *dentry); void ll_dirty_page_discard_warn(struct page *page, int ioret); int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req, - struct super_block *, struct lookup_intent *); + struct super_block *sb, struct lookup_intent *it); int ll_obd_statfs(struct inode *inode, void __user *arg); int ll_get_max_mdsize(struct ll_sb_info *sbi, int *max_mdsize); int ll_get_default_mdsize(struct ll_sb_info *sbi, int *default_mdsize); diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index 63a10a9..64fcaef 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -75,7 +75,7 @@ static void lmv_activate_target(struct lmv_obd *lmv, static int lmv_set_mdc_active(struct lmv_obd *lmv, const struct obd_uuid *uuid, int activate) { - struct lmv_tgt_desc *uninitialized_var(tgt); + struct lmv_tgt_desc *tgt = NULL; struct obd_device *obd; u32 i; int rc = 0; diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h index d2707a3..c38e166 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h +++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h @@ -68,7 +68,7 @@ struct ptlrpc_bulk_desc *ptlrpc_new_bulk(unsigned int nfrags, void ptlrpc_set_add_new_req(struct ptlrpcd_ctl *pc, struct ptlrpc_request *req); int ptlrpc_expired_set(void *data); -int ptlrpc_set_next_timeout(struct ptlrpc_request_set *); +int ptlrpc_set_next_timeout(struct ptlrpc_request_set *set); void ptlrpc_resend_req(struct ptlrpc_request *request); void ptlrpc_set_bulk_mbits(struct ptlrpc_request *req); void ptlrpc_assign_next_xid_nolock(struct ptlrpc_request *req); @@ -79,7 +79,7 @@ void ptlrpc_set_add_new_req(struct ptlrpcd_ctl *pc, int ptlrpc_init_portals(void); void ptlrpc_exit_portals(void); -void ptlrpc_request_handle_notconn(struct ptlrpc_request *); +void ptlrpc_request_handle_notconn(struct ptlrpc_request *req); void lustre_assert_wire_constants(void); int ptlrpc_import_in_recovery(struct obd_import *imp); int ptlrpc_set_import_discon(struct obd_import *imp, __u32 conn_cnt); -- 1.8.3.1 From jsimmons at infradead.org Wed Jun 14 15:01:21 2017 From: jsimmons at infradead.org (James Simmons) Date: Wed, 14 Jun 2017 11:01:21 -0400 Subject: [lustre-devel] [PATCH 6/6] staging: lustre: lustre: fix all braces issues reported by checkpatch In-Reply-To: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> Message-ID: <1497452481-31124-7-git-send-email-jsimmons@infradead.org> Cleanup all braces that was reported by checkpatch. The only issue not fixed up is in mdc_lock.c. Removing the braces in the case of mdc_lock.c will break the build. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/fld/fld_cache.c | 3 ++- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 9 +++++---- drivers/staging/lustre/lustre/llite/vvp_dev.c | 5 +++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/staging/lustre/lustre/fld/fld_cache.c b/drivers/staging/lustre/lustre/fld/fld_cache.c index b852fed..adaa094 100644 --- a/drivers/staging/lustre/lustre/fld/fld_cache.c +++ b/drivers/staging/lustre/lustre/fld/fld_cache.c @@ -348,9 +348,10 @@ static void fld_cache_overlap_handle(struct fld_cache *cache, f_curr->fce_range.lsr_end = new_start; fld_cache_entry_add(cache, f_new, &f_curr->fce_list); - } else + } else { CERROR("NEW range =" DRANGE " curr = " DRANGE "\n", PRANGE(range), PRANGE(&f_curr->fce_range)); + } } struct fld_cache_entry diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c index 8599134..f47343a 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c @@ -1029,11 +1029,11 @@ void ldlm_grant_lock(struct ldlm_lock *lock, struct list_head *work_list) if (work_list && lock->l_completion_ast) ldlm_add_ast_work_item(lock, NULL, work_list); - if (res->lr_type == LDLM_PLAIN || res->lr_type == LDLM_IBITS) + if (res->lr_type == LDLM_PLAIN || res->lr_type == LDLM_IBITS) { ldlm_grant_lock_with_skiplist(lock); - else if (res->lr_type == LDLM_EXTENT) + } else if (res->lr_type == LDLM_EXTENT) { ldlm_extent_add_lock(res, lock); - else if (res->lr_type == LDLM_FLOCK) { + } else if (res->lr_type == LDLM_FLOCK) { /* * We should not add locks to granted list in the following * cases: @@ -1046,8 +1046,9 @@ void ldlm_grant_lock(struct ldlm_lock *lock, struct list_head *work_list) ldlm_is_test_lock(lock) || ldlm_is_flock_deadlock(lock)) return; ldlm_resource_add_lock(res, &res->lr_granted, lock); - } else + } else { LBUG(); + } ldlm_pool_add(&ldlm_res_to_ns(res)->ns_pool, lock); } diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c b/drivers/staging/lustre/lustre/llite/vvp_dev.c index 8e45672..2b60699 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_dev.c +++ b/drivers/staging/lustre/lustre/llite/vvp_dev.c @@ -591,9 +591,10 @@ static void *vvp_pgcache_start(struct seq_file *f, loff_t *pos) env = cl_env_get(&refcheck); if (!IS_ERR(env)) { sbi = f->private; - if (sbi->ll_site->ls_obj_hash->hs_cur_bits > 64 - PGC_OBJ_SHIFT) + if (sbi->ll_site->ls_obj_hash->hs_cur_bits > + 64 - PGC_OBJ_SHIFT) { pos = ERR_PTR(-EFBIG); - else { + } else { *pos = vvp_pgcache_find(env, &sbi->ll_cl->cd_lu_dev, *pos); if (*pos == ~0ULL) -- 1.8.3.1 From jsimmons at infradead.org Wed Jun 14 15:01:18 2017 From: jsimmons at infradead.org (James Simmons) Date: Wed, 14 Jun 2017 11:01:18 -0400 Subject: [lustre-devel] [PATCH 3/6] staging: lustre: lustre: fix all bare unsigned usage In-Reply-To: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> Message-ID: <1497452481-31124-4-git-send-email-jsimmons@infradead.org> Turn all bare unsigned usage in the lustre code to proper unsigned int. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/include/cl_object.h | 4 ++-- drivers/staging/lustre/lustre/include/lu_object.h | 4 ++-- drivers/staging/lustre/lustre/llite/namei.c | 2 +- drivers/staging/lustre/lustre/llite/rw26.c | 2 +- drivers/staging/lustre/lustre/llite/vvp_dev.c | 6 +++--- drivers/staging/lustre/lustre/osc/osc_cache.c | 6 +++--- drivers/staging/lustre/lustre/osc/osc_internal.h | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/cl_object.h b/drivers/staging/lustre/lustre/include/cl_object.h index 2bc3ee5..90a0c50 100644 --- a/drivers/staging/lustre/lustre/include/cl_object.h +++ b/drivers/staging/lustre/lustre/include/cl_object.h @@ -1287,7 +1287,7 @@ struct cl_lock_operations { * @{ */ struct cl_page_list { - unsigned pl_nr; + unsigned int pl_nr; struct list_head pl_pages; struct task_struct *pl_owner; }; @@ -1842,7 +1842,7 @@ struct cl_io { /** * Number of pages owned by this IO. For invariant checking. */ - unsigned ci_owned_nr; + unsigned int ci_owned_nr; }; /** @} cl_io */ diff --git a/drivers/staging/lustre/lustre/include/lu_object.h b/drivers/staging/lustre/lustre/include/lu_object.h index 73ecc23..2e70602 100644 --- a/drivers/staging/lustre/lustre/include/lu_object.h +++ b/drivers/staging/lustre/lustre/include/lu_object.h @@ -968,11 +968,11 @@ struct lu_context { * Version counter used to skip calls to lu_context_refill() when no * keys were registered. */ - unsigned lc_version; + unsigned int lc_version; /** * Debugging cookie. */ - unsigned lc_cookie; + unsigned int lc_cookie; }; /** diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index 9f118a1..a208a8b 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -678,7 +678,7 @@ static struct dentry *ll_lookup_nd(struct inode *parent, struct dentry *dentry, * together. */ static int ll_atomic_open(struct inode *dir, struct dentry *dentry, - struct file *file, unsigned open_flags, + struct file *file, unsigned int open_flags, umode_t mode, int *opened) { struct lookup_intent *it; diff --git a/drivers/staging/lustre/lustre/llite/rw26.c b/drivers/staging/lustre/lustre/llite/rw26.c index 22dc6a5..3619cd8 100644 --- a/drivers/staging/lustre/lustre/llite/rw26.c +++ b/drivers/staging/lustre/lustre/llite/rw26.c @@ -547,7 +547,7 @@ static int ll_write_begin(struct file *file, struct address_space *mapping, } static int ll_write_end(struct file *file, struct address_space *mapping, - loff_t pos, unsigned len, unsigned copied, + loff_t pos, unsigned int len, unsigned int copied, struct page *vmpage, void *fsdata) { struct ll_cl_context *lcc = fsdata; diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c b/drivers/staging/lustre/lustre/llite/vvp_dev.c index 6cb2db2..8e45672 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_dev.c +++ b/drivers/staging/lustre/lustre/llite/vvp_dev.c @@ -381,11 +381,11 @@ int cl_sb_fini(struct super_block *sb) #define PGC_DEPTH_SHIFT (32) struct vvp_pgcache_id { - unsigned vpi_bucket; - unsigned vpi_depth; + unsigned int vpi_bucket; + unsigned int vpi_depth; uint32_t vpi_index; - unsigned vpi_curdep; + unsigned int vpi_curdep; struct lu_object_header *vpi_obj; }; diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c index 4db8116..d8a95f8 100644 --- a/drivers/staging/lustre/lustre/osc/osc_cache.c +++ b/drivers/staging/lustre/lustre/osc/osc_cache.c @@ -1889,10 +1889,10 @@ struct extent_rpc_data { unsigned int erd_max_chunks; }; -static inline unsigned osc_extent_chunks(const struct osc_extent *ext) +static inline unsigned int osc_extent_chunks(const struct osc_extent *ext) { struct client_obd *cli = osc_cli(ext->oe_obj); - unsigned ppc_bits = cli->cl_chunkbits - PAGE_SHIFT; + unsigned int ppc_bits = cli->cl_chunkbits - PAGE_SHIFT; return (ext->oe_end >> ppc_bits) - (ext->oe_start >> ppc_bits) + 1; } @@ -1950,7 +1950,7 @@ static int try_to_add_extent_for_io(struct client_obd *cli, return 1; } -static inline unsigned osc_max_write_chunks(const struct client_obd *cli) +static inline unsigned int osc_max_write_chunks(const struct client_obd *cli) { /* * LU-8135: diff --git a/drivers/staging/lustre/lustre/osc/osc_internal.h b/drivers/staging/lustre/lustre/osc/osc_internal.h index 845e795..13a40f6 100644 --- a/drivers/staging/lustre/lustre/osc/osc_internal.h +++ b/drivers/staging/lustre/lustre/osc/osc_internal.h @@ -62,7 +62,7 @@ struct osc_async_page { struct list_head oap_rpc_item; u64 oap_obj_off; - unsigned oap_page_off; + unsigned int oap_page_off; enum async_flags oap_async_flags; struct brw_page oap_brw_page; -- 1.8.3.1 From joe at perches.com Wed Jun 14 18:10:20 2017 From: joe at perches.com (Joe Perches) Date: Wed, 14 Jun 2017 11:10:20 -0700 Subject: [lustre-devel] [PATCH 1/6] staging: lustre: lustre: resolve "use spaces between elements" checkpatch errors In-Reply-To: <1497452481-31124-2-git-send-email-jsimmons@infradead.org> References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> <1497452481-31124-2-git-send-email-jsimmons@infradead.org> Message-ID: <1497463820.18751.57.camel@perches.com> On Wed, 2017-06-14 at 11:01 -0400, James Simmons wrote: > Due to the way the DFID was embedded in our debug strings checkpatch > would report the following error: unrelated trivia > diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h [] > @@ -532,7 +532,7 @@ static inline void obd_uuid2fsname(char *buf, char *uuid, int buflen) > #define FID_NOBRACE_LEN 40 > #define FID_LEN (FID_NOBRACE_LEN + 2) > #define DFID_NOBRACE "%#llx:0x%x:0x%x" It's odd to use a mixture of %#x and 0x%x. Using #define DFID_NOBRACE "%#llx:%#x:%#x" would also save a couple bytes per use. Does there need to be a difference between an SFID and a DFID_NOBRACE? From joe at perches.com Wed Jun 14 18:15:28 2017 From: joe at perches.com (Joe Perches) Date: Wed, 14 Jun 2017 11:15:28 -0700 Subject: [lustre-devel] [PATCH 5/6] staging: lustre: lustre: several over 80 characters cleanups In-Reply-To: <1497452481-31124-6-git-send-email-jsimmons@infradead.org> References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> <1497452481-31124-6-git-send-email-jsimmons@infradead.org> Message-ID: <1497464128.18751.59.camel@perches.com> On Wed, 2017-06-14 at 11:01 -0400, James Simmons wrote: > Cleanup many of the over 80 characters reported by checkpatch Please don't let checkpatch get in the way of lustre readability. lustre commonly uses very long identifiers. Long identifiers and 80 columns don't mix well. It might be simpler to declare in some document that lustre uses lines of up to whatever length and require that checkpatch should be used with the --max-line-length option when run on lustre code. From joe at perches.com Wed Jun 14 18:25:06 2017 From: joe at perches.com (Joe Perches) Date: Wed, 14 Jun 2017 11:25:06 -0700 Subject: [lustre-devel] [PATCH 6/6] staging: lustre: lustre: fix all braces issues reported by checkpatch In-Reply-To: <1497452481-31124-7-git-send-email-jsimmons@infradead.org> References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> <1497452481-31124-7-git-send-email-jsimmons@infradead.org> Message-ID: <1497464706.18751.62.camel@perches.com> On Wed, 2017-06-14 at 11:01 -0400, James Simmons wrote: > Cleanup all braces that was reported by checkpatch. The only > issue not fixed up is in mdc_lock.c. Removing the braces in > the case of mdc_lock.c will break the build. [] > diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c b/drivers/staging/lustre/lustre/llite/vvp_dev.c [] > @@ -591,9 +591,10 @@ static void *vvp_pgcache_start(struct seq_file *f, loff_t *pos) > env = cl_env_get(&refcheck); > if (!IS_ERR(env)) { > sbi = f->private; > - if (sbi->ll_site->ls_obj_hash->hs_cur_bits > 64 - PGC_OBJ_SHIFT) > + if (sbi->ll_site->ls_obj_hash->hs_cur_bits > > + 64 - PGC_OBJ_SHIFT) { > pos = ERR_PTR(-EFBIG); > - else { > + } else { > *pos = vvp_pgcache_find(env, &sbi->ll_cl->cd_lu_dev, > *pos); > if (*pos == ~0ULL) Sometimes is nicer to rearrange the code with smaller indentation by using early returns and/or goto . Something like: static void *vvp_pgcache_start(struct seq_file *f, loff_t *pos) { struct ll_sb_info *sbi; struct lu_env     *env; u16 refcheck; sbi = f->private; env = cl_env_get(&refcheck); if (IS_ERR(env)) return pos; sbi = f->private; if (sbi->ll_site->ls_obj_hash->hs_cur_bits > 64 - PGC_OBJ_SHIFT) { pos = ERR_PTR(-EFBIG); goto out; } *pos = vvp_pgcache_find(env, &sbi->ll_cl->cd_lu_dev, *pos); if (*pos == ~0ULL) pos = NULL; out: cl_env_put(env, &refcheck); return pos; } From jsimmons at infradead.org Thu Jun 15 15:48:20 2017 From: jsimmons at infradead.org (James Simmons) Date: Thu, 15 Jun 2017 16:48:20 +0100 (BST) Subject: [lustre-devel] [PATCH] staging: lustre: headers: potential UAPI headers In-Reply-To: <20170613042531.GB13308@kroah.com> References: <1482167207-22800-1-git-send-email-jsimmons@infradead.org> <20170103141248.GA8695@kroah.com> <20170117074140.GA19328@kroah.com> <20170121092459.GA29138@kroah.com> <32AAAA94-0C88-40F5-8FAD-37F35A401AC3@intel.com> <20170613042531.GB13308@kroah.com> Message-ID: > On Mon, Jun 12, 2017 at 08:20:15PM +0000, Dilger, Andreas wrote: > > On Jan 21, 2017, at 02:24, Greg Kroah-Hartman wrote: > > > > > > On Fri, Jan 20, 2017 at 11:33:11PM +0000, James Simmons wrote: > > >> > > >>>>> On Mon, Dec 19, 2016 at 12:06:47PM -0500, James Simmons wrote: > > >>>>>> Not for landing. This is the purposed UAPI headers > > >>>>>> with the removal of unlikely and debugging macros. > > >>>>>> This is just for feedback to see if this is acceptable > > >>>>>> for the upstream client. > > >>>>>> > > >>>>>> Signed-off-by: James Simmons > > >>>>>> --- > > >>>>>> .../lustre/lustre/include/lustre/lustre_fid.h | 353 +++++++++++++++++++++ > > >>>>>> .../lustre/lustre/include/lustre/lustre_ostid.h | 233 ++++++++++++++ > > >>>>> > > >>>>> Can you make a lustre "uapi" directory so we can see which files you > > >>>>> really want to be UAPI and which you don't as time goes on? > > I said that ^^^ > > > >>>> Where do you want them placed? In uapi/linux/lustre or uapi/lustre. Does > > >>>> it matter to you? The below was to forth coming UAPI headers which from > > >>>> your response you seem okay with in general. > > >>> > > >>> How many .h files are there going to be? It's just a single filesystem, > > >>> shouldn't you just need a single file? If so, how about > > >>> drivers/staging/lustre/include/uapi/lustre.h > > >>> ? > > >>> > > >>> If you really need multiple .h files, put them all in the same uapi/ > > >>> directory with a lustre_ prefix, you don't need a whole subdir just for > > >>> yourself, right? > > >> > > >> We have 12 UAPI headers and yes they all begin with lustre_*. Okay I will > > >> create a driver/staging/lustre/include/uapi/linux directory and start > > >> moving headers there. > > > > > > 12 seems like a lot just for a single, tiny, filesystem :) > > > > > > But moving them all to a single directory will see where we can later > > > merge them together, sounds like a good plan. > > > > Greg, > > are you really adamantly against moving the Lustre headers into their own lustre/ > > subdirectory? > > I did not say that. > > Please, when responding to 5 month old email messages, get your quoting > correct... So this is coming from trying to understand the "merge them together" part. Some people reading this it implies all the headers would be eventually merged into one big header and placed into include/uapi/linux. We are getting to the point where some sites are migrating from the out of tree branch to this client. This also means they will be moving external open source userland applications shortly. If we expose UAPI headers that are completely different that it breaks their tools users will dump this client and go back to the out source tree. We really like to avoid that. From jsimmons at infradead.org Thu Jun 15 16:03:53 2017 From: jsimmons at infradead.org (James Simmons) Date: Thu, 15 Jun 2017 17:03:53 +0100 (BST) Subject: [lustre-devel] [PATCH 1/6] staging: lustre: lustre: resolve "use spaces between elements" checkpatch errors In-Reply-To: <1497463820.18751.57.camel@perches.com> References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> <1497452481-31124-2-git-send-email-jsimmons@infradead.org> <1497463820.18751.57.camel@perches.com> Message-ID: > On Wed, 2017-06-14 at 11:01 -0400, James Simmons wrote: > > Due to the way the DFID was embedded in our debug strings checkpatch > > would report the following error: > > unrelated trivia > > > diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h > [] > > @@ -532,7 +532,7 @@ static inline void obd_uuid2fsname(char *buf, char *uuid, int buflen) > > #define FID_NOBRACE_LEN 40 > > #define FID_LEN (FID_NOBRACE_LEN + 2) > > #define DFID_NOBRACE "%#llx:0x%x:0x%x" > > It's odd to use a mixture of %#x and 0x%x. > > Using > #define DFID_NOBRACE "%#llx:%#x:%#x" > would also save a couple bytes per use. Changing that format would break things very badly. This is used in user land utilities and the kernel code. > Does there need to be a difference between an SFID > and a DFID_NOBRACE? From jsimmons at infradead.org Thu Jun 15 16:06:30 2017 From: jsimmons at infradead.org (James Simmons) Date: Thu, 15 Jun 2017 17:06:30 +0100 (BST) Subject: [lustre-devel] [PATCH 5/6] staging: lustre: lustre: several over 80 characters cleanups In-Reply-To: <1497464128.18751.59.camel@perches.com> References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> <1497452481-31124-6-git-send-email-jsimmons@infradead.org> <1497464128.18751.59.camel@perches.com> Message-ID: > On Wed, 2017-06-14 at 11:01 -0400, James Simmons wrote: > > Cleanup many of the over 80 characters reported by checkpatch > > Please don't let checkpatch get in the way of lustre > readability. > > lustre commonly uses very long identifiers. > Long identifiers and 80 columns don't mix well. > > It might be simpler to declare in some document that > lustre uses lines of up to whatever length and require > that checkpatch should be used with the --max-line-length > option when run on lustre code. Greg would you be okay with this? If we changed to a max-line-length to say 128 thay would mean very few checkpatch issues would remain. From joe at perches.com Thu Jun 15 16:12:14 2017 From: joe at perches.com (Joe Perches) Date: Thu, 15 Jun 2017 09:12:14 -0700 Subject: [lustre-devel] [PATCH 5/6] staging: lustre: lustre: several over 80 characters cleanups In-Reply-To: References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> <1497452481-31124-6-git-send-email-jsimmons@infradead.org> <1497464128.18751.59.camel@perches.com> Message-ID: <1497543134.14396.6.camel@perches.com> On Thu, 2017-06-15 at 17:06 +0100, James Simmons wrote: > > On Wed, 2017-06-14 at 11:01 -0400, James Simmons wrote: > > > Cleanup many of the over 80 characters reported by checkpatch > > > > Please don't let checkpatch get in the way of lustre > > readability. > > > > lustre commonly uses very long identifiers. > > Long identifiers and 80 columns don't mix well. > > > > It might be simpler to declare in some document that > > lustre uses lines of up to whatever length and require > > that checkpatch should be used with the --max-line-length > > option when run on lustre code. > > Greg would you be okay with this? I trust Greg isn't a zealot. Linus Torvalds has said he prefers a longer line length (up to 100 cols) https://lkml.org/lkml/2016/12/15/749 > If we changed to a max-line-length to > say 128 thay would mean very few checkpatch issues would remain. From joe at perches.com Thu Jun 15 16:19:44 2017 From: joe at perches.com (Joe Perches) Date: Thu, 15 Jun 2017 09:19:44 -0700 Subject: [lustre-devel] [PATCH 1/6] staging: lustre: lustre: resolve "use spaces between elements" checkpatch errors In-Reply-To: References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> <1497452481-31124-2-git-send-email-jsimmons@infradead.org> <1497463820.18751.57.camel@perches.com> Message-ID: <1497543584.14396.8.camel@perches.com> On Thu, 2017-06-15 at 17:03 +0100, James Simmons wrote: > > On Wed, 2017-06-14 at 11:01 -0400, James Simmons wrote: > > > Due to the way the DFID was embedded in our debug strings checkpatch > > > would report the following error: > > > > unrelated trivia > > > > > diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h > > > > [] > > > @@ -532,7 +532,7 @@ static inline void obd_uuid2fsname(char *buf, char *uuid, int buflen) > > > #define FID_NOBRACE_LEN 40 > > > #define FID_LEN (FID_NOBRACE_LEN + 2) > > > #define DFID_NOBRACE "%#llx:0x%x:0x%x" > > > > It's odd to use a mixture of %#x and 0x%x. > > > > Using > > #define DFID_NOBRACE "%#llx:%#x:%#x" > > would also save a couple bytes per use. > > Changing that format would break things very badly. This is used in user > land utilities and the kernel code. Really? Why would anything break? $ cat fmt.c #include #include int main(int argc, char **argv) { printf("%#llx:0x%x:0x%x\n", (unsigned long long)1, 2, 3); printf("%#llx:%#x:%#x\n", (unsigned long long)1, 2, 3); return 0; } $ gcc fmt.c $ ./a.out 0x1:0x2:0x3 0x1:0x2:0x3 From jsimmons at infradead.org Thu Jun 15 16:38:32 2017 From: jsimmons at infradead.org (James Simmons) Date: Thu, 15 Jun 2017 17:38:32 +0100 (BST) Subject: [lustre-devel] [PATCH 6/6] staging: lustre: lustre: fix all braces issues reported by checkpatch In-Reply-To: <1497464706.18751.62.camel@perches.com> References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> <1497452481-31124-7-git-send-email-jsimmons@infradead.org> <1497464706.18751.62.camel@perches.com> Message-ID: > On Wed, 2017-06-14 at 11:01 -0400, James Simmons wrote: > > Cleanup all braces that was reported by checkpatch. The only > > issue not fixed up is in mdc_lock.c. Removing the braces in > > the case of mdc_lock.c will break the build. > > [] > > > diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c b/drivers/staging/lustre/lustre/llite/vvp_dev.c > [] > > @@ -591,9 +591,10 @@ static void *vvp_pgcache_start(struct seq_file *f, loff_t *pos) > > env = cl_env_get(&refcheck); > > if (!IS_ERR(env)) { > > sbi = f->private; > > - if (sbi->ll_site->ls_obj_hash->hs_cur_bits > 64 - PGC_OBJ_SHIFT) > > + if (sbi->ll_site->ls_obj_hash->hs_cur_bits > > > + 64 - PGC_OBJ_SHIFT) { > > pos = ERR_PTR(-EFBIG); > > - else { > > + } else { > > *pos = vvp_pgcache_find(env, &sbi->ll_cl->cd_lu_dev, > > *pos); > > if (*pos == ~0ULL) > > Sometimes is nicer to rearrange the code with smaller > indentation by using early returns and/or goto . Do you mind if I submit a separate patch for this? It would be nice to land the current cleanups as is. Looking at the code I see where more simplication along this line can be done. I submitted a patch for our test harness: https://review.whamcloud.com/#/c/27664 In the near future it will be pushed here. > Something like: > > static void *vvp_pgcache_start(struct seq_file *f, loff_t *pos) > { > struct ll_sb_info *sbi; > struct lu_env     *env; > u16 refcheck; > > sbi = f->private; > > env = cl_env_get(&refcheck); > if (IS_ERR(env)) > return pos; > > sbi = f->private; > if (sbi->ll_site->ls_obj_hash->hs_cur_bits > 64 - PGC_OBJ_SHIFT) { > pos = ERR_PTR(-EFBIG); > goto out; > } > > *pos = vvp_pgcache_find(env, &sbi->ll_cl->cd_lu_dev, *pos); > if (*pos == ~0ULL) > pos = NULL; > > out: > cl_env_put(env, &refcheck); > > return pos; > } > > From gregkh at linuxfoundation.org Thu Jun 15 16:56:33 2017 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Thu, 15 Jun 2017 18:56:33 +0200 Subject: [lustre-devel] [PATCH] staging: lustre: headers: potential UAPI headers In-Reply-To: References: <1482167207-22800-1-git-send-email-jsimmons@infradead.org> <20170103141248.GA8695@kroah.com> <20170117074140.GA19328@kroah.com> <20170121092459.GA29138@kroah.com> <32AAAA94-0C88-40F5-8FAD-37F35A401AC3@intel.com> <20170613042531.GB13308@kroah.com> Message-ID: <20170615165633.GA4478@kroah.com> On Thu, Jun 15, 2017 at 04:48:20PM +0100, James Simmons wrote: > So this is coming from trying to understand the "merge them together" > part. Some people reading this it implies all the headers would be > eventually merged into one big header and placed into include/uapi/linux. Sounds like a good plan, why wouldn't you want something nice and simple like that? :) > We are getting to the point where some sites are migrating from the out > of tree branch to this client. This also means they will be moving > external open source userland applications shortly. If we expose UAPI > headers that are completely different that it breaks their tools users > will dump this client and go back to the out source tree. We really like > to avoid that. Note, as the code is still in staging, files will get renamed and moved around, you know that, nothing we can do here at the moment. I have yet to see any patches yet, so I don't know why people are complaining... thanks, greg k-h From jsimmons at infradead.org Thu Jun 15 16:57:14 2017 From: jsimmons at infradead.org (James Simmons) Date: Thu, 15 Jun 2017 17:57:14 +0100 (BST) Subject: [lustre-devel] [PATCH 1/6] staging: lustre: lustre: resolve "use spaces between elements" checkpatch errors In-Reply-To: <1497543584.14396.8.camel@perches.com> References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> <1497452481-31124-2-git-send-email-jsimmons@infradead.org> <1497463820.18751.57.camel@perches.com> <1497543584.14396.8.camel@perches.com> Message-ID: > On Thu, 2017-06-15 at 17:03 +0100, James Simmons wrote: > > > On Wed, 2017-06-14 at 11:01 -0400, James Simmons wrote: > > > > Due to the way the DFID was embedded in our debug strings checkpatch > > > > would report the following error: > > > > > > unrelated trivia > > > > > > > diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h > > > > > > [] > > > > @@ -532,7 +532,7 @@ static inline void obd_uuid2fsname(char *buf, char *uuid, int buflen) > > > > #define FID_NOBRACE_LEN 40 > > > > #define FID_LEN (FID_NOBRACE_LEN + 2) > > > > #define DFID_NOBRACE "%#llx:0x%x:0x%x" > > > > > > It's odd to use a mixture of %#x and 0x%x. > > > > > > Using > > > #define DFID_NOBRACE "%#llx:%#x:%#x" > > > would also save a couple bytes per use. > > > > Changing that format would break things very badly. This is used in user > > land utilities and the kernel code. > > Really? Why would anything break? It shouldn't break anything but I'm paranoid. In the past I have change "simple" things to have it blow up. I pushed the change to our test harness just to make sure. > $ cat fmt.c > #include > #include > > int main(int argc, char **argv) > { > printf("%#llx:0x%x:0x%x\n", (unsigned long long)1, 2, 3); > printf("%#llx:%#x:%#x\n", (unsigned long long)1, 2, 3); > return 0; > } > > $ gcc fmt.c > $ ./a.out > 0x1:0x2:0x3 > 0x1:0x2:0x3 > > From joe at perches.com Thu Jun 15 16:58:46 2017 From: joe at perches.com (Joe Perches) Date: Thu, 15 Jun 2017 09:58:46 -0700 Subject: [lustre-devel] [PATCH 6/6] staging: lustre: lustre: fix all braces issues reported by checkpatch In-Reply-To: References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> <1497452481-31124-7-git-send-email-jsimmons@infradead.org> <1497464706.18751.62.camel@perches.com> Message-ID: <1497545926.14396.11.camel@perches.com> On Thu, 2017-06-15 at 17:38 +0100, James Simmons wrote: > > On Wed, 2017-06-14 at 11:01 -0400, James Simmons wrote: > > > Cleanup all braces that was reported by checkpatch. The only > > > issue not fixed up is in mdc_lock.c. Removing the braces in > > > the case of mdc_lock.c will break the build. > > > > [] > > > > > diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c b/drivers/staging/lustre/lustre/llite/vvp_dev.c > > > > [] > > > @@ -591,9 +591,10 @@ static void *vvp_pgcache_start(struct seq_file *f, loff_t *pos) > > > env = cl_env_get(&refcheck); > > > if (!IS_ERR(env)) { > > > sbi = f->private; > > > - if (sbi->ll_site->ls_obj_hash->hs_cur_bits > 64 - PGC_OBJ_SHIFT) > > > + if (sbi->ll_site->ls_obj_hash->hs_cur_bits > > > > + 64 - PGC_OBJ_SHIFT) { > > > pos = ERR_PTR(-EFBIG); > > > - else { > > > + } else { > > > *pos = vvp_pgcache_find(env, &sbi->ll_cl->cd_lu_dev, > > > *pos); > > > if (*pos == ~0ULL) > > > > Sometimes is nicer to rearrange the code with smaller > > indentation by using early returns and/or goto . > > Do you mind if I submit a separate patch for this? > It would be nice to land the current cleanups as is. Of course not. > Looking at the code I see where more > simplication along this line can be done. I submitted a patch for our > test harness: Oh good. > In the near future it will be pushed here. Swell. One of the blocks in vvp_pgcache_show looks like it has asymmetric braces though. } else Perhaps you should be using the linux-next version of checkpatch which warns about this. And don't take any of what I wrote as a requirement. All were merely suggestions and could be implemented an appropriate time or ignored completely. From joe at perches.com Thu Jun 15 17:04:46 2017 From: joe at perches.com (Joe Perches) Date: Thu, 15 Jun 2017 10:04:46 -0700 Subject: [lustre-devel] [PATCH 1/6] staging: lustre: lustre: resolve "use spaces between elements" checkpatch errors In-Reply-To: References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> <1497452481-31124-2-git-send-email-jsimmons@infradead.org> <1497463820.18751.57.camel@perches.com> <1497543584.14396.8.camel@perches.com> Message-ID: <1497546286.14396.13.camel@perches.com> On Thu, 2017-06-15 at 17:57 +0100, James Simmons wrote: > > On Thu, 2017-06-15 at 17:03 +0100, James Simmons wrote: > > > > On Wed, 2017-06-14 at 11:01 -0400, James Simmons wrote: > > > > > Due to the way the DFID was embedded in our debug strings checkpatch > > > > > would report the following error: > > > > > > > > unrelated trivia > > > > > > > > > diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h > > > > > > > > [] > > > > > @@ -532,7 +532,7 @@ static inline void obd_uuid2fsname(char *buf, char *uuid, int buflen) > > > > > #define FID_NOBRACE_LEN 40 > > > > > #define FID_LEN (FID_NOBRACE_LEN + 2) > > > > > #define DFID_NOBRACE "%#llx:0x%x:0x%x" > > > > > > > > It's odd to use a mixture of %#x and 0x%x. > > > > > > > > Using > > > > #define DFID_NOBRACE "%#llx:%#x:%#x" > > > > would also save a couple bytes per use. > > > > > > Changing that format would break things very badly. This is used in user > > > land utilities and the kernel code. > > > > Really? Why would anything break? > > It shouldn't break anything but I'm paranoid. Which is an entirely different thing than writing "would break things very badly". Paranoia is fine, incorrect statements of fact like that less so. > In the past I have change > "simple" things to have it blow up. I pushed the change to our test > harness just to make sure. Understandable. cheers, Joe From jsimmons at infradead.org Thu Jun 15 17:16:38 2017 From: jsimmons at infradead.org (James Simmons) Date: Thu, 15 Jun 2017 18:16:38 +0100 (BST) Subject: [lustre-devel] [PATCH 1/6] staging: lustre: lustre: resolve "use spaces between elements" checkpatch errors In-Reply-To: <1497546286.14396.13.camel@perches.com> References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> <1497452481-31124-2-git-send-email-jsimmons@infradead.org> <1497463820.18751.57.camel@perches.com> <1497543584.14396.8.camel@perches.com> <1497546286.14396.13.camel@perches.com> Message-ID: > On Thu, 2017-06-15 at 17:57 +0100, James Simmons wrote: > > > On Thu, 2017-06-15 at 17:03 +0100, James Simmons wrote: > > > > > On Wed, 2017-06-14 at 11:01 -0400, James Simmons wrote: > > > > > > Due to the way the DFID was embedded in our debug strings checkpatch > > > > > > would report the following error: > > > > > > > > > > unrelated trivia > > > > > > > > > > > diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h > > > > > > > > > > [] > > > > > > @@ -532,7 +532,7 @@ static inline void obd_uuid2fsname(char *buf, char *uuid, int buflen) > > > > > > #define FID_NOBRACE_LEN 40 > > > > > > #define FID_LEN (FID_NOBRACE_LEN + 2) > > > > > > #define DFID_NOBRACE "%#llx:0x%x:0x%x" > > > > > > > > > > It's odd to use a mixture of %#x and 0x%x. > > > > > > > > > > Using > > > > > #define DFID_NOBRACE "%#llx:%#x:%#x" > > > > > would also save a couple bytes per use. > > > > > > > > Changing that format would break things very badly. This is used in user > > > > land utilities and the kernel code. > > > > > > Really? Why would anything break? > > > > It shouldn't break anything but I'm paranoid. > > Which is an entirely different thing than > writing "would break things very badly". > > Paranoia is fine, incorrect statements of fact > like that less so. Meant no offense. When you said "would also save a couple bytes per use" I took that as meaning it would change the data format. Should of tried it myself to see if that was the case. > > In the past I have change > > "simple" things to have it blow up. I pushed the change to our test > > harness just to make sure. > > Understandable. > > cheers, Joe > > From singhalsimran0 at gmail.com Tue Jun 20 09:06:37 2017 From: singhalsimran0 at gmail.com (simran singhal) Date: Tue, 20 Jun 2017 14:36:37 +0530 Subject: [lustre-devel] [PATCH] staging: lustre: lnet: selftest: Change the type of variable to bool Message-ID: <20170620090637.GA15837@singhal-Inspiron-5558> This patch changes the type of variable done from int to boolean. As it is been used as a boolean in the function sfw_test_rpc_done(). It also makes the code more readable and bool data type also requires less memory in comparison to int data type. Signed-off-by: simran singhal --- drivers/staging/lustre/lnet/selftest/framework.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c index ef27bff..3789df6 100644 --- a/drivers/staging/lustre/lnet/selftest/framework.c +++ b/drivers/staging/lustre/lnet/selftest/framework.c @@ -869,7 +869,7 @@ sfw_test_rpc_done(struct srpc_client_rpc *rpc) { struct sfw_test_unit *tsu = rpc->crpc_priv; struct sfw_test_instance *tsi = tsu->tsu_instance; - int done = 0; + bool done = false; tsi->tsi_ops->tso_done_rpc(tsu, rpc); @@ -883,7 +883,7 @@ sfw_test_rpc_done(struct srpc_client_rpc *rpc) /* batch is stopping or loop is done or get error */ if (tsi->tsi_stopping || !tsu->tsu_loop || (rpc->crpc_status && tsi->tsi_stoptsu_onerr)) - done = 1; + done = true; /* dec ref for poster */ srpc_client_rpc_decref(rpc); -- 2.7.4 From kedrot at gmail.com Wed Jun 21 07:24:08 2017 From: kedrot at gmail.com (Tordek) Date: Wed, 21 Jun 2017 04:24:08 -0300 Subject: [lustre-devel] [PATCH] staging/lustre: echo_client.c - fix sparse warning: cast removes address space of expression In-Reply-To: <20170608053527.21599-1-kedrot@gmail.com> References: <20170608053527.21599-1-kedrot@gmail.com> Message-ID: Hi, List I don't want to be a bother but should I be doing something different when submitting patches? I know it's minor but it's a simple change and it's received no response after two weeks; not even a rejection. Cheers -- Tordek On 8 June 2017 at 02:35, Guillermo O. Freschi wrote: > The function only cares about the value of the pointer, not the contents > of the pointed-to data. Adding a `__force` annotation to the cast > removes this warning. > > Signed-off-by: Guillermo O. Freschi > --- > drivers/staging/lustre/lustre/obdecho/echo_client.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c b/drivers/staging/lustre/lustre/obdecho/echo_client.c > index d4768311cf92..1757714c56a0 100644 > --- a/drivers/staging/lustre/lustre/obdecho/echo_client.c > +++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c > @@ -1428,7 +1428,7 @@ static int echo_client_brw_ioctl(const struct lu_env *env, int rw, > oa->o_valid &= ~OBD_MD_FLHANDLE; > > /* OFD/obdfilter works only via prep/commit */ > - test_mode = (long)data->ioc_pbuf1; > + test_mode = (__force long)data->ioc_pbuf1; > if (test_mode == 1) > async = 0; > > -- > 2.11.0 > From gregkh at linuxfoundation.org Fri Jun 23 16:12:58 2017 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Sat, 24 Jun 2017 00:12:58 +0800 Subject: [lustre-devel] [PATCH 5/6] staging: lustre: lustre: several over 80 characters cleanups In-Reply-To: References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> <1497452481-31124-6-git-send-email-jsimmons@infradead.org> <1497464128.18751.59.camel@perches.com> Message-ID: <20170623161258.GA20104@kroah.com> On Thu, Jun 15, 2017 at 05:06:30PM +0100, James Simmons wrote: > > > On Wed, 2017-06-14 at 11:01 -0400, James Simmons wrote: > > > Cleanup many of the over 80 characters reported by checkpatch > > > > Please don't let checkpatch get in the way of lustre > > readability. > > > > lustre commonly uses very long identifiers. > > Long identifiers and 80 columns don't mix well. > > > > It might be simpler to declare in some document that > > lustre uses lines of up to whatever length and require > > that checkpatch should be used with the --max-line-length > > option when run on lustre code. > > Greg would you be okay with this? If we changed to a max-line-length to > say 128 thay would mean very few checkpatch issues would remain. No, I don't want you go change the max-line-length, just use your best judgement. Some of the changes here in this very-big patch are just fine, and should be done as they make the code easier to read. Others, you are just having to fix pedantic things and there's no need for that. Let me give you a few examples in this patch of what I'm talking about to help you understand the difference... thanks, greg k-h From gregkh at linuxfoundation.org Fri Jun 23 16:15:13 2017 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Sat, 24 Jun 2017 00:15:13 +0800 Subject: [lustre-devel] [PATCH 5/6] staging: lustre: lustre: several over 80 characters cleanups In-Reply-To: <1497452481-31124-6-git-send-email-jsimmons@infradead.org> References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> <1497452481-31124-6-git-send-email-jsimmons@infradead.org> Message-ID: <20170623161513.GB20104@kroah.com> On Wed, Jun 14, 2017 at 11:01:20AM -0400, James Simmons wrote: > -void ldlm_extent_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy, > - union ldlm_policy_data *lpolicy) > +void > +ldlm_extent_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy, > + union ldlm_policy_data *lpolicy) Stuff like this is not really needed. But you could work on making your function names smaller and more concise, that is one major reason why you have so many line-length issues in your codebase. > - LDLM_LRU_FLAG_AGED = BIT(0), /* Cancel aged locks (non lru resize). */ > + LDLM_LRU_FLAG_AGED = BIT(0), /* Cancel aged locks (non lru resize). > + */ Not needed to be changed. > --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c > +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c > @@ -1035,7 +1035,8 @@ void ldlm_grant_lock(struct ldlm_lock *lock, struct list_head *work_list) > ldlm_extent_add_lock(res, lock); > else if (res->lr_type == LDLM_FLOCK) { > /* > - * We should not add locks to granted list in the following cases: > + * We should not add locks to granted list in the following > + * cases: That's a good fix, as is: > * - this is an UNLOCK but not a real lock; > * - this is a TEST lock; > * - this is a F_CANCELLK lock (async flock has req_mode == 0) > @@ -2050,13 +2051,16 @@ void _ldlm_lock_debug(struct ldlm_lock *lock, > libcfs_debug_vmsg2(msgdata, fmt, args, > " ns: \?\? lock: %p/%#llx lrc: %d/%d,%d mode: %s/%s res: \?\? rrc=\?\? type: \?\?\? flags: %#llx nid: %s remote: %#llx expref: %d pid: %u timeout: %lu lvb_type: %d\n", > lock, > - lock->l_handle.h_cookie, atomic_read(&lock->l_refc), > + lock->l_handle.h_cookie, > + atomic_read(&lock->l_refc), That one. So do it where it maes the code better looking and easier to understand. Not just where you have to work around crazy limitations. Please fix this patch up and resend. thanks, greg k-h From gregkh at linuxfoundation.org Fri Jun 23 16:16:31 2017 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Sat, 24 Jun 2017 00:16:31 +0800 Subject: [lustre-devel] [PATCH] staging: lustre: lnet: selftest: Change the type of variable to bool In-Reply-To: <20170620090637.GA15837@singhal-Inspiron-5558> References: <20170620090637.GA15837@singhal-Inspiron-5558> Message-ID: <20170623161631.GC20104@kroah.com> On Tue, Jun 20, 2017 at 02:36:37PM +0530, simran singhal wrote: > This patch changes the type of variable done from int to boolean. As it > is been used as a boolean in the function sfw_test_rpc_done(). It also > makes the code more readable and bool data type also requires less > memory in comparison to int data type. Are you sure it takes less memory? What is the difference before and after your patch? Don't make claims without having a way to back them up :) thanks, greg k-h From gregkh at linuxfoundation.org Fri Jun 23 16:17:25 2017 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Sat, 24 Jun 2017 00:17:25 +0800 Subject: [lustre-devel] [PATCH 6/6] staging: lustre: lustre: fix all braces issues reported by checkpatch In-Reply-To: <1497452481-31124-7-git-send-email-jsimmons@infradead.org> References: <1497452481-31124-1-git-send-email-jsimmons@infradead.org> <1497452481-31124-7-git-send-email-jsimmons@infradead.org> Message-ID: <20170623161725.GA20423@kroah.com> On Wed, Jun 14, 2017 at 11:01:21AM -0400, James Simmons wrote: > Cleanup all braces that was reported by checkpatch. The only > issue not fixed up is in mdc_lock.c. Removing the braces in > the case of mdc_lock.c will break the build. > > Signed-off-by: James Simmons > --- > drivers/staging/lustre/lustre/fld/fld_cache.c | 3 ++- > drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 9 +++++---- > drivers/staging/lustre/lustre/llite/vvp_dev.c | 5 +++-- > 3 files changed, 10 insertions(+), 7 deletions(-) As I skipped patch 5/6, this doesn't apply :( From denis.petrovic at edu.ece.fr Sun Jun 25 12:52:48 2017 From: denis.petrovic at edu.ece.fr (Denis Petrovic) Date: Sun, 25 Jun 2017 14:52:48 +0200 Subject: [lustre-devel] [PATCH] staging: lustre: replace kmalloc with kmalloc_array Message-ID: <20170625125248.936-1-denis.petrovic@edu.ece.fr> This patch fixes the following checkpatch.pl warning: WARNING: Prefer kmalloc_array over kmalloc with multiply Signed-off-by: Denis Petrovic --- drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c index 75eb84e7f0f8..a5a94788f11f 100644 --- a/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c +++ b/drivers/staging/lustre/lnet/libcfs/linux/linux-tracefile.c @@ -57,8 +57,9 @@ int cfs_tracefile_init_arch(void) memset(cfs_trace_data, 0, sizeof(cfs_trace_data)); for (i = 0; i < CFS_TCD_TYPE_MAX; i++) { cfs_trace_data[i] = - kmalloc(sizeof(union cfs_trace_data_union) * - num_possible_cpus(), GFP_KERNEL); + kmalloc_array(num_possible_cpus(), + sizeof(union cfs_trace_data_union), + GFP_KERNEL); if (!cfs_trace_data[i]) goto out; } -- 2.11.0 From bcodding at redhat.com Tue Jun 27 15:18:07 2017 From: bcodding at redhat.com (Benjamin Coddington) Date: Tue, 27 Jun 2017 11:18:07 -0400 Subject: [lustre-devel] [PATCH 1/3] fs/locks: Use allocation rather than the stack in fcntl_getlk() In-Reply-To: References: Message-ID: Struct file_lock is fairly large, so let's save some space on the stack by using an allocation for struct file_lock in fcntl_getlk(), just as we do for fcntl_setlk(). Signed-off-by: Benjamin Coddington --- fs/locks.c | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index afefeb4ad6de..d7daa6c8932f 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -2086,14 +2086,17 @@ static void posix_lock_to_flock64(struct flock64 *flock, struct file_lock *fl) */ int fcntl_getlk(struct file *filp, unsigned int cmd, struct flock *flock) { - struct file_lock file_lock; + struct file_lock *fl; int error; + fl = locks_alloc_lock(); + if (fl == NULL) + return -ENOMEM; error = -EINVAL; if (flock->l_type != F_RDLCK && flock->l_type != F_WRLCK) goto out; - error = flock_to_posix_lock(filp, &file_lock, flock); + error = flock_to_posix_lock(filp, fl, flock); if (error) goto out; @@ -2103,23 +2106,22 @@ int fcntl_getlk(struct file *filp, unsigned int cmd, struct flock *flock) goto out; cmd = F_GETLK; - file_lock.fl_flags |= FL_OFDLCK; - file_lock.fl_owner = filp; + fl->fl_flags |= FL_OFDLCK; + fl->fl_owner = filp; } - error = vfs_test_lock(filp, &file_lock); + error = vfs_test_lock(filp, fl); if (error) goto out; - flock->l_type = file_lock.fl_type; - if (file_lock.fl_type != F_UNLCK) { - error = posix_lock_to_flock(flock, &file_lock); + flock->l_type = fl->fl_type; + if (fl->fl_type != F_UNLCK) { + error = posix_lock_to_flock(flock, fl); if (error) - goto rel_priv; + goto out; } -rel_priv: - locks_release_private(&file_lock); out: + locks_free_lock(fl); return error; } @@ -2298,14 +2300,18 @@ int fcntl_setlk(unsigned int fd, struct file *filp, unsigned int cmd, */ int fcntl_getlk64(struct file *filp, unsigned int cmd, struct flock64 *flock) { - struct file_lock file_lock; + struct file_lock *fl; int error; + fl = locks_alloc_lock(); + if (fl == NULL) + return -ENOMEM; + error = -EINVAL; if (flock->l_type != F_RDLCK && flock->l_type != F_WRLCK) goto out; - error = flock64_to_posix_lock(filp, &file_lock, flock); + error = flock64_to_posix_lock(filp, fl, flock); if (error) goto out; @@ -2315,20 +2321,20 @@ int fcntl_getlk64(struct file *filp, unsigned int cmd, struct flock64 *flock) goto out; cmd = F_GETLK64; - file_lock.fl_flags |= FL_OFDLCK; - file_lock.fl_owner = filp; + fl->fl_flags |= FL_OFDLCK; + fl->fl_owner = filp; } - error = vfs_test_lock(filp, &file_lock); + error = vfs_test_lock(filp, fl); if (error) goto out; - flock->l_type = file_lock.fl_type; - if (file_lock.fl_type != F_UNLCK) - posix_lock_to_flock64(flock, &file_lock); + flock->l_type = fl->fl_type; + if (fl->fl_type != F_UNLCK) + posix_lock_to_flock64(flock, fl); - locks_release_private(&file_lock); out: + locks_free_lock(fl); return error; } -- 2.9.3 From bcodding at redhat.com Tue Jun 27 15:18:08 2017 From: bcodding at redhat.com (Benjamin Coddington) Date: Tue, 27 Jun 2017 11:18:08 -0400 Subject: [lustre-devel] [PATCH 2/3] fs/locks: Remove fl_nspid and use fs-specific l_pid for remote locks In-Reply-To: References: Message-ID: Since commit c69899a17ca4 "NFSv4: Update of VFS byte range lock must be atomic with the stateid update", NFSv4 has been inserting locks in rpciod worker context. The result is that the file_lock's fl_nspid is the kworker's pid instead of the original userspace pid. The fl_nspid is only used to represent the namespaced virtual pid number when displaying locks or returning from F_GETLK. There's no reason to set it for every inserted lock, since we can usually just look it up from fl_pid. So, instead of looking up and holding struct pid for every lock, let's just look up the virtual pid number from fl_pid when it is needed. That means we can remove fl_nspid entirely. The translaton and presentation of fl_pid should handle the following four cases: 1 - F_GETLK on a remote file with a remote lock: In this case, the filesystem should determine the l_pid to return here. Filesystems should indicate that the fl_pid represents a non-local pid value that should not be translated by returning an fl_pid <= 0. 2 - F_GETLK on a local file with a remote lock: This should be the l_pid of the lock manager process, and translated. 3 - F_GETLK on a remote file with a local lock, and 4 - F_GETLK on a local file with a local lock: These should be the translated l_pid of the local locking process. Fuse was already doing the correct thing by translating the pid into the caller's namespace. With this change we must update fuse to translate to init's pid namespace, so that the locks API can then translate from init's pid namespace into the pid namespace of the caller. Signed-off-by: Benjamin Coddington --- fs/fuse/file.c | 6 +++--- fs/locks.c | 62 ++++++++++++++++++++++++++++++++---------------------- include/linux/fs.h | 2 +- 3 files changed, 41 insertions(+), 29 deletions(-) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 3ee4fdc3da9e..7cd692f51d1d 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -2101,11 +2101,11 @@ static int convert_fuse_file_lock(struct fuse_conn *fc, fl->fl_end = ffl->end; /* - * Convert pid into the caller's pid namespace. If the pid - * does not map into the namespace fl_pid will get set to 0. + * Convert pid into init's pid namespace. The locks API will + * translate it into the caller's pid namespace. */ rcu_read_lock(); - fl->fl_pid = pid_vnr(find_pid_ns(ffl->pid, fc->pid_ns)); + fl->fl_pid = pid_nr_ns(find_pid_ns(ffl->pid, fc->pid_ns), &init_pid_ns); rcu_read_unlock(); break; diff --git a/fs/locks.c b/fs/locks.c index d7daa6c8932f..6d0949880ebd 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -137,6 +137,7 @@ #define IS_FLOCK(fl) (fl->fl_flags & FL_FLOCK) #define IS_LEASE(fl) (fl->fl_flags & (FL_LEASE|FL_DELEG|FL_LAYOUT)) #define IS_OFDLCK(fl) (fl->fl_flags & FL_OFDLCK) +#define IS_REMOTELCK(fl) (fl->fl_pid <= 0) static inline bool is_remote_lock(struct file *filp) { @@ -733,7 +734,6 @@ static void locks_wake_up_blocks(struct file_lock *blocker) static void locks_insert_lock_ctx(struct file_lock *fl, struct list_head *before) { - fl->fl_nspid = get_pid(task_tgid(current)); list_add_tail(&fl->fl_list, before); locks_insert_global_locks(fl); } @@ -743,10 +743,6 @@ locks_unlink_lock_ctx(struct file_lock *fl) { locks_delete_global_locks(fl); list_del_init(&fl->fl_list); - if (fl->fl_nspid) { - put_pid(fl->fl_nspid); - fl->fl_nspid = NULL; - } locks_wake_up_blocks(fl); } @@ -823,8 +819,6 @@ posix_test_lock(struct file *filp, struct file_lock *fl) list_for_each_entry(cfl, &ctx->flc_posix, fl_list) { if (posix_locks_conflict(fl, cfl)) { locks_copy_conflock(fl, cfl); - if (cfl->fl_nspid) - fl->fl_pid = pid_vnr(cfl->fl_nspid); goto out; } } @@ -2048,9 +2042,33 @@ int vfs_test_lock(struct file *filp, struct file_lock *fl) } EXPORT_SYMBOL_GPL(vfs_test_lock); +/** + * locks_translate_pid - translate a file_lock's fl_pid number into a namespace + * @fl: The file_lock who's fl_pid should be translated + * @ns: The namespace into which the pid should be translated + * + * Used to tranlate a fl_pid into a namespace virtual pid number + */ +static pid_t locks_translate_pid(struct file_lock *fl, struct pid_namespace *ns) +{ + pid_t vnr; + struct pid *pid; + + if (IS_OFDLCK(fl)) + return -1; + if (IS_REMOTELCK(fl)) + return fl->fl_pid; + + rcu_read_lock(); + pid = find_pid_ns(fl->fl_pid, &init_pid_ns); + vnr = pid_nr_ns(pid, ns); + rcu_read_unlock(); + return vnr; +} + static int posix_lock_to_flock(struct flock *flock, struct file_lock *fl) { - flock->l_pid = IS_OFDLCK(fl) ? -1 : fl->fl_pid; + flock->l_pid = locks_translate_pid(fl, task_active_pid_ns(current)); #if BITS_PER_LONG == 32 /* * Make sure we can represent the posix lock via @@ -2072,7 +2090,7 @@ static int posix_lock_to_flock(struct flock *flock, struct file_lock *fl) #if BITS_PER_LONG == 32 static void posix_lock_to_flock64(struct flock64 *flock, struct file_lock *fl) { - flock->l_pid = IS_OFDLCK(fl) ? -1 : fl->fl_pid; + flock->l_pid = locks_translate_pid(fl, task_active_pid_ns(current)); flock->l_start = fl->fl_start; flock->l_len = fl->fl_end == OFFSET_MAX ? 0 : fl->fl_end - fl->fl_start + 1; @@ -2584,22 +2602,16 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl, { struct inode *inode = NULL; unsigned int fl_pid; + struct pid_namespace *proc_pidns = file_inode(f->file)->i_sb->s_fs_info; - if (fl->fl_nspid) { - struct pid_namespace *proc_pidns = file_inode(f->file)->i_sb->s_fs_info; - - /* Don't let fl_pid change based on who is reading the file */ - fl_pid = pid_nr_ns(fl->fl_nspid, proc_pidns); - - /* - * If there isn't a fl_pid don't display who is waiting on - * the lock if we are called from locks_show, or if we are - * called from __show_fd_info - skip lock entirely - */ - if (fl_pid == 0) - return; - } else - fl_pid = fl->fl_pid; + fl_pid = locks_translate_pid(fl, proc_pidns); + /* + * If there isn't a fl_pid don't display who is waiting on + * the lock if we are called from locks_show, or if we are + * called from __show_fd_info - skip lock entirely + */ + if (fl_pid == 0) + return; if (fl->fl_file != NULL) inode = locks_inode(fl->fl_file); @@ -2674,7 +2686,7 @@ static int locks_show(struct seq_file *f, void *v) fl = hlist_entry(v, struct file_lock, fl_link); - if (fl->fl_nspid && !pid_nr_ns(fl->fl_nspid, proc_pidns)) + if (locks_translate_pid(fl, proc_pidns) == 0) return 0; lock_get_status(f, fl, iter->li_pos, ""); diff --git a/include/linux/fs.h b/include/linux/fs.h index aa4affb38c39..179496a9719d 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -908,6 +908,7 @@ static inline struct file *get_file(struct file *f) #define FL_UNLOCK_PENDING 512 /* Lease is being broken */ #define FL_OFDLCK 1024 /* lock is "owned" by struct file */ #define FL_LAYOUT 2048 /* outstanding pNFS layout */ +#define FL_PID_PRIV 4096 /* F_GETLK should report fl_pid */ #define FL_CLOSE_POSIX (FL_POSIX | FL_CLOSE) @@ -984,7 +985,6 @@ struct file_lock { unsigned char fl_type; unsigned int fl_pid; int fl_link_cpu; /* what cpu's list is this on? */ - struct pid *fl_nspid; wait_queue_head_t fl_wait; struct file *fl_file; loff_t fl_start; -- 2.9.3 From bcodding at redhat.com Tue Jun 27 15:18:09 2017 From: bcodding at redhat.com (Benjamin Coddington) Date: Tue, 27 Jun 2017 11:18:09 -0400 Subject: [lustre-devel] [PATCH 3/3] staging/lustre, 9p, ceph, cifs, dlm: negate remote pids for F_GETLK In-Reply-To: References: Message-ID: <3154a78290017da7bbbcb920456b860dbfe9ba26.1498572504.git.bcodding@redhat.com> In the previous patch, the locks API will expect that if a filesystem returns a remote pid as opposed to a local pid for F_GETLK, that remote pid will be <= 0. This signifies that the pid is remote, and the locks API will forego translating that pid into the pid namespace of the local calling process. Since local pids will never be larger than PID_MAX_LIMIT (which is currently defined as <= 4 million), but pid_t is an unsigned int, we should have plenty of room to represent remote pids with negative numbers if we assume that remote pid numbers are similarly limited. If this is not the case, then we run the risk of having a remote pid returned for which there is also a corresponding local pid. This is a problem we have now, but this patch should reduce the chances of that occurring, while also returning those remote pid numbers, for whatever that may be worth. This patch updates lustre, 9p, ceph, cifs, and dlm to negate the remote pid returned for F_GETLK lock requests. Signed-off-by: Benjamin Coddington --- drivers/staging/lustre/lustre/ldlm/ldlm_flock.c | 2 +- fs/9p/vfs_file.c | 2 +- fs/ceph/locks.c | 2 +- fs/cifs/cifssmb.c | 2 +- fs/dlm/plock.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c index b7f28b39c7b3..abcbf075acc0 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c @@ -596,7 +596,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data) default: getlk->fl_type = F_UNLCK; } - getlk->fl_pid = (pid_t)lock->l_policy_data.l_flock.pid; + getlk->fl_pid = -(pid_t)lock->l_policy_data.l_flock.pid; getlk->fl_start = (loff_t)lock->l_policy_data.l_flock.start; getlk->fl_end = (loff_t)lock->l_policy_data.l_flock.end; } else { diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 3de3b4a89d89..43c242e17132 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c @@ -288,7 +288,7 @@ static int v9fs_file_getlock(struct file *filp, struct file_lock *fl) fl->fl_end = OFFSET_MAX; else fl->fl_end = glock.start + glock.length - 1; - fl->fl_pid = glock.proc_id; + fl->fl_pid = -glock.proc_id; } kfree(glock.client_id); return res; diff --git a/fs/ceph/locks.c b/fs/ceph/locks.c index 6806dbeaee19..0fd5c288ce4e 100644 --- a/fs/ceph/locks.c +++ b/fs/ceph/locks.c @@ -79,7 +79,7 @@ static int ceph_lock_message(u8 lock_type, u16 operation, struct file *file, err = ceph_mdsc_do_request(mdsc, inode, req); if (operation == CEPH_MDS_OP_GETFILELOCK) { - fl->fl_pid = le64_to_cpu(req->r_reply_info.filelock_reply->pid); + fl->fl_pid = -le64_to_cpu(req->r_reply_info.filelock_reply->pid); if (CEPH_LOCK_SHARED == req->r_reply_info.filelock_reply->type) fl->fl_type = F_RDLCK; else if (CEPH_LOCK_EXCL == req->r_reply_info.filelock_reply->type) diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index fbb0d4cbda41..cb367050f972 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -2515,7 +2515,7 @@ CIFSSMBPosixLock(const unsigned int xid, struct cifs_tcon *tcon, pLockData->fl_start = le64_to_cpu(parm_data->start); pLockData->fl_end = pLockData->fl_start + le64_to_cpu(parm_data->length) - 1; - pLockData->fl_pid = le32_to_cpu(parm_data->pid); + pLockData->fl_pid = -le32_to_cpu(parm_data->pid); } } diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c index d401425f602a..e631b1689228 100644 --- a/fs/dlm/plock.c +++ b/fs/dlm/plock.c @@ -367,7 +367,7 @@ int dlm_posix_get(dlm_lockspace_t *lockspace, u64 number, struct file *file, locks_init_lock(fl); fl->fl_type = (op->info.ex) ? F_WRLCK : F_RDLCK; fl->fl_flags = FL_POSIX; - fl->fl_pid = op->info.pid; + fl->fl_pid = -op->info.pid; fl->fl_start = op->info.start; fl->fl_end = op->info.end; rv = 0; -- 2.9.3 From bcodding at redhat.com Tue Jun 27 15:18:06 2017 From: bcodding at redhat.com (Benjamin Coddington) Date: Tue, 27 Jun 2017 11:18:06 -0400 Subject: [lustre-devel] [PATCH 0/3 v6] Fixups for l_pid Message-ID: LTP fcntl tests (fcntl11 fcntl14 fcntl17 fcntl19 fcntl20 fcntl21) have been failing for NFSv4 mounts due to an unexpected l_pid. What follows are some fixups: v2: - Rebase onto linux-next - Revert back to using the stack in locks_mandatory_area(), and fixup patch description for 1/3 v3: - The lkp-robot found some serious per_thread_ops performance regressions for v1 and v2, so this version changes things around to not acquire a reference to struct pid in fl_nspid for every lock. Instead, it drops fl_nspid altogether, and defers the lookup of the namespace-translated pid until it actually needed. v4: - Instead of looking up the virtual pid by way of referencing the struct task of the that pid, instead use find_pid_ns() and pid_nr_ns(), which avoids a the problem where we race to get a reference to the struct task while it may be freed. v5: - Squash previous 2/3 and 3/3 to avoid regression where F_GETLK would return the init_ns pid instead of a translated pid. v6: - State clearly how the differing cases of l_pid translation should be handled, specifically regarding remote locks on remote files: that fl_pid ought to be returned from the filesystem as <= 0 to indicate that it makes no sense to translate this l_pid. - Follow up with a patch to have filesystems negate fl_pid for remote locks on remote files. Benjamin Coddington (3): fs/locks: Use allocation rather than the stack in fcntl_getlk() fs/locks: Remove fl_nspid and use fs-specific l_pid for remote locks staging/lustre, 9p, ceph, cifs, dlm: negate remote pids for F_GETLK drivers/staging/lustre/lustre/ldlm/ldlm_flock.c | 2 +- fs/9p/vfs_file.c | 2 +- fs/ceph/locks.c | 2 +- fs/cifs/cifssmb.c | 2 +- fs/dlm/plock.c | 2 +- fs/fuse/file.c | 6 +- fs/locks.c | 108 ++++++++++++++---------- include/linux/fs.h | 2 +- 8 files changed, 72 insertions(+), 54 deletions(-) -- 2.9.3 From jlayton at poochiereds.net Tue Jun 27 19:36:10 2017 From: jlayton at poochiereds.net (Jeff Layton) Date: Tue, 27 Jun 2017 15:36:10 -0400 Subject: [lustre-devel] [PATCH 3/3] staging/lustre, 9p, ceph, cifs, dlm: negate remote pids for F_GETLK In-Reply-To: <3154a78290017da7bbbcb920456b860dbfe9ba26.1498572504.git.bcodding@redhat.com> References: <3154a78290017da7bbbcb920456b860dbfe9ba26.1498572504.git.bcodding@redhat.com> Message-ID: <1498592170.4830.8.camel@poochiereds.net> On Tue, 2017-06-27 at 11:18 -0400, Benjamin Coddington wrote: > In the previous patch, the locks API will expect that if a filesystem > returns a remote pid as opposed to a local pid for F_GETLK, that remote pid > will be <= 0. This signifies that the pid is remote, and the locks API > will forego translating that pid into the pid namespace of the local > calling process. Since local pids will never be larger than PID_MAX_LIMIT > (which is currently defined as <= 4 million), but pid_t is an unsigned int, > we should have plenty of room to represent remote pids with negative > numbers if we assume that remote pid numbers are similarly limited. If > this is not the case, then we run the risk of having a remote pid returned > for which there is also a corresponding local pid. This is a problem we > have now, but this patch should reduce the chances of that occurring, while > also returning those remote pid numbers, for whatever that may be worth. > > This patch updates lustre, 9p, ceph, cifs, and dlm to negate the remote pid > returned for F_GETLK lock requests. > > Signed-off-by: Benjamin Coddington > --- > drivers/staging/lustre/lustre/ldlm/ldlm_flock.c | 2 +- > fs/9p/vfs_file.c | 2 +- > fs/ceph/locks.c | 2 +- > fs/cifs/cifssmb.c | 2 +- > fs/dlm/plock.c | 2 +- > 5 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c > index b7f28b39c7b3..abcbf075acc0 100644 > --- a/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c > +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_flock.c > @@ -596,7 +596,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data) > default: > getlk->fl_type = F_UNLCK; > } > - getlk->fl_pid = (pid_t)lock->l_policy_data.l_flock.pid; > + getlk->fl_pid = -(pid_t)lock->l_policy_data.l_flock.pid; > getlk->fl_start = (loff_t)lock->l_policy_data.l_flock.start; > getlk->fl_end = (loff_t)lock->l_policy_data.l_flock.end; > } else { > diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c > index 3de3b4a89d89..43c242e17132 100644 > --- a/fs/9p/vfs_file.c > +++ b/fs/9p/vfs_file.c > @@ -288,7 +288,7 @@ static int v9fs_file_getlock(struct file *filp, struct file_lock *fl) > fl->fl_end = OFFSET_MAX; > else > fl->fl_end = glock.start + glock.length - 1; > - fl->fl_pid = glock.proc_id; > + fl->fl_pid = -glock.proc_id; > } > kfree(glock.client_id); > return res; > diff --git a/fs/ceph/locks.c b/fs/ceph/locks.c > index 6806dbeaee19..0fd5c288ce4e 100644 > --- a/fs/ceph/locks.c > +++ b/fs/ceph/locks.c > @@ -79,7 +79,7 @@ static int ceph_lock_message(u8 lock_type, u16 operation, struct file *file, > err = ceph_mdsc_do_request(mdsc, inode, req); > > if (operation == CEPH_MDS_OP_GETFILELOCK) { > - fl->fl_pid = le64_to_cpu(req->r_reply_info.filelock_reply->pid); > + fl->fl_pid = -le64_to_cpu(req->r_reply_info.filelock_reply->pid); > if (CEPH_LOCK_SHARED == req->r_reply_info.filelock_reply->type) > fl->fl_type = F_RDLCK; > else if (CEPH_LOCK_EXCL == req->r_reply_info.filelock_reply->type) > diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c > index fbb0d4cbda41..cb367050f972 100644 > --- a/fs/cifs/cifssmb.c > +++ b/fs/cifs/cifssmb.c > @@ -2515,7 +2515,7 @@ CIFSSMBPosixLock(const unsigned int xid, struct cifs_tcon *tcon, > pLockData->fl_start = le64_to_cpu(parm_data->start); > pLockData->fl_end = pLockData->fl_start + > le64_to_cpu(parm_data->length) - 1; > - pLockData->fl_pid = le32_to_cpu(parm_data->pid); > + pLockData->fl_pid = -le32_to_cpu(parm_data->pid); > } > } > > diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c > index d401425f602a..e631b1689228 100644 > --- a/fs/dlm/plock.c > +++ b/fs/dlm/plock.c > @@ -367,7 +367,7 @@ int dlm_posix_get(dlm_lockspace_t *lockspace, u64 number, struct file *file, > locks_init_lock(fl); > fl->fl_type = (op->info.ex) ? F_WRLCK : F_RDLCK; > fl->fl_flags = FL_POSIX; > - fl->fl_pid = op->info.pid; > + fl->fl_pid = -op->info.pid; > fl->fl_start = op->info.start; > fl->fl_end = op->info.end; > rv = 0; I think this is probably a reasonable thing to do, given that we also report OFD locks today with an l_pid of -1. The pid on any sort of distributed fs is pretty meaningless anyway. I think this all looks good. I'll plan to merge it for -next in a bit and do some testing with it. Thanks! -- Jeff Layton From gregkh at linuxfoundation.org Thu Jun 29 14:32:24 2017 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Thu, 29 Jun 2017 16:32:24 +0200 Subject: [lustre-devel] [PATCH] staging: lustre: lnet: remove dead code In-Reply-To: <1498711356-14270-1-git-send-email-dmitriy@oss-tech.org> References: <1498711356-14270-1-git-send-email-dmitriy@oss-tech.org> Message-ID: <20170629143224.GA19857@kroah.com> On Wed, Jun 28, 2017 at 09:42:36PM -0700, Dmitriy Cherkasov wrote: > Remove code which was permanently disabled with ifdefs. > > This also resolves the following checkpatch warning which was > triggered by the dead code: > > WARNING: space prohibited before semicolon > > Signed-off-by: Dmitriy Cherkasov > --- > drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h > index 5540de6..7c487fa 100644 > --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h > +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h > @@ -521,13 +521,7 @@ struct ksock_proto { > > static inline __u32 ksocknal_csum(__u32 crc, unsigned char const *p, size_t len) > { > -#if 1 > return crc32_le(crc, p, len); Even better yet, why not just replace the callers of this tiny function, with crc32_le() instead and delete this useless wrapper? thanks, greg k-h From joe at perches.com Fri Jun 30 03:37:05 2017 From: joe at perches.com (Joe Perches) Date: Thu, 29 Jun 2017 20:37:05 -0700 Subject: [lustre-devel] [PATCH v2] staging: lustre: lnet: remove dead code and crc32_le() wrapper In-Reply-To: <1498793366-10539-1-git-send-email-dmitriy@oss-tech.org> References: <1498711356-14270-1-git-send-email-dmitriy@oss-tech.org> <1498793366-10539-1-git-send-email-dmitriy@oss-tech.org> Message-ID: <1498793825.2739.10.camel@perches.com> On Fri, 2017-06-30 at 03:29 +0000, Dmitriy Cherkasov wrote: > After removing code which was premanently disabled with ifdefs, the > function ksocknal_csum() becomes just a wrapper for crc32_le(). Remove > this useless wrapper and instead call crc32_le() directly. > > This also resolves the following checkpatch warning which was > triggered by the dead code: > > WARNING: space prohibited before semicolon Please use checkpatch on your proposed patches before sending them. > diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c [] > @@ -201,7 +201,7 @@ > if (fragnob > sum) > fragnob = sum; > > - conn->ksnc_rx_csum = ksocknal_csum(conn->ksnc_rx_csum, > + conn->ksnc_rx_csum = crc32_le(conn->ksnc_rx_csum, > iov[i].iov_base, > fragnob); Please realign the subsequent lines to the open parenthesis. > } > @@ -243,7 +243,7 @@ > if (fragnob > sum) > fragnob = sum; > > - conn->ksnc_rx_csum = ksocknal_csum(conn->ksnc_rx_csum, > + conn->ksnc_rx_csum = crc32_le(conn->ksnc_rx_csum, > base, fragnob); etc... From dmitriy at oss-tech.org Fri Jun 30 03:52:46 2017 From: dmitriy at oss-tech.org (Dmitriy Cherkasov) Date: Fri, 30 Jun 2017 03:52:46 +0000 Subject: [lustre-devel] [PATCH v3] staging: lustre: lnet: remove dead code and crc32_le() wrapper In-Reply-To: <1498793366-10539-1-git-send-email-dmitriy@oss-tech.org> References: <1498793366-10539-1-git-send-email-dmitriy@oss-tech.org> Message-ID: <1498794766-12298-1-git-send-email-dmitriy@oss-tech.org> After removing code which was premanently disabled with ifdefs, the function ksocknal_csum() becomes just a wrapper for crc32_le(). Remove this useless wrapper and instead call crc32_le() directly. This also resolves the following checkpatch warning which was triggered by the dead code: WARNING: space prohibited before semicolon Signed-off-by: Dmitriy Cherkasov --- drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h | 11 ----------- drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c | 14 +++++++------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h index 5540de6..9eb169d 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h @@ -519,17 +519,6 @@ struct ksock_proto { #define CPU_MASK_NONE 0UL #endif -static inline __u32 ksocknal_csum(__u32 crc, unsigned char const *p, size_t len) -{ -#if 1 - return crc32_le(crc, p, len); -#else - while (len-- > 0) - crc = ((crc + 0x100) & ~0xff) | ((crc + *p++) & 0xff) ; - return crc; -#endif -} - static inline int ksocknal_route_mask(void) { diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c index 8a036f4..5e7e4e1 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c @@ -201,7 +201,7 @@ if (fragnob > sum) fragnob = sum; - conn->ksnc_rx_csum = ksocknal_csum(conn->ksnc_rx_csum, + conn->ksnc_rx_csum = crc32_le(conn->ksnc_rx_csum, iov[i].iov_base, fragnob); } @@ -243,7 +243,7 @@ if (fragnob > sum) fragnob = sum; - conn->ksnc_rx_csum = ksocknal_csum(conn->ksnc_rx_csum, + conn->ksnc_rx_csum = crc32_le(conn->ksnc_rx_csum, base, fragnob); kunmap(kiov[i].bv_page); @@ -265,22 +265,22 @@ tx->tx_msg.ksm_csum = 0; - csum = ksocknal_csum(~0, tx->tx_iov[0].iov_base, - tx->tx_iov[0].iov_len); + csum = crc32_le(~0, tx->tx_iov[0].iov_base, + tx->tx_iov[0].iov_len); if (tx->tx_kiov) { for (i = 0; i < tx->tx_nkiov; i++) { base = kmap(tx->tx_kiov[i].bv_page) + tx->tx_kiov[i].bv_offset; - csum = ksocknal_csum(csum, base, tx->tx_kiov[i].bv_len); + csum = crc32_le(csum, base, tx->tx_kiov[i].bv_len); kunmap(tx->tx_kiov[i].bv_page); } } else { for (i = 1; i < tx->tx_niov; i++) - csum = ksocknal_csum(csum, tx->tx_iov[i].iov_base, - tx->tx_iov[i].iov_len); + csum = crc32_le(csum, tx->tx_iov[i].iov_base, + tx->tx_iov[i].iov_len); } if (*ksocknal_tunables.ksnd_inject_csum_error) { -- 1.9.1 From dmitriy at oss-tech.org Fri Jun 30 03:54:33 2017 From: dmitriy at oss-tech.org (Dmitriy Cherkasov) Date: Fri, 30 Jun 2017 03:54:33 +0000 Subject: [lustre-devel] [PATCH v2] staging: lustre: lnet: remove dead code and crc32_le() wrapper In-Reply-To: <1498793825.2739.10.camel@perches.com> References: <1498711356-14270-1-git-send-email-dmitriy@oss-tech.org> <1498793366-10539-1-git-send-email-dmitriy@oss-tech.org> <1498793825.2739.10.camel@perches.com> Message-ID: <6cf18b68-4276-2250-f836-a9252ce2c5f1@oss-tech.org> On 06/30/2017, Joe Perches wrote: > Please use checkpatch on your proposed patches before > sending them. Whoops! Sorry about that. Fixed and re-sent. From dmitriy at oss-tech.org Fri Jun 30 05:50:41 2017 From: dmitriy at oss-tech.org (Dmitriy Cherkasov) Date: Fri, 30 Jun 2017 05:50:41 +0000 Subject: [lustre-devel] [PATCH v4] staging: lustre: lnet: remove dead code and crc32_le() wrapper In-Reply-To: <1498794766-12298-1-git-send-email-dmitriy@oss-tech.org> References: <1498794766-12298-1-git-send-email-dmitriy@oss-tech.org> Message-ID: <1498801841-5799-1-git-send-email-dmitriy@oss-tech.org> After removing code which was permanently disabled with ifdefs, the function ksocknal_csum() becomes just a wrapper for crc32_le(). Remove this useless wrapper and instead call crc32_le() directly. This also resolves the following checkpatch warning which was triggered by the dead code: WARNING: space prohibited before semicolon Signed-off-by: Dmitriy Cherkasov --- Changes since v3: * fixed spacing issues * fixed typo in commit message drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h | 11 ----------- .../staging/lustre/lnet/klnds/socklnd/socklnd_lib.c | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h index 5540de6..9eb169d 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h @@ -519,17 +519,6 @@ struct ksock_proto { #define CPU_MASK_NONE 0UL #endif -static inline __u32 ksocknal_csum(__u32 crc, unsigned char const *p, size_t len) -{ -#if 1 - return crc32_le(crc, p, len); -#else - while (len-- > 0) - crc = ((crc + 0x100) & ~0xff) | ((crc + *p++) & 0xff) ; - return crc; -#endif -} - static inline int ksocknal_route_mask(void) { diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c index 8a036f4..41715cd 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c @@ -201,9 +201,9 @@ if (fragnob > sum) fragnob = sum; - conn->ksnc_rx_csum = ksocknal_csum(conn->ksnc_rx_csum, - iov[i].iov_base, - fragnob); + conn->ksnc_rx_csum = crc32_le(conn->ksnc_rx_csum, + iov[i].iov_base, + fragnob); } conn->ksnc_msg.ksm_csum = saved_csum; } @@ -243,8 +243,8 @@ if (fragnob > sum) fragnob = sum; - conn->ksnc_rx_csum = ksocknal_csum(conn->ksnc_rx_csum, - base, fragnob); + conn->ksnc_rx_csum = crc32_le(conn->ksnc_rx_csum, + base, fragnob); kunmap(kiov[i].bv_page); } @@ -265,22 +265,22 @@ tx->tx_msg.ksm_csum = 0; - csum = ksocknal_csum(~0, tx->tx_iov[0].iov_base, - tx->tx_iov[0].iov_len); + csum = crc32_le(~0, tx->tx_iov[0].iov_base, + tx->tx_iov[0].iov_len); if (tx->tx_kiov) { for (i = 0; i < tx->tx_nkiov; i++) { base = kmap(tx->tx_kiov[i].bv_page) + tx->tx_kiov[i].bv_offset; - csum = ksocknal_csum(csum, base, tx->tx_kiov[i].bv_len); + csum = crc32_le(csum, base, tx->tx_kiov[i].bv_len); kunmap(tx->tx_kiov[i].bv_page); } } else { for (i = 1; i < tx->tx_niov; i++) - csum = ksocknal_csum(csum, tx->tx_iov[i].iov_base, - tx->tx_iov[i].iov_len); + csum = crc32_le(csum, tx->tx_iov[i].iov_base, + tx->tx_iov[i].iov_len); } if (*ksocknal_tunables.ksnd_inject_csum_error) { -- 1.9.1 From gregkh at linuxfoundation.org Fri Jun 30 06:01:20 2017 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Fri, 30 Jun 2017 08:01:20 +0200 Subject: [lustre-devel] [PATCH v3] staging: lustre: lnet: remove dead code and crc32_le() wrapper In-Reply-To: <1498794766-12298-1-git-send-email-dmitriy@oss-tech.org> References: <1498793366-10539-1-git-send-email-dmitriy@oss-tech.org> <1498794766-12298-1-git-send-email-dmitriy@oss-tech.org> Message-ID: <20170630060120.GA29779@kroah.com> On Fri, Jun 30, 2017 at 03:52:46AM +0000, Dmitriy Cherkasov wrote: > After removing code which was premanently disabled with ifdefs, the > function ksocknal_csum() becomes just a wrapper for crc32_le(). Remove > this useless wrapper and instead call crc32_le() directly. > > This also resolves the following checkpatch warning which was > triggered by the dead code: > > WARNING: space prohibited before semicolon > > Signed-off-by: Dmitriy Cherkasov > --- > drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h | 11 ----------- > drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c | 14 +++++++------- > 2 files changed, 7 insertions(+), 18 deletions(-) What changed from previous versions of this patch? You need to put that information below the --- line, as documented. v4? :) thanks, greg k-h From dmitriy at oss-tech.org Fri Jun 30 03:29:26 2017 From: dmitriy at oss-tech.org (Dmitriy Cherkasov) Date: Fri, 30 Jun 2017 03:29:26 +0000 Subject: [lustre-devel] [PATCH v2] staging: lustre: lnet: remove dead code and crc32_le() wrapper In-Reply-To: <1498711356-14270-1-git-send-email-dmitriy@oss-tech.org> References: <1498711356-14270-1-git-send-email-dmitriy@oss-tech.org> Message-ID: <1498793366-10539-1-git-send-email-dmitriy@oss-tech.org> After removing code which was premanently disabled with ifdefs, the function ksocknal_csum() becomes just a wrapper for crc32_le(). Remove this useless wrapper and instead call crc32_le() directly. This also resolves the following checkpatch warning which was triggered by the dead code: WARNING: space prohibited before semicolon Signed-off-by: Dmitriy Cherkasov --- drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h | 11 ----------- drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c | 10 +++++----- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h index 5540de6..9eb169d 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h @@ -519,17 +519,6 @@ struct ksock_proto { #define CPU_MASK_NONE 0UL #endif -static inline __u32 ksocknal_csum(__u32 crc, unsigned char const *p, size_t len) -{ -#if 1 - return crc32_le(crc, p, len); -#else - while (len-- > 0) - crc = ((crc + 0x100) & ~0xff) | ((crc + *p++) & 0xff) ; - return crc; -#endif -} - static inline int ksocknal_route_mask(void) { diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c index 8a036f4..a3735da 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c @@ -201,7 +201,7 @@ if (fragnob > sum) fragnob = sum; - conn->ksnc_rx_csum = ksocknal_csum(conn->ksnc_rx_csum, + conn->ksnc_rx_csum = crc32_le(conn->ksnc_rx_csum, iov[i].iov_base, fragnob); } @@ -243,7 +243,7 @@ if (fragnob > sum) fragnob = sum; - conn->ksnc_rx_csum = ksocknal_csum(conn->ksnc_rx_csum, + conn->ksnc_rx_csum = crc32_le(conn->ksnc_rx_csum, base, fragnob); kunmap(kiov[i].bv_page); @@ -265,7 +265,7 @@ tx->tx_msg.ksm_csum = 0; - csum = ksocknal_csum(~0, tx->tx_iov[0].iov_base, + csum = crc32_le(~0, tx->tx_iov[0].iov_base, tx->tx_iov[0].iov_len); if (tx->tx_kiov) { @@ -273,13 +273,13 @@ base = kmap(tx->tx_kiov[i].bv_page) + tx->tx_kiov[i].bv_offset; - csum = ksocknal_csum(csum, base, tx->tx_kiov[i].bv_len); + csum = crc32_le(csum, base, tx->tx_kiov[i].bv_len); kunmap(tx->tx_kiov[i].bv_page); } } else { for (i = 1; i < tx->tx_niov; i++) - csum = ksocknal_csum(csum, tx->tx_iov[i].iov_base, + csum = crc32_le(csum, tx->tx_iov[i].iov_base, tx->tx_iov[i].iov_len); } -- 1.9.1 From dmitriy at oss-tech.org Thu Jun 29 04:42:36 2017 From: dmitriy at oss-tech.org (Dmitriy Cherkasov) Date: Wed, 28 Jun 2017 21:42:36 -0700 Subject: [lustre-devel] [PATCH] staging: lustre: lnet: remove dead code Message-ID: <1498711356-14270-1-git-send-email-dmitriy@oss-tech.org> Remove code which was permanently disabled with ifdefs. This also resolves the following checkpatch warning which was triggered by the dead code: WARNING: space prohibited before semicolon Signed-off-by: Dmitriy Cherkasov --- drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h index 5540de6..7c487fa 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h @@ -521,13 +521,7 @@ struct ksock_proto { static inline __u32 ksocknal_csum(__u32 crc, unsigned char const *p, size_t len) { -#if 1 return crc32_le(crc, p, len); -#else - while (len-- > 0) - crc = ((crc + 0x100) & ~0xff) | ((crc + *p++) & 0xff) ; - return crc; -#endif } static inline int -- 1.9.1