From: Douglas Gilbert <dgilbert@interlog.com>
To: linux-scsi@vger.kernel.org
Cc: martin.petersen@oracle.com, jejb@linux.vnet.ibm.com, hare@suse.de
Subject: [PATCH] sg: syncing at patch 26 versus staging
Date: Fri, 19 Feb 2021 21:16:00 -0500 [thread overview]
Message-ID: <20210220021600.77891-1-dgilbert@interlog.com> (raw)
The 5.12/scsi-staging branch current has patches 1 through 26 out
of 45 presented, applied around version 13 (currently at version
15 about to be 16). Due to bug fixes in the author's patchset,
there is a divergence in the drivers/scsi/sg.c source file. This
patch brings them back into sync.
Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
---
This patch is designed to be applied to the 5.12/scsi-staging
branch or the branch containing patches 1 through 26 taken
from patchset v13.
drivers/scsi/sg.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index c5a34bb91335..1a89f617869c 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -312,7 +312,7 @@ static const char *sg_rq_st_str(enum sg_rq_state rq_st, bool long_str);
pr_info("sg: sdp or sfp NULL, " fmt, ##a); \
} while (0)
#else
-#define SG_LOG(depth, sfp, fmt, a...) { }
+#define SG_LOG(depth, sfp, fmt, a...) do { } while (0)
#endif /* end of CONFIG_SCSI_LOGGING && SG_DEBUG conditional */
@@ -522,11 +522,9 @@ sg_release(struct inode *inode, struct file *filp)
kref_put(&sfp->f_ref, sg_remove_sfp);
/*
- * Possibly many open()s waiting on exlude clearing, start many;
+ * Possibly many open()s waiting on exclude clearing, start many;
* only open(O_EXCL)'s wait when open_cnt<2 and only start one.
*/
- /* possibly many open()s waiting on exlude clearing, start many;
- * only open(O_EXCL)s wait on 0==open_cnt so only start one */
if (test_and_clear_bit(SG_FDEV_EXCLUDE, sdp->fdev_bm))
wake_up_interruptible_all(&sdp->open_wait);
else if (o_count < 2)
@@ -1584,7 +1582,7 @@ sg_ctl_req_tbl(struct sg_fd *sfp, void __user *p)
SZ_SG_REQ_INFO * SG_MAX_QUEUE);
#endif
kfree(rinfop);
- return result;
+ return result > 0 ? -EFAULT : result; /* treat short copy as error */
}
static int
@@ -2711,9 +2709,9 @@ sg_finish_scsi_blk_rq(struct sg_request *srp)
static int
sg_mk_sgat(struct sg_request *srp, struct sg_fd *sfp, int minlen)
{
- int j, k, rem_sz, align_sz;
+ int j, k, rem_sz, align_sz, order, o_order;
int mx_sgat_elems = sfp->parentdp->max_sgat_elems;
- unsigned int elem_sz, order, o_order;
+ unsigned int elem_sz;
const size_t ptr_sz = sizeof(struct page *);
gfp_t mask_ap = GFP_ATOMIC | __GFP_COMP | __GFP_NOWARN | __GFP_ZERO;
gfp_t mask_kz = GFP_ATOMIC | __GFP_NOWARN;
--
2.25.1
reply other threads:[~2021-02-20 2:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210220021600.77891-1-dgilbert@interlog.com \
--to=dgilbert@interlog.com \
--cc=hare@suse.de \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox