Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752367Ab2FROUq (ORCPT ); Mon, 18 Jun 2012 10:20:46 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:42487 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752460Ab2FROUo (ORCPT ); Mon, 18 Jun 2012 10:20:44 -0400 Date: Mon, 18 Jun 2012 10:20:43 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Michal Nazarewicz cc: Felipe Balbi , , Subject: Re: =?UTF-8?q?=5BPATCH=202/3=5D=20usb=3A=20gadget=3A=20mass=5Fstorage=3A=20fail=20fsg=5Fstore=5Ffile=28=29=20early=20if=20colud=20not=20open=20file?= In-Reply-To: <3d80ba5730fb74945ee903664e57f257507bc47c.1340022674.git.mina86@mina86.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 964 Lines: 23 On Mon, 18 Jun 2012, Michal Nazarewicz wrote: > From: Michal Nazarewicz > > Currently, when a new value is stored to the “file” sysfs entry, > fsg_store_file() will release existing backing file and only then attempt to > open a new one. If that fails, no new backing file is open. > > This commit changes the fsg_lun_open() so that it closes existing backing file > only after the new backing file has been successfully opened. With that > change, fsg_store_file() may use it to perform an atomic open operation with > guarantee that logical unit will either point to the new backing file or still > to the old one. This is a good idea. Acked-by: Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/