diff options
author | Evgeniy Polyakov <zbr@ioremap.net> | 2009-01-19 12:20:37 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-04-03 17:53:33 -0400 |
commit | 30c7c1c63079e97582a592c176bebbfd38285480 (patch) | |
tree | c17704559a7745c74f648a6f732d4a24c09d9fc9 /drivers/staging/dst | |
parent | e55b689268391a3b0a0d20c951b60b2d88a5e105 (diff) |
Staging: DST: Do not allow empty barriers.
Do not allow empty barriers or generic_make_request() -> scsi_setup_fs_cmnd()
will explode
Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/dst')
-rw-r--r-- | drivers/staging/dst/dcore.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/staging/dst/dcore.c b/drivers/staging/dst/dcore.c index a72181f86e3..fad25b75304 100644 --- a/drivers/staging/dst/dcore.c +++ b/drivers/staging/dst/dcore.c | |||
@@ -100,10 +100,33 @@ static void dst_node_set_size(struct dst_node *n) | |||
100 | static int dst_request(struct request_queue *q, struct bio *bio) | 100 | static int dst_request(struct request_queue *q, struct bio *bio) |
101 | { | 101 | { |
102 | struct dst_node *n = q->queuedata; | 102 | struct dst_node *n = q->queuedata; |
103 | int err = -EIO; | ||
104 | |||
105 | if (bio_empty_barrier(bio) && !q->prepare_discard_fn) { | ||
106 | /* | ||
107 | * This is a dirty^Wnice hack, but if we complete this | ||
108 | * operation with -EOPNOTSUPP like intended, XFS | ||
109 | * will stuck and freeze the machine. This may be | ||
110 | * not particulary XFS problem though, but it is the | ||
111 | * only FS which sends empty barrier at umount time | ||
112 | * I worked with. | ||
113 | * | ||
114 | * Empty barriers are not allowed anyway, see 51fd77bd9f512 | ||
115 | * for example, although later it was changed to bio_discard() | ||
116 | * only, which does not work in this case. | ||
117 | */ | ||
118 | //err = -EOPNOTSUPP; | ||
119 | err = 0; | ||
120 | goto end_io; | ||
121 | } | ||
103 | 122 | ||
104 | bio_get(bio); | 123 | bio_get(bio); |
105 | 124 | ||
106 | return dst_process_bio(n, bio); | 125 | return dst_process_bio(n, bio); |
126 | |||
127 | end_io: | ||
128 | bio_endio(bio, err); | ||
129 | return err; | ||
107 | } | 130 | } |
108 | 131 | ||
109 | /* | 132 | /* |