From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Layton Subject: Re: [PATCH RFC] vfs: make fstatat retry on ESTALE errors from getattr call Date: Fri, 13 Apr 2012 08:09:27 -0400 Message-ID: <20120413080927.72cca80f@tlielax.poochiereds.net> References: <1334316311-22331-1-git-send-email-jlayton@redhat.com> <20120413120232.GA27179@umich.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, pstaubach-83r9SdEf25FBDgjK7y7TUQ@public.gmane.org, miklos-sUDqSbJrdHQHWmgEVkV9KA@public.gmane.org, viro-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org, hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org, michael.brantley-Iq/kdjr4a97QT0dZR+AlfA@public.gmane.org To: Jim Rees Return-path: In-Reply-To: <20120413120232.GA27179-63aXycvo3TyHXe+LvDLADg@public.gmane.org> Sender: linux-nfs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-fsdevel.vger.kernel.org On Fri, 13 Apr 2012 08:02:32 -0400 Jim Rees wrote: > Jeff Layton wrote: > > +retry: > error = user_path_at(dfd, filename, lookup_flags, &path); > if (error) > goto out; > > error = vfs_getattr(path.mnt, path.dentry, stat); > + should_retry = error == -ESTALE ? retry_estale(path.dentry) : false; > path_put(&path); > + if (should_retry) { > + lookup_flags |= LOOKUP_REVAL; > + goto retry; > + } > out: > return error; > } > > This is starting to look like FORTRAN. Maybe turn this into a "do while"? > Then you could make the "goto out" into a break and get rid of them both. Sure, that's doable. If we want to do a finite number of retries that may be preferable anyway. -- Jeff Layton -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html