Re: [PATCH] Staging: lustre: llite: fix some sparse warnings about userspace pointer
On Sat, Oct 11, 2014 at 01:31:17PM +0700, Anh Le wrote: > Add __user macro to the function declarations that accept userspace pointers > as > arguments. > if you check your patch with --strict option of checkpatch.pl , you will see many check of : Alignment should match open parenthesis thanks sudip > Signed-off-by: Anh Le > --- > .../staging/lustre/lustre/include/lprocfs_status.h | 6 +-- > drivers/staging/lustre/lustre/llite/lproc_llite.c | 48 > +++--- > .../lustre/lustre/obdclass/lprocfs_status.c| 4 +- > 3 files changed, 29 insertions(+), 29 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h > b/drivers/staging/lustre/lustre/include/lprocfs_status.h > index ccb6cd4..42fdb64 100644 > --- a/drivers/staging/lustre/lustre/include/lprocfs_status.h > +++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h > @@ -374,8 +374,8 @@ static inline void s2dhms(struct dhms *ts, time_t secs) > #define JOBSTATS_PROCNAME_UID"procname_uid" > #define JOBSTATS_NODELOCAL "nodelocal" > > -extern int lprocfs_write_frac_helper(const char *buffer, unsigned long count, > - int *val, int mult); > +extern int lprocfs_write_frac_helper(const char __user *buffer, > + unsigned long count, int *val, int mult); > extern int lprocfs_read_frac_helper(char *buffer, unsigned long count, > long val, int mult); > #if defined (CONFIG_PROC_FS) > @@ -647,7 +647,7 @@ extern int lprocfs_rd_kbytesavail(struct seq_file *m, > void *data); > extern int lprocfs_rd_filestotal(struct seq_file *m, void *data); > extern int lprocfs_rd_filesfree(struct seq_file *m, void *data); > > -extern int lprocfs_write_helper(const char *buffer, unsigned long count, > +extern int lprocfs_write_helper(const char __user *buffer, unsigned long > count, > int *val); > extern int lprocfs_seq_read_frac_helper(struct seq_file *m, long val, int > mult); > extern int lprocfs_write_u64_helper(const char *buffer, unsigned long count, > diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c > b/drivers/staging/lustre/lustre/llite/lproc_llite.c > index 3b3df9f..2a97df1 100644 > --- a/drivers/staging/lustre/lustre/llite/lproc_llite.c > +++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c > @@ -227,8 +227,8 @@ static int ll_max_readahead_mb_seq_show(struct seq_file > *m, void *v) > return lprocfs_seq_read_frac_helper(m, pages_number, mult); > } > > -static ssize_t ll_max_readahead_mb_seq_write(struct file *file, const char > *buffer, > - size_t count, loff_t *off) > +static ssize_t ll_max_readahead_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 ll_sb_info *sbi = ll_s2sbi(sb); > @@ -269,7 +269,7 @@ static int ll_max_readahead_per_file_mb_seq_show(struct > seq_file *m, void *v) > } > > static ssize_t ll_max_readahead_per_file_mb_seq_write(struct file *file, > - const char *buffer, > + const char __user *buffer, > size_t count, loff_t *off) > { > struct super_block *sb = ((struct seq_file > *)file->private_data)->private; > @@ -313,7 +313,7 @@ static int ll_max_read_ahead_whole_mb_seq_show(struct > seq_file *m, void *unused) > } > > static ssize_t ll_max_read_ahead_whole_mb_seq_write(struct file *file, > - const char *buffer, > + const char __user *buffer, > size_t count, loff_t *off) > { > struct super_block *sb = ((struct seq_file > *)file->private_data)->private; > @@ -469,8 +469,8 @@ static int ll_checksum_seq_show(struct seq_file *m, void > *v) > return seq_printf(m, "%u\n", (sbi->ll_flags & LL_SBI_CHECKSUM) ? 1 : 0); > } > > -static ssize_t ll_checksum_seq_write(struct file *file, const char *buffer, > - size_t count, loff_t *off) > +static ssize_t ll_checksum_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 ll_sb_info *sbi = ll_s2sbi(sb); > @@ -504,8 +504,8 @@ static int ll_max_rw_chunk_seq_show(struct seq_file *m, > void *v) > return seq_printf(m, "%lu\n", ll_s2sbi(sb)->ll_max_rw_chunk); > } > > -static ssize_t ll_max_rw_chunk_seq_write(struct file *file, const char > *buffer, > - size_t count, loff_t *off) > +static ssize_t ll_max_rw_chunk_seq_write(struct file *file, > + const char __user *buf
Re: [PATCH net 1/1] hyperv: Fix a bug in netvsc_send()
On Fri, Oct 10, 2014 at 11:39:00PM +, Long Li wrote: > Thanks Sitsofe. Can you provide more details on the test setup? > > The kernel trace shows that skb->mac_header=0x (which means not > yet set, it's in RCX: ). See reply below. > -Original Message- > From: devel [mailto:driverdev-devel-boun...@linuxdriverproject.org] On Behalf > Of Sitsofe Wheeler > Sent: Thursday, October 09, 2014 6:32 AM > To: David Miller > Cc: o...@aepfle.de; net...@vger.kernel.org; jasow...@redhat.com; > linux-ker...@vger.kernel.org; a...@canonical.com; > de...@linuxdriverproject.org Subject: Re: [PATCH net 1/1] hyperv: Fix > a bug in netvsc_send() > > On Sun, Oct 05, 2014 at 09:11:29PM -0400, David Miller wrote: > > From: "K. Y. Srinivasan" > > Date: Sun, 5 Oct 2014 10:42:51 -0700 > > > > > After the packet is successfully sent, we should not touch the > > > packet as it may have been freed. This patch is based on the work > > > done by Long Li . > > > > > > David, please queue this up for stable. > > With 3.17.0 g782d59c (which should include this patch) I'm still seeing the > following: > > Oct 09 13:14:51 a dhclient[538]: DHCPREQUEST on eth0 to 255.255.255.255 port > 67 (xid=0x1dd33078) Oct 09 13:14:51 a dhclient[538]: DHCPACK from 10.x.x.x > (xid=0x1dd33078) Oct 09 13:14:55 a kernel: BUG: unable to handle kernel > paging request at 8800ed2e72e3 Oct 09 13:14:55 a kernel: IP: > [] netvsc_select_queue+0x3d/0x150 Oct 09 13:14:55 a kernel: > PGD 2db5067 PUD 2075be067 PMD 207454067 PTE 8000ed2e7060 Oct 09 13:14:55 > a kernel: Oops: [#1] SMP DEBUG_PAGEALLOC Oct 09 13:14:55 a kernel: CPU: > 6 PID: 566 Comm: arping Not tainted 3.17.0.x86_64-05585-g782d59c #147 Oct 09 > 13:14:55 a kernel: Hardware name: Microsoft Corporation Virtual > Machine/Virtual Machine, BIOS 090006 05/23/2012 Oct 09 13:14:55 a kernel: > task: 8801f978b9f0 ti: 8801f3b84000 task.ti: 8801f3b84000 Oct 09 > 13:14:55 a kernel: RIP: 0010:[] [] > netvsc_select_queue+0x3d/0x150 Oct 09 13:14:55 a kernel: RSP: > 0018:8801f3b87c60 EFLAGS: 00010202 Oct 09 13:14:55 a kernel: RAX: RBX: 8800f13e8000 RCX: Oct 09 13:14:55 a kernel: RDX: 8800ed2d72d8 RSI: 8801fabca1c0 RDI: 8800f13e8000 Oct 09 13:14:55 a kernel: RBP: 8801f3b87c88 R08: 002a R09: Oct 09 13:14:55 a kernel: R10: 8801f83b3f60 R11: 0008 R12: 8801fabca1c0 Oct 09 13:14:55 a kernel: R13: R14: 8800ed359bd8 R15: 8801fabca1c0 Oct 09 13:14:55 a kernel: FS: 7f943a5c9740() GS:880206cc() knlGS: Oct 09 13:14:55 a kernel: CS: 0010 DS: ES: CR0: 80050033 Oct 09 13:14:55 a kernel: CR2: 8800ed2e72e3 CR3: 0001f3957000 CR4: 000406e0 Oct 09 13:14:55 a kernel: Stack: I'm not quite sure what's happened to the formatting above but oh well. My kernel config is essentially the same as the one described in https://lkml.org/lkml/2014/8/19/708 but the key might be that it is configured to do extra verification setup/checks. The guest is currently configured to have 8 vpcus and 8GBytes of RAM. # # Automatically generated file; DO NOT EDIT. # Linux/x86 3.17.0 Kernel Configuration # CONFIG_64BIT=y CONFIG_X86_64=y CONFIG_X86=y CONFIG_INSTRUCTION_DECODER=y CONFIG_OUTPUT_FORMAT="elf64-x86-64" CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig" CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_HAVE_LATENCYTOP_SUPPORT=y CONFIG_MMU=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y CONFIG_GENERIC_HWEIGHT=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_ARCH_HAS_CPU_RELAX=y CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y CONFIG_HAVE_SETUP_PER_CPU_AREA=y CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y CONFIG_ARCH_WANT_GENERAL_HUGETLB=y CONFIG_ZONE_DMA32=y CONFIG_AUDIT_ARCH=y CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y CONFIG_HAVE_INTEL_TXT=y CONFIG_X86_64_SMP=y CONFIG_X86_HT=y CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11" CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_EXTABLE_SORT=y # # General setup # CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_CROSS_COMPILE="" # CONFIG_COMPILE_TEST is not set CONFIG_LOCALVERSION=".x86_64" CONFIG_LOCALVERSION_AUTO=y CONFIG_HAVE_KERNEL_GZIP=y CONFIG_HAVE_KERNEL_BZIP2=y CONFIG_HAVE_KERNEL_LZMA=y CONFIG_HAVE_KERNEL_XZ=y CONFIG_HAVE_KERNEL_LZO=y CONFIG_HAVE_KERNEL_LZ4=y CONFIG_KERNEL_GZIP=y # CONFIG_KERN
Re: [PATCH 11/15] staging: rtl8723au: Remove a stack of write only counters
On Fri, Oct 10, 2014 at 09:41:34PM +0200, jes.soren...@redhat.com wrote: > From: Jes Sorensen > > We don't do anything with these, so get rid of them > > Signed-off-by: Jes Sorensen > --- > drivers/staging/rtl8723au/core/rtw_xmit.c| 6 -- > drivers/staging/rtl8723au/include/rtw_xmit.h | 5 - > drivers/staging/rtl8723au/os_dep/usb_ops_linux.c | 16 > 3 files changed, 27 deletions(-) This one didn't apply to my tree for some reason, let me see if I can do it by hand... ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 11/15] staging: rtl8723au: Remove a stack of write only counters
On Sat, Oct 11, 2014 at 05:32:49AM -0700, Greg KH wrote: > On Fri, Oct 10, 2014 at 09:41:34PM +0200, jes.soren...@redhat.com wrote: > > From: Jes Sorensen > > > > We don't do anything with these, so get rid of them > > > > Signed-off-by: Jes Sorensen > > --- > > drivers/staging/rtl8723au/core/rtw_xmit.c| 6 -- > > drivers/staging/rtl8723au/include/rtw_xmit.h | 5 - > > drivers/staging/rtl8723au/os_dep/usb_ops_linux.c | 16 > > 3 files changed, 27 deletions(-) > > This one didn't apply to my tree for some reason, let me see if I can do > it by hand... Got it, all now applied, thanks. greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/3] scsi: Add Hyper-V logical block provisioning quirks
On Fri, Oct 10, 2014 at 08:49:01AM +0100, Sitsofe Wheeler wrote: > Microsoft Hyper-V virtual disks currently only claim SPC-2 compliance > even though they implement post SPC-2 features (such as thin > provisioning) which means the Linux kernel does not go on to test for > those features even though they are advertised. > > A previous patch attempted to add a quirk to workaround this but the > quirk was only enabled after the features had been scanned for, wouldn't > work for "small" disks and would quirk on all Hyper-V SCSI devices > (e.g. passthrough disks). > > The new patches partially revert the previous effort, add the quirk in a > more traditional manner to only Hyper-V virtual disks and work on small > virtual disks. This seems like might want a quirk to simply "force" a SPC3 compliance level? ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/3] scsi: Add Hyper-V logical block provisioning quirks
On Sat, 2014-10-11 at 10:39 -0700, Christoph Hellwig wrote: > On Fri, Oct 10, 2014 at 08:49:01AM +0100, Sitsofe Wheeler wrote: > > Microsoft Hyper-V virtual disks currently only claim SPC-2 compliance > > even though they implement post SPC-2 features (such as thin > > provisioning) which means the Linux kernel does not go on to test for > > those features even though they are advertised. > > > > A previous patch attempted to add a quirk to workaround this but the > > quirk was only enabled after the features had been scanned for, wouldn't > > work for "small" disks and would quirk on all Hyper-V SCSI devices > > (e.g. passthrough disks). > > > > The new patches partially revert the previous effort, add the quirk in a > > more traditional manner to only Hyper-V virtual disks and work on small > > virtual disks. > > This seems like might want a quirk to simply "force" a SPC3 compliance > level? This was initially suggested, but rejected by Microsoft because of other problems advertising SPC-3 compliance brings. Perhaps the hyper-v emulator has matured sufficiently that it will now work OK? James ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/1] drivers/staging: Fixed sparse error "directive in argument list"
This patch fixes a sparse warning on layout.c (ptlrpc) that was caused by having preprocessor directives in the arguments to a macro. Signed-off-by: Filipe Gonçalves --- drivers/staging/lustre/lustre/ptlrpc/layout.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/ptlrpc/layout.c b/drivers/staging/lustre/lustre/ptlrpc/layout.c index 5b83371..211df78 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/layout.c +++ b/drivers/staging/lustre/lustre/ptlrpc/layout.c @@ -978,10 +978,11 @@ struct req_msg_field RMF_CONN = EXPORT_SYMBOL(RMF_CONN); struct req_msg_field RMF_CONNECT_DATA = +#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0) DEFINE_MSGF("cdata", RMF_F_NO_SIZE_CHECK /* we allow extra space for interop */, -#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0) sizeof(struct obd_connect_data), + lustre_swab_connect, NULL); #else /* For interoperability with 1.8 and 2.0 clients/servers. * The RPC verification code allows larger RPC buffers, but not @@ -990,9 +991,11 @@ struct req_msg_field RMF_CONNECT_DATA = * size is at least as large as obd_connect_data_v1. That is not * not in itself harmful, since the chance of just corrupting this * field is low. See JIRA LU-16 for details. */ + DEFINE_MSGF("cdata", + RMF_F_NO_SIZE_CHECK /* we allow extra space for interop */, sizeof(struct obd_connect_data_v1), -#endif lustre_swab_connect, NULL); +#endif EXPORT_SYMBOL(RMF_CONNECT_DATA); struct req_msg_field RMF_DLM_REQ = -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 0/3] scsi: Add Hyper-V logical block provisioning quirks
> -Original Message- > From: James Bottomley [mailto:james.bottom...@hansenpartnership.com] > Sent: Saturday, October 11, 2014 10:42 AM > To: Christoph Hellwig > Cc: Sitsofe Wheeler; KY Srinivasan; Haiyang Zhang; Christoph Hellwig; Hannes > Reinecke; linux-s...@vger.kernel.org; linux-ker...@vger.kernel.org; > de...@linuxdriverproject.org > Subject: Re: [PATCH 0/3] scsi: Add Hyper-V logical block provisioning quirks > > On Sat, 2014-10-11 at 10:39 -0700, Christoph Hellwig wrote: > > On Fri, Oct 10, 2014 at 08:49:01AM +0100, Sitsofe Wheeler wrote: > > > Microsoft Hyper-V virtual disks currently only claim SPC-2 > > > compliance even though they implement post SPC-2 features (such as > > > thin > > > provisioning) which means the Linux kernel does not go on to test > > > for those features even though they are advertised. > > > > > > A previous patch attempted to add a quirk to workaround this but the > > > quirk was only enabled after the features had been scanned for, > > > wouldn't work for "small" disks and would quirk on all Hyper-V SCSI > > > devices (e.g. passthrough disks). > > > > > > The new patches partially revert the previous effort, add the quirk > > > in a more traditional manner to only Hyper-V virtual disks and work > > > on small virtual disks. > > > > This seems like might want a quirk to simply "force" a SPC3 compliance > > level? > > This was initially suggested, but rejected by Microsoft because of other > problems advertising SPC-3 compliance brings. Perhaps the hyper-v > emulator has matured sufficiently that it will now work OK? James, On the current release of Windows (windows 10), we are advertising SPC3 compliance. We are ok with declaring compliance to SPC3 in our drivers. Regards, K. Y ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] drivers/staging: Fixed sparse error "directive in argument list"
On Sat, Oct 11, 2014 at 08:13:42PM +0100, Filipe Gonçalves wrote: > This patch fixes a sparse warning on layout.c (ptlrpc) that was caused by > having preprocessor directives in the arguments to a macro. > > Signed-off-by: Filipe Gonçalves > --- > drivers/staging/lustre/lustre/ptlrpc/layout.c | 7 +-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/ptlrpc/layout.c > b/drivers/staging/lustre/lustre/ptlrpc/layout.c > index 5b83371..211df78 100644 > --- a/drivers/staging/lustre/lustre/ptlrpc/layout.c > +++ b/drivers/staging/lustre/lustre/ptlrpc/layout.c > @@ -978,10 +978,11 @@ struct req_msg_field RMF_CONN = > EXPORT_SYMBOL(RMF_CONN); > > struct req_msg_field RMF_CONNECT_DATA = > +#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0) > DEFINE_MSGF("cdata", > RMF_F_NO_SIZE_CHECK /* we allow extra space for interop */, > -#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0) > sizeof(struct obd_connect_data), > + lustre_swab_connect, NULL); Ick ick ick. Yeah, sparse might complain about this, but how about just properly deleting the #ifdef entirely, and not perpetuate it even more? It shouldn't be needed anymore now that the code is in the kernel tree. greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 0/3] scsi: Add Hyper-V logical block provisioning quirks
> On the current release of Windows (windows 10), we are advertising SPC3 > compliance. > We are ok with declaring compliance to SPC3 in our drivers. If you are going to declare SPC3 compliance in the drivers, are you going to put in checks to ensure that SPC-3 compliance doesn't get accidentally enabled for hypervisors below Win10? I do know for a fact that Ubuntu's kernels already force SPC3 compliance to enable specific features such as TRIM on earlier versions of Hyper-V (Namely Hyper-V 2012 and 2012 R2). --Jeff > Regards, > > K. Y > > > NryزXvؖ){nlj{zX}zj:v zZzf~zwڢ)jyA > > i ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/1] drivers/staging: Removed unnecessary check for LUSTRE_VERSION_CODE
From: Filipe Gonçalves Given that this code is now part of the kernel tree, the #ifdef directive comparing LUSTRE_VERSION_CODE to the kernel version is no longer needed. As a side effect, this will also remove the sparse error "directive in argument list". Signed-off-by: Filipe Gonçalves --- drivers/staging/lustre/lustre/ptlrpc/layout.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/staging/lustre/lustre/ptlrpc/layout.c b/drivers/staging/lustre/lustre/ptlrpc/layout.c index 5b83371..78364ec 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/layout.c +++ b/drivers/staging/lustre/lustre/ptlrpc/layout.c @@ -980,18 +980,7 @@ EXPORT_SYMBOL(RMF_CONN); struct req_msg_field RMF_CONNECT_DATA = DEFINE_MSGF("cdata", RMF_F_NO_SIZE_CHECK /* we allow extra space for interop */, -#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0) sizeof(struct obd_connect_data), -#else -/* For interoperability with 1.8 and 2.0 clients/servers. - * The RPC verification code allows larger RPC buffers, but not - * smaller buffers. Until we no longer need to keep compatibility - * with older servers/clients we can only check that the buffer - * size is at least as large as obd_connect_data_v1. That is not - * not in itself harmful, since the chance of just corrupting this - * field is low. See JIRA LU-16 for details. */ - sizeof(struct obd_connect_data_v1), -#endif lustre_swab_connect, NULL); EXPORT_SYMBOL(RMF_CONNECT_DATA); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] drivers/staging: Fixed sparse error "directive in argument list"
Hello! No, it's not the way to test the kernel version, it's the way to test internal lustre version. Either way maintaining compatibility with Lustre 1.8 and 2.0 servers should not be important anymore, so it's fine to drop this check indeed. Bye, Oleg On Oct 11, 2014, at 5:06 PM, Filipe Gonçalves wrote: > Ah .. right! I didn't know what OBD_OCD_VERSION() was. Now I see it's > a way to test kernel version. I am going to submit a new patch > shortly. > > Thanks, > Filipe > > On Sat, Oct 11, 2014 at 9:15 PM, Greg KH wrote: >> >> On Sat, Oct 11, 2014 at 08:13:42PM +0100, Filipe Gonçalves wrote: >>> This patch fixes a sparse warning on layout.c (ptlrpc) that was caused by >>> having preprocessor directives in the arguments to a macro. >>> >>> Signed-off-by: Filipe Gonçalves >>> --- >>> drivers/staging/lustre/lustre/ptlrpc/layout.c | 7 +-- >>> 1 file changed, 5 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/staging/lustre/lustre/ptlrpc/layout.c >>> b/drivers/staging/lustre/lustre/ptlrpc/layout.c >>> index 5b83371..211df78 100644 >>> --- a/drivers/staging/lustre/lustre/ptlrpc/layout.c >>> +++ b/drivers/staging/lustre/lustre/ptlrpc/layout.c >>> @@ -978,10 +978,11 @@ struct req_msg_field RMF_CONN = >>> EXPORT_SYMBOL(RMF_CONN); >>> >>> struct req_msg_field RMF_CONNECT_DATA = >>> +#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0) >>> DEFINE_MSGF("cdata", >>> RMF_F_NO_SIZE_CHECK /* we allow extra space for interop */, >>> -#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0) >>> sizeof(struct obd_connect_data), >>> + lustre_swab_connect, NULL); >> >> Ick ick ick. >> >> Yeah, sparse might complain about this, but how about just properly >> deleting the #ifdef entirely, and not perpetuate it even more? >> >> It shouldn't be needed anymore now that the code is in the kernel tree. >> >> greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 0/3] scsi: Add Hyper-V logical block provisioning quirks
> -Original Message- > From: Jeff Leung [mailto:jle...@v10networks.ca] > Sent: Saturday, October 11, 2014 1:22 PM > To: KY Srinivasan; James Bottomley; Christoph Hellwig > Cc: Sitsofe Wheeler; Haiyang Zhang; Christoph Hellwig; Hannes Reinecke; > linux-s...@vger.kernel.org; linux-ker...@vger.kernel.org; > de...@linuxdriverproject.org > Subject: RE: [PATCH 0/3] scsi: Add Hyper-V logical block provisioning quirks > > > On the current release of Windows (windows 10), we are advertising SPC3 > compliance. > > We are ok with declaring compliance to SPC3 in our drivers. > If you are going to declare SPC3 compliance in the drivers, are you going to > put in checks to ensure that SPC-3 compliance doesn't get accidentally > enabled for hypervisors below Win10? > > I do know for a fact that Ubuntu's kernels already force SPC3 compliance to > enable specific features such as TRIM on earlier versions of Hyper-V (Namely > Hyper-V 2012 and 2012 R2). You are right; Ubuntu has been carrying a patch that was doing just this and this has been working without any issues on many earlier versions of Windows. (2012 and 2012 R2). On windows 10 we don't need any changes in the Linux driver as the host itself is advertising SPC3 compliance. Based on the testing we have done with Ubuntu, we are comfortable picking up that patch. Regards, K. Y > > --Jeff > > > Regards, > > > > K. Y > > > > > > NryزXvؖ){nlj{zX}zj:v zZzf~zwڢ)jyA > > > > i ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] drivers/staging: Fixed sparse error "directive in argument list"
Ah .. right! I didn't know what OBD_OCD_VERSION() was. Now I see it's a way to test kernel version. I am going to submit a new patch shortly. Thanks, Filipe On Sat, Oct 11, 2014 at 9:15 PM, Greg KH wrote: > > On Sat, Oct 11, 2014 at 08:13:42PM +0100, Filipe Gonçalves wrote: >> This patch fixes a sparse warning on layout.c (ptlrpc) that was caused by >> having preprocessor directives in the arguments to a macro. >> >> Signed-off-by: Filipe Gonçalves >> --- >> drivers/staging/lustre/lustre/ptlrpc/layout.c | 7 +-- >> 1 file changed, 5 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/staging/lustre/lustre/ptlrpc/layout.c >> b/drivers/staging/lustre/lustre/ptlrpc/layout.c >> index 5b83371..211df78 100644 >> --- a/drivers/staging/lustre/lustre/ptlrpc/layout.c >> +++ b/drivers/staging/lustre/lustre/ptlrpc/layout.c >> @@ -978,10 +978,11 @@ struct req_msg_field RMF_CONN = >> EXPORT_SYMBOL(RMF_CONN); >> >> struct req_msg_field RMF_CONNECT_DATA = >> +#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0) >> DEFINE_MSGF("cdata", >> RMF_F_NO_SIZE_CHECK /* we allow extra space for interop */, >> -#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0) >> sizeof(struct obd_connect_data), >> + lustre_swab_connect, NULL); > > Ick ick ick. > > Yeah, sparse might complain about this, but how about just properly > deleting the #ifdef entirely, and not perpetuate it even more? > > It shouldn't be needed anymore now that the code is in the kernel tree. > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] drivers/staging: Fixed sparse error "directive in argument list"
Hi, Oops.. sorry for the mess then. I am still trying to get to know the codebase. I submitted a new patch where I removed the check. Thanks for your patience :) Best, Filipe On Sat, Oct 11, 2014 at 10:49 PM, Drokin, Oleg wrote: > > Hello! > >No, it's not the way to test the kernel version, it's the way to test > internal >lustre version. >Either way maintaining compatibility with Lustre 1.8 and 2.0 servers > should not >be important anymore, so it's fine to drop this check indeed. > > Bye, > Oleg > On Oct 11, 2014, at 5:06 PM, Filipe Gonçalves wrote: > >> Ah .. right! I didn't know what OBD_OCD_VERSION() was. Now I see it's >> a way to test kernel version. I am going to submit a new patch >> shortly. >> >> Thanks, >> Filipe >> >> On Sat, Oct 11, 2014 at 9:15 PM, Greg KH wrote: >>> >>> On Sat, Oct 11, 2014 at 08:13:42PM +0100, Filipe Gonçalves wrote: This patch fixes a sparse warning on layout.c (ptlrpc) that was caused by having preprocessor directives in the arguments to a macro. Signed-off-by: Filipe Gonçalves --- drivers/staging/lustre/lustre/ptlrpc/layout.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/ptlrpc/layout.c b/drivers/staging/lustre/lustre/ptlrpc/layout.c index 5b83371..211df78 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/layout.c +++ b/drivers/staging/lustre/lustre/ptlrpc/layout.c @@ -978,10 +978,11 @@ struct req_msg_field RMF_CONN = EXPORT_SYMBOL(RMF_CONN); struct req_msg_field RMF_CONNECT_DATA = +#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0) DEFINE_MSGF("cdata", RMF_F_NO_SIZE_CHECK /* we allow extra space for interop */, -#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0) sizeof(struct obd_connect_data), + lustre_swab_connect, NULL); >>> >>> Ick ick ick. >>> >>> Yeah, sparse might complain about this, but how about just properly >>> deleting the #ifdef entirely, and not perpetuate it even more? >>> >>> It shouldn't be needed anymore now that the code is in the kernel tree. >>> >>> greg k-h > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] staging/lustre/ptlrpc: get rid of lustre 1.8 compatible checksums
Old version of lustre (1.8) calculated RPC checksums differently, but the compat code is no longer important since in-kernel version of lustre is nto compatible with 1.8 lustre servers (that are long deprecated too). Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/lustre_net.h | 5 - .../staging/lustre/lustre/ptlrpc/pack_generic.c| 26 -- drivers/staging/lustre/lustre/ptlrpc/sec_null.c| 18 --- 3 files changed, 49 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h b/drivers/staging/lustre/lustre/include/lustre_net.h index 0a024d3..0235d7a 100644 --- a/drivers/staging/lustre/lustre/include/lustre_net.h +++ b/drivers/staging/lustre/lustre/include/lustre_net.h @@ -2627,12 +2627,7 @@ __u32 lustre_msg_get_timeout(struct lustre_msg *msg); __u32 lustre_msg_get_service_time(struct lustre_msg *msg); char *lustre_msg_get_jobid(struct lustre_msg *msg); __u32 lustre_msg_get_cksum(struct lustre_msg *msg); -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 50, 0) -__u32 lustre_msg_calc_cksum(struct lustre_msg *msg, int compat18); -#else -# warning "remove checksum compatibility support for b1_8" __u32 lustre_msg_calc_cksum(struct lustre_msg *msg); -#endif void lustre_msg_set_handle(struct lustre_msg *msg, struct lustre_handle *handle); void lustre_msg_set_type(struct lustre_msg *msg, __u32 type); diff --git a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c index 50556db..60552f4 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c @@ -1313,43 +1313,17 @@ __u32 lustre_msg_get_cksum(struct lustre_msg *msg) } } -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 50, 0) -/* - * In 1.6 and 1.8 the checksum was computed only on struct ptlrpc_body as - * it was in 1.6 (88 bytes, smaller than the full size in 1.8). It makes - * more sense to compute the checksum on the full ptlrpc_body, regardless - * of what size it is, but in order to keep interoperability with 1.8 we - * can optionally also checksum only the first 88 bytes (caller decides). */ -# define ptlrpc_body_cksum_size_compat1888 - -__u32 lustre_msg_calc_cksum(struct lustre_msg *msg, int compat18) -#else -# warning "remove checksum compatibility support for b1_8" __u32 lustre_msg_calc_cksum(struct lustre_msg *msg) -#endif { switch (msg->lm_magic) { case LUSTRE_MSG_MAGIC_V2: { struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 50, 0) - __u32 crc; - unsigned int hsize = 4; - __u32 len = compat18 ? ptlrpc_body_cksum_size_compat18 : - lustre_msg_buflen(msg, MSG_PTLRPC_BODY_OFF); - LASSERTF(pb, "invalid msg %p: no ptlrpc body!\n", msg); - cfs_crypto_hash_digest(CFS_HASH_ALG_CRC32, (unsigned char *)pb, - len, NULL, 0, (unsigned char *)&crc, - &hsize); - return crc; -#else -# warning "remove checksum compatibility support for b1_8" __u32 crc; unsigned int hsize = 4; cfs_crypto_hash_digest(CFS_HASH_ALG_CRC32, (unsigned char *)pb, lustre_msg_buflen(msg, MSG_PTLRPC_BODY_OFF), NULL, 0, (unsigned char *)&crc, &hsize); return crc; -#endif } default: CERROR("incorrect message magic: %08x\n", msg->lm_magic); diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c index 099cec3..4e13243 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c @@ -101,16 +101,7 @@ int null_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req) if (req->rq_early) { cksums = lustre_msg_get_cksum(req->rq_repdata); -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 50, 0) - if (lustre_msghdr_get_flags(req->rq_reqmsg) & - MSGHDR_CKSUM_INCOMPAT18) - cksumc = lustre_msg_calc_cksum(req->rq_repmsg, 0); - else - cksumc = lustre_msg_calc_cksum(req->rq_repmsg, 1); -#else -# warning "remove checksum compatibility support for b1_8" cksumc = lustre_msg_calc_cksum(req->rq_repmsg); -#endif if (cksumc != cksums) { CDEBUG(D_SEC, "early reply checksum mismatch: %08x != %08x\n", @@ -371,16 +362,7 @@ int null_authorize(struct ptlrpc_request *req) } else { __u32 cksum; -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 50, 0) - if (lustre_msghdr_get_flags(req->rq_reqms
[PATCH 3/3] staging/lustre/quota: Get rid of compat quota code
Nobody should be using any fo the old lustre 1.8 era tools anymore, so drop compatibility with those. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/llite/dir.c | 58 -- .../staging/lustre/lustre/llite/llite_internal.h | 18 --- 2 files changed, 76 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index b0bb709..a9b460d 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -1694,64 +1694,6 @@ out_poll: OBD_FREE_PTR(check); return rc; } -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 50, 0) - case LL_IOC_QUOTACTL_18: { - /* copy the old 1.x quota struct for internal use, then copy -* back into old format struct. For 1.8 compatibility. */ - struct if_quotactl_18 *qctl_18; - struct if_quotactl *qctl_20; - - qctl_18 = kzalloc(sizeof(*qctl_18), GFP_NOFS); - if (!qctl_18) - return -ENOMEM; - - qctl_20 = kzalloc(sizeof(*qctl_20), GFP_NOFS); - if (!qctl_20) { - rc = -ENOMEM; - goto out_quotactl_18; - } - - if (copy_from_user(qctl_18, (void *)arg, sizeof(*qctl_18))) { - rc = -ENOMEM; - goto out_quotactl_20; - } - - QCTL_COPY(qctl_20, qctl_18); - qctl_20->qc_idx = 0; - - /* XXX: dqb_valid was borrowed as a flag to mark that -* only mds quota is wanted */ - if (qctl_18->qc_cmd == Q_GETQUOTA && - qctl_18->qc_dqblk.dqb_valid) { - qctl_20->qc_valid = QC_MDTIDX; - qctl_20->qc_dqblk.dqb_valid = 0; - } else if (qctl_18->obd_uuid.uuid[0] != '\0') { - qctl_20->qc_valid = QC_UUID; - qctl_20->obd_uuid = qctl_18->obd_uuid; - } else { - qctl_20->qc_valid = QC_GENERAL; - } - - rc = quotactl_ioctl(sbi, qctl_20); - - if (rc == 0) { - QCTL_COPY(qctl_18, qctl_20); - qctl_18->obd_uuid = qctl_20->obd_uuid; - - if (copy_to_user((void *)arg, qctl_18, -sizeof(*qctl_18))) - rc = -EFAULT; - } - -out_quotactl_20: - OBD_FREE_PTR(qctl_20); -out_quotactl_18: - OBD_FREE_PTR(qctl_18); - return rc; - } -#else -#warning "remove old LL_IOC_QUOTACTL_18 compatibility code" -#endif /* LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 50, 0) */ case LL_IOC_QUOTACTL: { struct if_quotactl *qctl; diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index 36aa0fd..2845aab 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -1509,24 +1509,6 @@ static inline void d_lustre_revalidate(struct dentry *dentry) spin_unlock(&dentry->d_lock); } -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 50, 0) -/* Compatibility for old (1.8) compiled userspace quota code */ -struct if_quotactl_18 { - __u32 qc_cmd; - __u32 qc_type; - __u32 qc_id; - __u32 qc_stat; - struct obd_dqinfo qc_dqinfo; - struct obd_dqblkqc_dqblk; - charobd_type[16]; - struct obd_uuid obd_uuid; -}; -#define LL_IOC_QUOTACTL_18 _IOWR('f', 162, struct if_quotactl_18 *) -/* End compatibility for old (1.8) compiled userspace quota code */ -#else -#warning "remove old LL_IOC_QUOTACTL_18 compatibility code" -#endif /* LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 50, 0) */ - enum { LL_LAYOUT_GEN_NONE = ((__u32)-2), /* layout lock was cancelled */ LL_LAYOUT_GEN_EMPTY = ((__u32)-1) /* for empty layout */ -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/3] Lustre: remove old compat code
These three patches remove support for code that is no longer needed. Mostly ability to talk to old version of lustre clients and servers. Oleg Drokin (3): staging/lustre/ptlrpc: get rid of lustre 1.8 compatible checksums staging/lustre: get rid of deprecaed acl mount option code staging/lustre/quota: Get rid of compat quota code drivers/staging/lustre/lustre/include/lustre_net.h | 5 -- drivers/staging/lustre/lustre/llite/dir.c | 58 -- .../staging/lustre/lustre/llite/llite_internal.h | 18 --- drivers/staging/lustre/lustre/llite/llite_lib.c| 19 --- .../staging/lustre/lustre/ptlrpc/pack_generic.c| 26 -- drivers/staging/lustre/lustre/ptlrpc/sec_null.c| 18 --- 6 files changed, 144 deletions(-) -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] staging/lustre: get rid of deprecaed acl mount option code
This is long since unused code, so get rid of it. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/llite/llite_lib.c | 19 --- 1 file changed, 19 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index a8bcc51..695424b 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -816,25 +816,6 @@ static int ll_options(char *options, int *flags) *flags &= ~tmp; goto next; } -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 5, 50, 0) - tmp = ll_set_opt("acl", s1, LL_SBI_ACL); - if (tmp) { - /* Ignore deprecated mount option. The client will -* always try to mount with ACL support, whether this -* is used depends on whether server supports it. */ - LCONSOLE_ERROR_MSG(0x152, "Ignoring deprecated " - "mount option 'acl'.\n"); - goto next; - } - tmp = ll_set_opt("noacl", s1, LL_SBI_ACL); - if (tmp) { - LCONSOLE_ERROR_MSG(0x152, "Ignoring deprecated " - "mount option 'noacl'.\n"); - goto next; - } -#else -#warning "{no}acl options have been deprecated since 1.8, please remove them" -#endif tmp = ll_set_opt("remote_client", s1, LL_SBI_RMT_CLIENT); if (tmp) { *flags |= tmp; -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel