[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070320221615.GO3545@elf.ucw.cz>
Date: Tue, 20 Mar 2007 23:16:15 +0100
From: Pavel Machek <pavel@....cz>
To: "Rafael J. Wysocki" <rjw@...k.pl>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 4/5] swsusp: fix error paths in snapshot_open
Hi!
> We forget to increase device_available if there's an error in
> snapshot_open(), so the snapshot device cannot be open at all after
> snapshot_open() has returned an error.
Actually, this should go to the beggining of series, as it is
(non-critical) bugfix.
Pavel
> @@ -49,12 +49,14 @@ static int snapshot_open(struct inode *i
> if (!atomic_add_unless(&device_available, -1, 0))
> return -EBUSY;
>
> - if ((filp->f_flags & O_ACCMODE) == O_RDWR)
> + if ((filp->f_flags & O_ACCMODE) == O_RDWR) {
> + atomic_inc(&device_available);
> return -ENOSYS;
> -
> - if(create_basic_memory_bitmaps())
> + }
> + if(create_basic_memory_bitmaps()) {
> + atomic_inc(&device_available);
> return -ENOMEM;
> -
> + }
> nonseekable_open(inode, filp);
> data = &snapshot_state;
> filp->private_data = data;
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists